OK, I create a .emacs file in the path where I install erlang.
(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.
But it doesn't work.
On the other hand I use this command:
yum install emacs-erlang.
Then /usr/share/emacs/site-emacs/sit-start.d
will have a file named 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. I feel it is strange, because I feel the erlang-init.el
is wrong but the .emacs
is right. But why in fact .emacs
can't work rightly? My OS is fedora 21 and emacs version is 24.4
OK, I create a .emacs file in the path where I install erlang.
That's not going to do anything unless that path happens to be your $HOME
directory.
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?!)
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/
See: Ch i g (emacs) Init File
RET
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.