How to set syntax highlighting for Emacs files

My .emacs are like a roadmap for me, where I send a lot of files. Their extension is .emacs: for example,

 fileName.emacs

The problem is that only ~ / .emacs has syntax highlighting.

I would like to have syntax highlighting for all source files that end in .emacs.

How can you highlight syntax highlighting for all .emacs -files sources?

+3
source share
2 answers

Yes. I assume these are lisp files, so you need Emacs to be automatically included in the lisp-mode when viewing these files. There are two solutions:

  • - .el. lisp -mode.

  • - .emacs, ~/.emacs:

    (setq auto-mode-alist 
          (append '((".*\\.emacs\\'" . lisp-mode))
                  auto-mode-alist))
    

auto-mode-alist - , Emacs . , Emacs, Emacs , true, , .

( , , .)

1, .

+12

:

;-*-Lisp-*-

Lisp, Emacs Lisp ().

+7

Source: https://habr.com/ru/post/1711382/


All Articles