]> code.delx.au - gnu-emacs/commitdiff
(set-auto-mode): Don't get confused by anything ending in "mode:" which isn't
authorKarl Heuer <kwzh@gnu.org>
Fri, 9 Dec 1994 06:14:44 +0000 (06:14 +0000)
committerKarl Heuer <kwzh@gnu.org>
Fri, 9 Dec 1994 06:14:44 +0000 (06:14 +0000)
a mode spec.

lisp/files.el

index e226461bd8338d8cf471cc54c645474b4ee53a76..42eea31d1700e354e4f4f1892ab6062ccc7f6c28 100644 (file)
@@ -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)