How do I get Emacs to recognize new file extensions? For example if I have a .c
file and I open it in Emacs, I get the correct syntax highlighting for C, but if I have a .bob
file format (which I know to be C), how do I tell Emacs to interpret it in the same way as a .c
file?
Emacs’ file extension recognition
emacsfilenamesopen files
Best Answer
This is described on Emacs Beginner's Howto.
With the line
You tell emacs to enter "text-mode" if you open a file which is named README.
with
you tell emacs to type "html-helper-mode" if the file is named *.html or *.htm
on stackoverflow there is an example, that highligts *.emacs files as lisp.code: