1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Handle correctly an (undocumented) bare mode in hack-local-variables.

lisp/files.el (hack-local-variables-prop-line): When a file's first line
contains only a mode specification without the string "mode:", return the mode
symbol only when `handle-mode' is t.
This commit is contained in:
Alan Mackenzie 2016-11-24 20:34:42 +00:00
parent dfc5b0f655
commit b0e79741aa

View file

@ -3250,7 +3250,7 @@ return as the symbol specifying the mode."
nil)
((looking-at "[ \t]*\\([^ \t\n\r:;]+\\)\\([ \t]*-\\*-\\)")
;; Simple form: "-*- MODENAME -*-".
(if (memq handle-mode '(nil t))
(if (eq handle-mode t)
(intern (concat (match-string 1) "-mode"))))
(t
;; Hairy form: '-*-' [ <variable> ':' <value> ';' ]* '-*-'