I want to load the multi-web-mode
package and have put it in ~/.emacs.d/
or ~/
or ~/.emacs.d/lisp/
(so far).
My .emacs
contains the standard from the multi-web-mode distribution:
(require 'multi-web-mode)
(setq mweb-default-major-mode 'html-mode)
(setq mweb-tags
'((php-mode "<\\?php\\|<\\? \\|<\\?=" "\\?>")
(js-mode "<script[^>]*>" "</script>")
(css-mode "<style[^>]*>" "</style>")))
(setq mweb-filename-extensions '("php" "htm" "html" "ctp" "phtml" "php4" "php5"))
(multi-web-global-mode 1)
I get:
File error: Cannot open load file, no such file or directory, multi-web-mode
I was expecting that emacs would search in some of my directories and automatically discover it.
When I add
(load-file "~/.emacs.d/lisp/multi-web-mode.el")
or
(add-to-list 'load-path "~/.emacs.d/lisp/")
to the .emacs
file the emacs lisp file is loaded alright.
Is there really no user directory where the .el files are automatically loaded from? Would I always need to do (add-to-list 'load-path "~/.emacs.d/lisp/")
everytime I setup emacs?
load-path
. If you expect to load libraries from that dir then you need to tell that to Emacs, one way or another. Just do that in your init file. Or put the library in some dir that is already in yourload-path
. Directly or indirectly, you are the one who puts that library in that dir. Directly or indirectly, you are the one who needs to tell Emacs about that.load-path
. I was just expecting that it would seek in some user directory. I don't do much lisp programming and tend to forget syntax and names.