diff options
author | Karoly Lorentey <lorentey@elte.hu> | 2006-04-12 17:40:36 +0000 |
---|---|---|
committer | Karoly Lorentey <lorentey@elte.hu> | 2006-04-12 17:40:36 +0000 |
commit | 4c57cca724993ab1334cc5c0b35c22b06daee0c3 (patch) | |
tree | 009f6142b6abc0d6f3221b2098863b22ca678e73 /lisp/files.el | |
parent | 21c5f634f04084467ca59d9232a83456e16a5c50 (diff) | |
parent | 163cb72dcb641bd2e68d3b6887cfef71bb1464ae (diff) | |
download | emacs-4c57cca724993ab1334cc5c0b35c22b06daee0c3.tar.gz emacs-4c57cca724993ab1334cc5c0b35c22b06daee0c3.tar.bz2 emacs-4c57cca724993ab1334cc5c0b35c22b06daee0c3.zip |
Merged from emacs@sv.gnu.org
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-207
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-208
Sync from erc--emacs--0
* emacs@sv.gnu.org/emacs--devo--0--patch-209
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-210
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-211
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-212
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-213
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-214
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-215
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-81
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-82
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-83
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-549
Diffstat (limited to 'lisp/files.el')
-rw-r--r-- | lisp/files.el | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/lisp/files.el b/lisp/files.el index b21b29957b5..440f2ea4f27 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -444,14 +444,19 @@ use `before-save-hook'.") (defcustom enable-local-variables t "*Control use of local variables in files you visit. -The value can be t, nil or something else. +The value can be t, nil, :safe, or something else. A value of t means file local variables specifications are obeyed if all the specified variable values are safe; if any values are not safe, Emacs queries you, once, whether to set them all. +\(When you say yes to certain values, they are remembered as safe.) + +:safe means set the safe variables, and ignore the rest. +nil means always ignore the file local variables. -A value of nil means always ignore the file local variables. Any other value means always query you once whether to set them all. +\(When you say yes to certain values, they are remembered as safe, but +this has no effect when `enable-local-variables' is \"something else\".) This variable also controls use of major modes specified in a -*- line. @@ -460,6 +465,7 @@ The command \\[normal-mode], when used interactively, always obeys file local variable specifications and the -*- line, and ignores this variable." :type '(choice (const :tag "Obey" t) + (const :tag "Safe Only" :safe) (const :tag "Ignore" nil) (other :tag "Query" other)) :group 'find-file) @@ -1779,8 +1785,7 @@ Uses the visited file name, the -*- line, and the local variables spec. This function is called automatically from `find-file'. In that case, we may set up the file-specified mode and local variables, -depending on the value of `enable-local-variables': if it is t, we do; -if it is nil, we don't; otherwise, we query. +depending on the value of `enable-local-variables'. In addition, if `local-enable-local-variables' is nil, we do not set local variables (though we do notice a mode specified with -*-.) @@ -2414,8 +2419,7 @@ n -- to ignore the local variables list.") "" ", or C-v to scroll"))) (goto-char (point-min)) - (let ((inhibit-quit t) - (cursor-in-echo-area t) + (let ((cursor-in-echo-area t) (exit-chars (if offer-save '(?! ?y ?n ?\s ?\C-g) '(?y ?n ?\s ?\C-g))) done) @@ -2427,9 +2431,7 @@ n -- to ignore the local variables list.") (condition-case nil (scroll-up) (error (goto-char (point-min)))) - (setq done (memq (downcase char) exit-chars))))) - (if (= char ?\C-g) - (setq quit-flag nil))) + (setq done (memq (downcase char) exit-chars)))))) (setq char (downcase char)) (when (and offer-save (= char ?!) unsafe-vars) (dolist (elt unsafe-vars) @@ -2617,13 +2619,22 @@ is specified, returning t if it is specified." (and (risky-local-variable-p var val) (push elt risky-vars)) (push elt unsafe-vars)))) - (if (or (and (eq enable-local-variables t) - (null unsafe-vars) - (null risky-vars)) - (hack-local-variables-confirm - result unsafe-vars risky-vars)) + (if (eq enable-local-variables :safe) + ;; If caller wants only the safe variables, + ;; install only them. (dolist (elt result) - (hack-one-local-variable (car elt) (cdr elt))))) + (unless (or (memq (car elt) unsafe-vars) + (memq (car elt) risky-vars)) + (hack-one-local-variable (car elt) (cdr elt)))) + ;; Query, except in the case where all are known safe + ;; if the user wants no quuery in that case. + (if (or (and (eq enable-local-variables t) + (null unsafe-vars) + (null risky-vars)) + (hack-local-variables-confirm + result unsafe-vars risky-vars)) + (dolist (elt result) + (hack-one-local-variable (car elt) (cdr elt)))))) (run-hooks 'hack-local-variables-hook)))))) (defun safe-local-variable-p (sym val) |