emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r104313: Further tweak previous files


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r104313: Further tweak previous files.el change.
Date: Sat, 21 May 2011 18:18:49 -0700
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 104313
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Sat 2011-05-21 18:18:49 -0700
message:
  Further tweak previous files.el change.
  
  * lisp/files.el (hack-local-variables): In the MODE-ONLY case, try to
  ignore minor modes.
modified:
  lisp/files.el
=== modified file 'lisp/files.el'
--- a/lisp/files.el     2011-05-22 00:34:41 +0000
+++ b/lisp/files.el     2011-05-22 01:18:49 +0000
@@ -3147,7 +3147,9 @@
 (defun hack-local-variables (&optional mode-only)
   "Parse and put into effect this buffer's local variables spec.
 If MODE-ONLY is non-nil, all we do is check whether a \"mode:\"
-is specified, and return the corresponding mode symbol, or nil."
+is specified, and return the corresponding mode symbol, or nil.
+In this case, we try to ignore minor-modes, and only return a
+major-mode."
   (let ((enable-local-variables
         (and local-enable-local-variables enable-local-variables))
        result)
@@ -3226,17 +3228,20 @@
                    (let* ((str (buffer-substring beg (point)))
                           (var (let ((read-circle nil))
                                  (read str)))
-                          val)
+                          val val2)
                      ;; Read the variable value.
                      (skip-chars-forward "^:")
                      (forward-char 1)
                      (let ((read-circle nil))
                        (setq val (read (current-buffer))))
                      (if mode-only
-                         (if (eq var 'mode)
-                             (setq result
-                                   (intern (concat (symbol-name val)
-                                                   "-mode"))))
+                         (and (eq var 'mode)
+                              ;; Specifying minor-modes via mode: is
+                              ;; deprecated, but try to reject them anyway.
+                              (not (string-match
+                                    "-minor\\'"
+                                    (setq val2 (symbol-name val))))
+                              (setq result (intern (concat val2 "-mode"))))
                        (unless (eq var 'coding)
                          (condition-case nil
                              (push (cons (if (eq var 'eval)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]