Tuesday, January 31, 2006

XEmacs tip: Customise the mode based on file extensions

While most of the default modes based file extensions are sensible, it is good to know how to override the defaults.

The following code added to the file init.el will change the mode loading such that files with the extensions .l (the default is lisp-mode) and .vvp (an extension is not known by XEmacs) are loaded with the c++-mode.

(setq auto-mode-alist
'(("\\.l$" . c++-mode)
("\\.vvp$" . c++-mode))

No comments:

Post a Comment