Commit fb69dfa5 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(set-auto-mode): If -*- spec doesn't set `mode:',

look for other ways of specifying major mode.
parent e363091e
......@@ -991,10 +991,11 @@ If `enable-local-variables' is nil, this function does not check for a
(forward-char -1)
(goto-char end))
(skip-chars-backward " \t")
(funcall (intern (concat (downcase (buffer-substring beg (point))) "-mode"))))
(funcall (intern (concat (downcase (buffer-substring beg (point))) "-mode")))
(setq done t))
;; Simple -*-MODE-*- case.
(funcall (intern (concat (downcase (buffer-substring beg end)) "-mode"))))
(setq done t)))
(funcall (intern (concat (downcase (buffer-substring beg end)) "-mode")))
(setq done t))))
;; If we didn't find a mode from a -*- line, try using the file name.
(if (and (not done) buffer-file-name)
(let ((name buffer-file-name)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment