Yes. I assume these are lisp files, so you need Emacs to automatically be in lisp-mode when viewing these files. There's two solutions:
The simplest thing is to change the extension to .el
. By default, those are opened in lisp-mode.
If, for some reason you really want to use the .emacs
extension, you'll want to add this somewhere in your ~/.emacs
file:
(setq auto-mode-alist (append
'((".*\\.emacs\\'" . lisp-mode))
auto-mode-alist)
)
auto-mode-alist
is the list Emacs uses to determine the major mode to use. Each item is a list, the first is the Emacs regular expression Emacs uses to test the filename against, and if true, it uses the mode given in the third item.
(I don't know what the second item is, I've never used it.)
I strongly suggest option 1 though.