diff options
| author | Glenn Morris | 2013-02-10 17:50:45 -0800 |
|---|---|---|
| committer | Glenn Morris | 2013-02-10 17:50:45 -0800 |
| commit | 97a1cd9d27e7d95263b475d03ce39c20a2ff4512 (patch) | |
| tree | 6ccbcec387797f9e1407c19169d7d4747a741784 | |
| parent | c57b2d76277b678431d2926a542003e1275927a9 (diff) | |
| download | emacs-97a1cd9d27e7d95263b475d03ce39c20a2ff4512.tar.gz emacs-97a1cd9d27e7d95263b475d03ce39c20a2ff4512.zip | |
Add `enable-dir-local-variables'
* lisp/files.el (enable-dir-local-variables): New variable.
(hack-dir-local-variables): Respect enable-dir-local-variables.
* lisp/tutorial.el (help-with-tutorial): Ignore directory-local variables.
Fixes: debbugs:11127
| -rw-r--r-- | etc/NEWS | 8 | ||||
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/files.el | 11 | ||||
| -rw-r--r-- | lisp/tutorial.el | 10 |
4 files changed, 25 insertions, 9 deletions
| @@ -45,6 +45,10 @@ non-nil, they output the same results. | |||
| 45 | ** `eval-defun' on an already defined defcustom calls the :set function, | 45 | ** `eval-defun' on an already defined defcustom calls the :set function, |
| 46 | if there is one. | 46 | if there is one. |
| 47 | 47 | ||
| 48 | ** If the new variable `enable-dir-local-variables' is nil, | ||
| 49 | directory local variables are ignored. May be useful for some modes | ||
| 50 | that want to ignore directory-locals while still respecting file-locals. | ||
| 51 | |||
| 48 | ** The option `set-mark-default-inactive' has been deleted. | 52 | ** The option `set-mark-default-inactive' has been deleted. |
| 49 | This unfinished feature was introduced by accident in Emacs 23.1; | 53 | This unfinished feature was introduced by accident in Emacs 23.1; |
| 50 | simply disabling Transient Mark mode does the same thing. | 54 | simply disabling Transient Mark mode does the same thing. |
| @@ -228,7 +232,7 @@ alist of extended attributes as returned by the new function | |||
| 228 | file using `set-file-extended-attributes'. | 232 | file using `set-file-extended-attributes'. |
| 229 | 233 | ||
| 230 | 234 | ||
| 231 | * Lisp changes in Emacs 24.4 | 235 | * Lisp Changes in Emacs 24.4 |
| 232 | 236 | ||
| 233 | ** Support for filesystem notifications. | 237 | ** Support for filesystem notifications. |
| 234 | Emacs now supports notifications of filesystem changes, such as | 238 | Emacs now supports notifications of filesystem changes, such as |
| @@ -273,7 +277,7 @@ used in place of the 9th element of `file-attributes'. | |||
| 273 | and ACL entries. | 277 | and ACL entries. |
| 274 | 278 | ||
| 275 | 279 | ||
| 276 | * Changes in Emacs 24.4 on non-free operating systems | 280 | * Changes in Emacs 24.4 on Non-Free Operating Systems |
| 277 | 281 | ||
| 278 | +++ | 282 | +++ |
| 279 | ** The "generate a backtrace on fatal error" feature now works on MS Windows. | 283 | ** The "generate a backtrace on fatal error" feature now works on MS Windows. |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5b80c1dbdbe..979c0808b7b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2013-02-11 Glenn Morris <rgm@gnu.org> | 1 | 2013-02-11 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * files.el (enable-dir-local-variables): New variable. | ||
| 4 | (hack-dir-local-variables): Respect enable-dir-local-variables. | ||
| 5 | * tutorial.el (help-with-tutorial): | ||
| 6 | Ignore directory-local variables. (Bug#11127) | ||
| 7 | |||
| 3 | * vc/vc-svn.el (vc-svn-command): Move --non-interactive from here... | 8 | * vc/vc-svn.el (vc-svn-command): Move --non-interactive from here... |
| 4 | (vc-svn-global-switches): ... to here. (Bug#13513) | 9 | (vc-svn-global-switches): ... to here. (Bug#13513) |
| 5 | 10 | ||
diff --git a/lisp/files.el b/lisp/files.el index c9e5d2763fe..890834d4af0 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -507,6 +507,11 @@ and ignores this variable." | |||
| 507 | (other :tag "Query" other)) | 507 | (other :tag "Query" other)) |
| 508 | :group 'find-file) | 508 | :group 'find-file) |
| 509 | 509 | ||
| 510 | (defvar enable-dir-local-variables t | ||
| 511 | "Non-nil means enable use of directory-local variables. | ||
| 512 | Some modes may wish to set this to nil to prevent directory-local | ||
| 513 | settings being applied, but still respect file-local ones.") | ||
| 514 | |||
| 510 | ;; This is an odd variable IMO. | 515 | ;; This is an odd variable IMO. |
| 511 | ;; You might wonder why it is needed, when we could just do: | 516 | ;; You might wonder why it is needed, when we could just do: |
| 512 | ;; (set (make-local-variable 'enable-local-variables) nil) | 517 | ;; (set (make-local-variable 'enable-local-variables) nil) |
| @@ -3659,8 +3664,12 @@ is found. Returns the new class name." | |||
| 3659 | (defun hack-dir-local-variables () | 3664 | (defun hack-dir-local-variables () |
| 3660 | "Read per-directory local variables for the current buffer. | 3665 | "Read per-directory local variables for the current buffer. |
| 3661 | Store the directory-local variables in `dir-local-variables-alist' | 3666 | Store the directory-local variables in `dir-local-variables-alist' |
| 3662 | and `file-local-variables-alist', without applying them." | 3667 | and `file-local-variables-alist', without applying them. |
| 3668 | |||
| 3669 | This does nothing if either `enable-local-variables' or | ||
| 3670 | `enable-dir-local-variables' are nil." | ||
| 3663 | (when (and enable-local-variables | 3671 | (when (and enable-local-variables |
| 3672 | enable-dir-local-variables | ||
| 3664 | (or enable-remote-dir-locals | 3673 | (or enable-remote-dir-locals |
| 3665 | (not (file-remote-p (or (buffer-file-name) | 3674 | (not (file-remote-p (or (buffer-file-name) |
| 3666 | default-directory))))) | 3675 | default-directory))))) |
diff --git a/lisp/tutorial.el b/lisp/tutorial.el index 011461119fc..39eb9e8b9aa 100644 --- a/lisp/tutorial.el +++ b/lisp/tutorial.el | |||
| @@ -829,10 +829,9 @@ Run the Viper tutorial? ")) | |||
| 829 | (progn | 829 | (progn |
| 830 | (insert-file-contents (tutorial--saved-file)) | 830 | (insert-file-contents (tutorial--saved-file)) |
| 831 | (let ((enable-local-variables :safe) | 831 | (let ((enable-local-variables :safe) |
| 832 | (enable-local-eval nil)) | 832 | (enable-local-eval nil) |
| 833 | (enable-dir-local-variables nil)) ; bug#11127 | ||
| 833 | (hack-local-variables)) | 834 | (hack-local-variables)) |
| 834 | ;; FIXME? What we actually want is to ignore dir-locals (?). | ||
| 835 | (setq buffer-read-only nil) ; bug#11118 | ||
| 836 | (goto-char (point-min)) | 835 | (goto-char (point-min)) |
| 837 | (setq old-tut-point | 836 | (setq old-tut-point |
| 838 | (string-to-number | 837 | (string-to-number |
| @@ -849,10 +848,9 @@ Run the Viper tutorial? ")) | |||
| 849 | (setq tutorial--point-before-chkeys (point-marker))) | 848 | (setq tutorial--point-before-chkeys (point-marker))) |
| 850 | (insert-file-contents (expand-file-name filename tutorial-directory)) | 849 | (insert-file-contents (expand-file-name filename tutorial-directory)) |
| 851 | (let ((enable-local-variables :safe) | 850 | (let ((enable-local-variables :safe) |
| 852 | (enable-local-eval nil)) | 851 | (enable-local-eval nil) |
| 852 | (enable-dir-local-variables nil)) ; bug#11127 | ||
| 853 | (hack-local-variables)) | 853 | (hack-local-variables)) |
| 854 | ;; FIXME? What we actually want is to ignore dir-locals (?). | ||
| 855 | (setq buffer-read-only nil) ; bug#11118 | ||
| 856 | (forward-line) | 854 | (forward-line) |
| 857 | (setq tutorial--point-before-chkeys (point-marker))) | 855 | (setq tutorial--point-before-chkeys (point-marker))) |
| 858 | 856 | ||