«»

Technicality

· 15TH OF SEPTEMBER, THE YEAR 2004

EMACS CUSTOM MODES AND LOAD-PATH

Man, the GNU Emacs documentation really sucks. Or maybe I suck at reading it. Either way I had to get Rich to tell me how to load custom Emacs modes, and to see what my current load-path was, and then add to it. Now my .emacs file looks like this:


(global-font-lock-mode 1)
(autoload 'mapserver-mode "mapserver-mode" "Mode for editing UMN MapServer files." t)
(add-to-list 'auto-mode-alist '("\.map'" . mapserver-mode))
(autoload 'php-mode "php-mode" "Mode for editing PHP files." t)
(add-to-list 'auto-mode-alist '("\.php'" . php-mode))
(setq load-path (cons (expand-file-name "~/.emacs.d/") load-path))

To check what your current load path is by typeing

C-h v load-path

Now emacs actually has syntax hilighting when I’m running it under X. Yay.

ONE COMMENT

era said on December 29th, 2008 at 7:52 am,

If you are using add-to-list you might as well use that for load-path too.

(add-to-list ‘load-path (expand-file-name “~/emacs.d/”)