emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r104180: Deprecate using "mode:" to e


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r104180: Deprecate using "mode:" to enable minor modes (bug#8613)
Date: Mon, 09 May 2011 19:31:42 -0700
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 104180
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Mon 2011-05-09 19:31:42 -0700
message:
  Deprecate using "mode:" to enable minor modes (bug#8613)
  
  * lisp/files.el (hack-one-local-variable-eval-safep):
  Consider "eval: (foo-mode)" to be safe.
  
  * doc/emacs/custom.texi (Specifying File Variables):
  Deprecate using mode: for minor modes.
  
  * etc/NEWS: Mention this.
  
  * lisp/doc-view.el, lisp/net/soap-client.el:
  Change "mode:" minor-mode file local variables to use "eval:".
modified:
  doc/emacs/ChangeLog
  doc/emacs/custom.texi
  etc/NEWS
  lisp/ChangeLog
  lisp/doc-view.el
  lisp/files.el
  lisp/net/soap-client.el
=== modified file 'doc/emacs/ChangeLog'
--- a/doc/emacs/ChangeLog       2011-05-07 01:22:01 +0000
+++ b/doc/emacs/ChangeLog       2011-05-10 02:31:42 +0000
@@ -1,3 +1,8 @@
+2011-05-10  Glenn Morris  <address@hidden>
+
+       * custom.texi (Specifying File Variables):
+       Deprecate using mode: for minor modes.
+
 2011-05-07  Glenn Morris  <address@hidden>
 
        * cal-xtra.texi (Sexp Diary Entries): Mention diary-hebrew-birthday.

=== modified file 'doc/emacs/custom.texi'
--- a/doc/emacs/custom.texi     2011-03-09 15:59:23 +0000
+++ b/doc/emacs/custom.texi     2011-05-10 02:31:42 +0000
@@ -1085,9 +1085,8 @@
 You can specify any number of variable/value pairs in this way, each
 pair with a colon and semicolon as shown above.  The special
 variable/value pair @code{mode: @var{modename};}, if present,
-specifies a major or minor mode; if you use this to specify a major
-mode, it should come first in the line.  The @var{value}s are used
-literally, and not evaluated.
+specifies a major mode, and should come first in the line.  The
address@hidden are used literally, and not evaluated.
 
 @findex add-file-local-variable-prop-line
 @findex delete-file-local-variable-prop-line
@@ -1186,7 +1185,7 @@
 
 @itemize
 @item
address@hidden enables the specified major or minor mode.
address@hidden enables the specified major mode.
 
 @item
 @code{eval} evaluates the specified Lisp expression (the value
@@ -1213,10 +1212,11 @@
   You can use the @code{mode} ``variable'' to enable minor modes as
 well as the major modes; in fact, you can use it more than once, first
 to set the major mode and then to enable minor modes which are
-specific to particular buffers.
+specific to particular buffers.  Using @code{mode} for minor modes
+is deprecated, though---instead, use @code{eval: (minor-mode)}. 
 
-  Often, however, it is a mistake to enable minor modes this way.
-Most minor modes, like Auto Fill mode, represent individual user
+  Often, however, it is a mistake to enable minor modes in file local
+variables.  Most minor modes, like Auto Fill mode, represent individual user
 preferences.  If you want to use a minor mode, it is better to set up
 major mode hooks with your init file to turn that minor mode on for
 yourself alone (@pxref{Init File}), instead of using a local variable

=== modified file 'etc/NEWS'
--- a/etc/NEWS  2011-05-08 05:17:17 +0000
+++ b/etc/NEWS  2011-05-10 02:31:42 +0000
@@ -267,6 +267,10 @@
 ** The user option `remote-file-name-inhibit-cache' controls whether
 the remote file-name cache is used for read access.
 
++++
+** The use of a "mode: minor" specification in a file local variables section
+to enable a minor-mode is deprecated.  Instead, use "eval: (minor-mode)".
+
 ** The standalone programs lib-src/digest-doc and sorted-doc have been
 replaced with Lisp commands `doc-file-to-man' and `doc-file-to-info'.
 

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-05-10 02:22:55 +0000
+++ b/lisp/ChangeLog    2011-05-10 02:31:42 +0000
@@ -1,4 +1,10 @@
 2011-05-10  Glenn Morris  <address@hidden>
+          Stefan Monnier  <address@hidden>
+
+       * files.el (hack-one-local-variable-eval-safep):
+       Consider "eval: (foo-mode)" to be safe.  (Bug#8613)
+
+2011-05-10  Glenn Morris  <address@hidden>
 
        * calendar/diary-lib.el (diary-list-entries-hook)
        (diary-mark-entries-hook, diary-nongregorian-listing-hook)

=== modified file 'lisp/doc-view.el'
--- a/lisp/doc-view.el  2011-04-08 20:09:19 +0000
+++ b/lisp/doc-view.el  2011-05-10 02:31:42 +0000
@@ -1549,7 +1549,7 @@
 (provide 'doc-view)
 
 ;; Local Variables:
-;; mode: outline-minor
+;; eval: (outline-minor-mode)
 ;; End:
 
 ;;; doc-view.el ends here

=== modified file 'lisp/files.el'
--- a/lisp/files.el     2011-04-24 00:24:30 +0000
+++ b/lisp/files.el     2011-05-10 02:31:42 +0000
@@ -3327,21 +3327,25 @@
       ;; Certain functions can be allowed with safe arguments
       ;; or can specify verification functions to try.
       (and (symbolp (car exp))
-          (let ((prop (get (car exp) 'safe-local-eval-function)))
-            (cond ((eq prop t)
-                   (let ((ok t))
-                     (dolist (arg (cdr exp))
-                       (unless (hack-one-local-variable-constantp arg)
-                         (setq ok nil)))
-                     ok))
-                  ((functionp prop)
-                   (funcall prop exp))
-                  ((listp prop)
-                   (let ((ok nil))
-                     (dolist (function prop)
-                       (if (funcall function exp)
-                           (setq ok t)))
-                     ok)))))))
+          ;; Allow (minor)-modes calls with no arguments.
+          ;; This obsoletes the use of "mode:" for such things.  (Bug#8613)
+          (or (and (null (cdr exp))
+                   (string-match "-mode\\'" (symbol-name (car exp))))
+              (let ((prop (get (car exp) 'safe-local-eval-function)))
+                (cond ((eq prop t)
+                       (let ((ok t))
+                         (dolist (arg (cdr exp))
+                           (unless (hack-one-local-variable-constantp arg)
+                             (setq ok nil)))
+                         ok))
+                      ((functionp prop)
+                       (funcall prop exp))
+                      ((listp prop)
+                       (let ((ok nil))
+                         (dolist (function prop)
+                           (if (funcall function exp)
+                               (setq ok t)))
+                         ok))))))))
 
 (defun hack-one-local-variable (var val)
   "Set local variable VAR with value VAL.

=== modified file 'lisp/net/soap-client.el'
--- a/lisp/net/soap-client.el   2011-03-05 10:32:10 +0000
+++ b/lisp/net/soap-client.el   2011-05-10 02:31:42 +0000
@@ -1745,7 +1745,7 @@
 
 
 ;;; Local Variables:
-;;; mode: outline-minor
+;;; eval: (outline-minor-mode)
 ;;; outline-regexp: ";;;;+"
 ;;; End:
 


reply via email to

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