0

I use file named Makefile.include as a GNU makefile. I am trying to get emacs use the makefile-mode to use for this file. Alt-X makefile-mode works. Is there a way to tell emacs to use this major mode for this file right after opening automatically?

I tried putting

# _*_ mode: makefile; _*_

in the file but that does not appear to have the right effect. Btw I could not find the list of allowed strings one can use after mode:, so I tried BDSmakefile and some other variations as well.

Thanks.

Matyas
  • 644
  • 6
  • 15
  • possible duplicate of [Setting auto-mode-alist in emacs](http://stackoverflow.com/questions/3494402/setting-auto-mode-alist-in-emacs) – Trey Jackson Feb 24 '14 at 23:16
  • 5
    `-`(dash) should be used instead of `_` underscore. so you should write like `# -*- mode: makefile -*-`. – syohex Feb 25 '14 at 01:00
  • possible duplicate of [Emacs change file extension - mode association](http://stackoverflow.com/questions/14941995/emacs-change-file-extension-mode-association) – Gordon Gustafson Apr 28 '14 at 21:22

1 Answers1

2

See this question: Setting auto-mode-alist in emacs, and use the pair ("Makefile\\.include\\'" . makefile-mode).

Community
  • 1
  • 1
Trey Jackson
  • 73,529
  • 11
  • 197
  • 229
  • I was interested in putting this in the file itself and not in the emacs config. syohex is right I had a typo... – Matyas Feb 25 '14 at 04:13