简体   繁体   English

更改Emacs的初始化位置

[英]Changing the initialization location of Emacs

I used to take the Programming languages course on Coursera and for the sake of the course i installed SML-Mode. 我曾经在Coursera上学习编程语言课程,为了我安装SML-Mode的课程。

Now, I'd want to set up a Clojure environment in Emacs but instead of initializing Emacs from ~/.emacs.d, it initializes from the Users/karthik/Documents/sml-mode/sml-mode-startup 现在,我想在Emacs中设置一个Clojure环境,但不是从〜/ .emacs.d初始化Emacs,而是从Users / karthik / Documents / sml-mode / sml-mode-startup初始化

I deleted the sml-mode folder and on Emacs startup it shows me a warning about the files not being present. 我删除了sml-mode文件夹,在Emacs启动时,它向我显示有关文件不存在的警告。 How I do point Emacs to load Emacs Live from the home folder. 我如何指出Emacs从主文件夹加载Emacs Live。

I'm an Emacs newbie. 我是Emacs的新手。

One easy way to do it, is 一个简单的方法,是

save you closure settings in /some/dir/my-closure-settings.el and call emacs as the following (to learn about -q -l , try emacs --help ) 保存/some/dir/my-closure-settings.el闭包设置, /some/dir/my-closure-settings.el以下方式调用emacs(要了解-q -l ,请尝试emacs --help

$ emacs -q -l /some/dir/my-closure-settings.el 

or even placing an alias in bashrc , 甚至在bashrc放置一个别名,

$ alias closure-emacs='emacs -q -l /some/dir/my-closure-settings.el'
$ closure-emacs # will start emacs with your closure settings.

As you progress in learning some elisp, you will want to do it in one folder. 随着您学习某些elisp的进展,您将希望在一个文件夹中完成。

Assuming you installed Emacs yourself, and this SML-mode was an independent package, then I would speculated that it may have modified your site-start.el . 假设你自己安装了Emacs,并且这个SML模式是一个独立的包,那么我推测它可能已经修改了你的site-start.el

See if running emacs --no-site-file makes a difference. 看看运行emacs --no-site-file是否emacs --no-site-file

If that's the issue, you can visit the file with: 如果这是问题,您可以访问该文件:

M-: (find-library site-run-file) RET M- :( (find-library site-run-file) RET

You might also check: 您还可以检查:

Ch v user-emacs-directory RET Ch v user-emacs-directory RET

when running emacs in various ways: 以各种方式运行emacs时:

  • emacs
  • emacs --no-site-file
  • emacs -q
  • emacs -Q

Unless it's a custom binary, at some point it should tell you "~/.emacs.d/" 除非它是自定义二进制文件,否则它应该告诉你"~/.emacs.d/"

Installing SML-mode does not change the place of the main initialization file, which is one of ~/.emacs or ~/.emacs.d/init.el . 安装SML模式不会更改主初始化文件的位置,主文件是~/.emacs~/.emacs.d/init.el So look at those files (which ever of the two is present), and if none is present, then just create it and add what you need in it. 所以看看那些文件(两者中都存在),如果没有,那么只需创建它并在其中添加所需内容。

BTW, it looks like you're using an old sml-mode package (the newer one doesn't have an sml-mode-startup.el file). 顺便说一句,看起来你正在使用一个旧的sml-mode包(较新的没有sml-mode-startup.el文件)。 So please try and make sure the documentation that pointed you to that mode is updated: nowaday sml-mode should be installed from GNU ELPA, ie via Mx package-list or Mx package-install . 因此,请尝试确保指向该模式的文档已更新:nowaday sml-mode应从GNU ELPA安装,即通过Mx package-listMx package-install

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM