Occassionally it can be useful to have emacs automatically use a particular syntax highlighter based on file extension. Typically this is useful when you want to use non-stnadard file extensions in your own environment. You can get it to work by adding the following to your .emacs file (typically located in your home directory):
;; Use perl syntax highlighter for .foo files. (setq auto-mode-alist (cons '(".*\.foo" . cperl-mode) auto-mode-alist))
The above code would use the cperl highlighter for all files ending in .foo.





