From: Karl Heuer Date: Fri, 9 Dec 1994 06:14:44 +0000 (+0000) Subject: (set-auto-mode): Don't get confused by anything ending in "mode:" which isn't X-Git-Tag: emacs-19.34~5723 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6054fcc6452dd2ecf707ed9e616ea8c568f6bb52;p=emacs.git (set-auto-mode): Don't get confused by anything ending in "mode:" which isn't a mode spec. --- diff --git a/lisp/files.el b/lisp/files.el index e226461bd83..42eea31d170 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -966,7 +966,9 @@ If `enable-local-variables' is nil, this function does not check for a ;; Find all specifications for the `mode:' variable ;; and execute them left to right. (while (let ((case-fold-search t)) - (search-forward "mode:" end t)) + (or (and (looking-at "mode:") + (goto-char (match-end 0))) + (re-search-forward "[ \t;]mode:" end t))) (skip-chars-forward " \t") (setq beg (point)) (if (search-forward ";" end t)