I have just installed the cmake-mode package in Emacs 24 using:
M-x package-install cmake-mode
I can see the package at: ~/.emacs.d/elpa/cmake-mode-20110824, and I can load it using the instruction at Commentary: section of ~/.emacs.d/elpa/cmake-mode-20110824/cmake-mode.el:
;; Add this code to your .emacs file to use the mode:
;;
;; (setq load-path (cons (expand-file-name "/dir/with/cmake-mode") load-path))
;; (require 'cmake-mode)
;; (setq auto-mode-alist
;; (append '(("CMakeLists\\.txt\\'" . cmake-mode)
;; ("\\.cmake\\'" . cmake-mode))
;; auto-mode-alist))
However this contradicts the usage instruction on ELPA's EmacsWiki page:
... packages are initialized AFTER the init.el is loaded. This means you should NOT put package specific initialization into your init.el ...
I tend to agree with this instruction because adding to my ~/.gnu-emacs file a line such as:
(add-to-list 'load-path "~/.emacs.d/elpa/cmake-mode-20110824/")
is ugly, and will break if and when I will upgrade the package. However without this line I am unable to use cmake-mode.
Am I missing something here?
Notes:
- I did nothing strange with
package-enable-at-startupand its' value ist. - I am using prelude.
user-emacs-directoryvalue is"~/.emacs.d/"(Thanks @lawlist for the suggestion)package-user-dirvalue is"~/.emacs.d/elpa"