aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorGlenn Morris2011-05-09 19:31:42 -0700
committerGlenn Morris2011-05-09 19:31:42 -0700
commitb8f82dc15fc7370329930323082d9faf2a5fc7ad (patch)
tree6d8c9e61daee68c5d443165b2d18ec7af864df84 /lisp
parent4f99f44b34c11935e00eb7acd3d464abd903ab53 (diff)
downloademacs-b8f82dc15fc7370329930323082d9faf2a5fc7ad.tar.gz
emacs-b8f82dc15fc7370329930323082d9faf2a5fc7ad.zip
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:".
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/doc-view.el2
-rw-r--r--lisp/files.el34
-rw-r--r--lisp/net/soap-client.el2
4 files changed, 27 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index cbb03baa3bf..50c3022ba0a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,4 +1,10 @@
12011-05-10 Glenn Morris <rgm@gnu.org> 12011-05-10 Glenn Morris <rgm@gnu.org>
2 Stefan Monnier <monnier@iro.umontreal.ca>
3
4 * files.el (hack-one-local-variable-eval-safep):
5 Consider "eval: (foo-mode)" to be safe. (Bug#8613)
6
72011-05-10 Glenn Morris <rgm@gnu.org>
2 8
3 * calendar/diary-lib.el (diary-list-entries-hook) 9 * calendar/diary-lib.el (diary-list-entries-hook)
4 (diary-mark-entries-hook, diary-nongregorian-listing-hook) 10 (diary-mark-entries-hook, diary-nongregorian-listing-hook)
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index ab0d6bf837b..7bd1a55011e 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -1549,7 +1549,7 @@ See the command `doc-view-mode' for more information on this mode."
1549(provide 'doc-view) 1549(provide 'doc-view)
1550 1550
1551;; Local Variables: 1551;; Local Variables:
1552;; mode: outline-minor 1552;; eval: (outline-minor-mode)
1553;; End: 1553;; End:
1554 1554
1555;;; doc-view.el ends here 1555;;; doc-view.el ends here
diff --git a/lisp/files.el b/lisp/files.el
index 72cfc89ef8c..336a0a436f9 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3327,21 +3327,25 @@ It is dangerous if either of these conditions are met:
3327 ;; Certain functions can be allowed with safe arguments 3327 ;; Certain functions can be allowed with safe arguments
3328 ;; or can specify verification functions to try. 3328 ;; or can specify verification functions to try.
3329 (and (symbolp (car exp)) 3329 (and (symbolp (car exp))
3330 (let ((prop (get (car exp) 'safe-local-eval-function))) 3330 ;; Allow (minor)-modes calls with no arguments.
3331 (cond ((eq prop t) 3331 ;; This obsoletes the use of "mode:" for such things. (Bug#8613)
3332 (let ((ok t)) 3332 (or (and (null (cdr exp))
3333 (dolist (arg (cdr exp)) 3333 (string-match "-mode\\'" (symbol-name (car exp))))
3334 (unless (hack-one-local-variable-constantp arg) 3334 (let ((prop (get (car exp) 'safe-local-eval-function)))
3335 (setq ok nil))) 3335 (cond ((eq prop t)
3336 ok)) 3336 (let ((ok t))
3337 ((functionp prop) 3337 (dolist (arg (cdr exp))
3338 (funcall prop exp)) 3338 (unless (hack-one-local-variable-constantp arg)
3339 ((listp prop) 3339 (setq ok nil)))
3340 (let ((ok nil)) 3340 ok))
3341 (dolist (function prop) 3341 ((functionp prop)
3342 (if (funcall function exp) 3342 (funcall prop exp))
3343 (setq ok t))) 3343 ((listp prop)
3344 ok))))))) 3344 (let ((ok nil))
3345 (dolist (function prop)
3346 (if (funcall function exp)
3347 (setq ok t)))
3348 ok))))))))
3345 3349
3346(defun hack-one-local-variable (var val) 3350(defun hack-one-local-variable (var val)
3347 "Set local variable VAR with value VAL. 3351 "Set local variable VAR with value VAL.
diff --git a/lisp/net/soap-client.el b/lisp/net/soap-client.el
index b5453733d1d..9862332bf3f 100644
--- a/lisp/net/soap-client.el
+++ b/lisp/net/soap-client.el
@@ -1745,7 +1745,7 @@ operations in a WSDL document."
1745 1745
1746 1746
1747;;; Local Variables: 1747;;; Local Variables:
1748;;; mode: outline-minor 1748;;; eval: (outline-minor-mode)
1749;;; outline-regexp: ";;;;+" 1749;;; outline-regexp: ";;;;+"
1750;;; End: 1750;;; End:
1751 1751