+2011-05-10 Glenn Morris <rgm@gnu.org>
+
+ * custom.texi (Specifying File Variables):
+ Deprecate using mode: for minor modes.
+
2011-05-07 Glenn Morris <rgm@gnu.org>
* cal-xtra.texi (Sexp Diary Entries): Mention diary-hebrew-birthday.
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
+@var{value}s are used literally, and not evaluated.
@findex add-file-local-variable-prop-line
@findex delete-file-local-variable-prop-line
@itemize
@item
-@code{mode} enables the specified major or minor mode.
+@code{mode} enables the specified major mode.
@item
@code{eval} evaluates the specified Lisp expression (the value
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
** 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'.
+2011-05-10 Glenn Morris <rgm@gnu.org>
+ Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * files.el (hack-one-local-variable-eval-safep):
+ Consider "eval: (foo-mode)" to be safe. (Bug#8613)
+
2011-05-10 Glenn Morris <rgm@gnu.org>
* calendar/diary-lib.el (diary-list-entries-hook)
(provide 'doc-view)
;; Local Variables:
-;; mode: outline-minor
+;; eval: (outline-minor-mode)
;; End:
;;; doc-view.el ends here
;; 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.
\f
;;; Local Variables:
-;;; mode: outline-minor
+;;; eval: (outline-minor-mode)
;;; outline-regexp: ";;;;+"
;;; End: