From: Glenn Morris Date: Thu, 9 Jun 2011 20:22:06 +0000 (-0400) Subject: Allow/recommend explicit args for minor-modes in file local eval:s. X-Git-Tag: emacs-pretest-24.0.90~104^2~600 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f0da764a5c9bd61df5892ea9a377ab677dd5b612;p=emacs.git Allow/recommend explicit args for minor-modes in file local eval:s. * lisp/files.el (hack-one-local-variable-eval-safep): Allow minor-modes with explicit +/-1 arguments. * doc/emacs/custom.texi (Specifying File Variables): Recommend explicit arguments for minor modes. * etc/NEWS: Likewise. * lisp/doc-view.el, lisp/net/soap-client.el: Update file locals. --- diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 6e69a96a2a8..8853eb099d6 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,8 @@ +2011-06-09 Glenn Morris + + * custom.texi (Specifying File Variables): + Recommend explicit arguments for minor modes. + 2011-06-02 Paul Eggert Document wide integers better. diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index a0dce5b3216..434c574ac42 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -1215,7 +1215,7 @@ other context has no special meaning. 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. Using @code{mode} for minor modes -is deprecated, though---instead, use @code{eval: (minor-mode)}. +is deprecated, though---instead, use @code{eval: (minor-mode 1)}. Often, however, it is a mistake to enable minor modes in file local variables. Most minor modes, like Auto Fill mode, represent individual user diff --git a/etc/NEWS b/etc/NEWS index eaa6ee1b704..51b179d8ddc 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -294,7 +294,7 @@ 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)". +to enable a minor-mode is deprecated. Instead, use "eval: (minor-mode 1)". ** 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'. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d6e247eeb43..af36f8c9b98 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-06-09 Glenn Morris + + * files.el (hack-one-local-variable-eval-safep): + Allow minor-modes with explicit +/-1 arguments. + 2011-06-09 Teodor Zlatanov * term/xterm.el (xterm): Add defgroup. diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 06c3b70a3a6..666c6a8b034 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -1550,7 +1550,7 @@ See the command `doc-view-mode' for more information on this mode." (provide 'doc-view) ;; Local Variables: -;; eval: (outline-minor-mode) +;; eval: (outline-minor-mode 1) ;; End: ;;; doc-view.el ends here diff --git a/lisp/files.el b/lisp/files.el index 5b950e0d409..317153dc9bf 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2635,7 +2635,7 @@ we don't actually set it to the same mode the buffer already has." ;; Look for -*-MODENAME-*- or -*- ... mode: MODENAME; ... -*- (let (end done mode modes) ;; Once we drop the deprecated feature where mode: is also allowed to - ;; specify minor-modes (ie, there can be more than one "mode:), we can + ;; specify minor-modes (ie, there can be more than one "mode:"), we can ;; remove this section and just let (hack-local-variables t) handle it. ;; Find a -*- mode tag. (save-excursion @@ -3367,7 +3367,7 @@ It is dangerous if either of these conditions are met: (and (symbolp (car exp)) ;; Allow (minor)-modes calls with no arguments. ;; This obsoletes the use of "mode:" for such things. (Bug#8613) - (or (and (null (cdr exp)) + (or (and (member (cdr exp) '(nil (1) (-1))) (string-match "-mode\\'" (symbol-name (car exp)))) (let ((prop (get (car exp) 'safe-local-eval-function))) (cond ((eq prop t) diff --git a/lisp/net/soap-client.el b/lisp/net/soap-client.el index 9862332bf3f..b7b0b61f4e1 100644 --- a/lisp/net/soap-client.el +++ b/lisp/net/soap-client.el @@ -1745,7 +1745,7 @@ operations in a WSDL document." ;;; Local Variables: -;;; eval: (outline-minor-mode) +;;; eval: (outline-minor-mode 1) ;;; outline-regexp: ";;;;+" ;;; End: