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 /lisp | |
| 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
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/files.el | 11 | ||||
| -rw-r--r-- | lisp/tutorial.el | 10 |
3 files changed, 19 insertions, 7 deletions
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 | ||