[英]How to configure erlang mode in emacs?
OK, I create a .emacs file in the path where I install erlang. 好的,我在安装erlang的路径中创建一个.emacs文件。
(setq load-path (cons "/usr/lib64/erlang/lib/tools-2.7.1/emacs" load-path)) (setq erlang-root-dir "/usr/lib64/erlang") (setq exec-path (cons "/usr/lib64/erlang/bin" exec-path)) (require 'erlang-start)
/usr/lib64
is the folder where I installed erlang.
/usr/lib64
是我安装erlang的文件夹。
But it doesn't work.
yum install emacs-erlang.
Then /usr/share/emacs/site-emacs/sit-start.d
will have a file named erlang-init.el
. 然后
/usr/share/emacs/site-emacs/sit-start.d
将有一个名为erlang-init.el
的文件。 And the content in this file is: 该文件中的内容是:
(setq load-path (cons "/usr/share/emacs/site-lisp/erlang" load-path)) (setq erlang-root-dir "/usr/lib/erlang") (setq exec-path (cons "/usr/lib/erlang/bin" exec-path)) (require 'erlang-start)
By this way, emacs can work in erlang-mode. 这样,emacs可以在erlang模式下工作。 I feel it is strange, because I feel the
erlang-init.el
is wrong but the .emacs
is right. 我觉得很奇怪,因为我觉得
erlang-init.el
是错误的,但是.emacs
是正确的。 But why in fact .emacs
can't work rightly? 但是,为什么实际上
.emacs
无法正常工作? My OS is fedora 21 and emacs version is 24.4 我的操作系统是fedora 21,而emacs版本是24.4
OK, I create a .emacs file in the path where I install erlang.
好的,我在安装erlang的路径中创建一个.emacs文件。
That's not going to do anything unless that path happens to be your $HOME
directory. 除非该路径恰好是您的
$HOME
目录,否则它不会做任何事情。
Emacs loads ~/.emacs
-- not any file by that name in any arbitrary directory you happen to put it in. (How would Emacs know it was there?!) Emacs的负荷
~/.emacs
-没有任何根据其名字在任意目录下的文件你碰巧把它(通常Emacs怎么知道它在那里?!)。
The package-managed file is no doubt being loaded because your system's emacs package has configured a site-start.el
file which loads libraries in /usr/share/emacs/site-emacs/sit-start.d/
毫无疑问,该软件包管理的文件正在加载,因为您的系统的emacs软件包已配置了
site-start.el
文件,该文件将文件加载到/usr/share/emacs/site-emacs/sit-start.d/
See: Ch i g (emacs) Init File
RET 请参阅: 章 I G
(emacs) Init File
RET
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.