Skip to main content
ertius.org

emacs mode setting via comments

[Yet] another thing I always forget - how to force emacs to use a particular mode via comments. It's easy:

top:

# -*- mode: sh -*-

bottom:

# Local Variables:
# mode: sh
# End:

I've now encoded these in templ templates:

(m1 "# -*- mode: " (p "mode") " -*-" n> p>)
(m2 "# Local Variables:" n> "# mode: " (p "mode") n> "# End:" n> p>)

m is for mode.