[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r111730: Add `enable-dir-local-variab
From: |
Glenn Morris |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r111730: Add `enable-dir-local-variables' |
Date: |
Sun, 10 Feb 2013 17:50:45 -0800 |
User-agent: |
Bazaar (2.5.0) |
------------------------------------------------------------
revno: 111730
fixes bug: http://debbugs.gnu.org/11127
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Sun 2013-02-10 17:50:45 -0800
message:
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.
modified:
etc/NEWS
lisp/ChangeLog
lisp/files.el
lisp/tutorial.el
=== modified file 'etc/NEWS'
--- a/etc/NEWS 2013-02-11 01:44:39 +0000
+++ b/etc/NEWS 2013-02-11 01:50:45 +0000
@@ -45,6 +45,10 @@
** `eval-defun' on an already defined defcustom calls the :set function,
if there is one.
+** If the new variable `enable-dir-local-variables' is nil,
+directory local variables are ignored. May be useful for some modes
+that want to ignore directory-locals while still respecting file-locals.
+
** The option `set-mark-default-inactive' has been deleted.
This unfinished feature was introduced by accident in Emacs 23.1;
simply disabling Transient Mark mode does the same thing.
@@ -228,7 +232,7 @@
file using `set-file-extended-attributes'.
-* Lisp changes in Emacs 24.4
+* Lisp Changes in Emacs 24.4
** Support for filesystem notifications.
Emacs now supports notifications of filesystem changes, such as
@@ -273,7 +277,7 @@
and ACL entries.
-* Changes in Emacs 24.4 on non-free operating systems
+* Changes in Emacs 24.4 on Non-Free Operating Systems
+++
** The "generate a backtrace on fatal error" feature now works on MS Windows.
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2013-02-11 01:07:05 +0000
+++ b/lisp/ChangeLog 2013-02-11 01:50:45 +0000
@@ -1,5 +1,10 @@
2013-02-11 Glenn Morris <address@hidden>
+ * files.el (enable-dir-local-variables): New variable.
+ (hack-dir-local-variables): Respect enable-dir-local-variables.
+ * tutorial.el (help-with-tutorial):
+ Ignore directory-local variables. (Bug#11127)
+
* vc/vc-svn.el (vc-svn-command): Move --non-interactive from here...
(vc-svn-global-switches): ... to here. (Bug#13513)
=== modified file 'lisp/files.el'
--- a/lisp/files.el 2013-02-10 03:08:21 +0000
+++ b/lisp/files.el 2013-02-11 01:50:45 +0000
@@ -507,6 +507,11 @@
(other :tag "Query" other))
:group 'find-file)
+(defvar enable-dir-local-variables t
+ "Non-nil means enable use of directory-local variables.
+Some modes may wish to set this to nil to prevent directory-local
+settings being applied, but still respect file-local ones.")
+
;; This is an odd variable IMO.
;; You might wonder why it is needed, when we could just do:
;; (set (make-local-variable 'enable-local-variables) nil)
@@ -3659,8 +3664,12 @@
(defun hack-dir-local-variables ()
"Read per-directory local variables for the current buffer.
Store the directory-local variables in `dir-local-variables-alist'
-and `file-local-variables-alist', without applying them."
+and `file-local-variables-alist', without applying them.
+
+This does nothing if either `enable-local-variables' or
+`enable-dir-local-variables' are nil."
(when (and enable-local-variables
+ enable-dir-local-variables
(or enable-remote-dir-locals
(not (file-remote-p (or (buffer-file-name)
default-directory)))))
=== modified file 'lisp/tutorial.el'
--- a/lisp/tutorial.el 2013-01-01 09:11:05 +0000
+++ b/lisp/tutorial.el 2013-02-11 01:50:45 +0000
@@ -829,10 +829,9 @@
(progn
(insert-file-contents (tutorial--saved-file))
(let ((enable-local-variables :safe)
- (enable-local-eval nil))
+ (enable-local-eval nil)
+ (enable-dir-local-variables nil)) ; bug#11127
(hack-local-variables))
- ;; FIXME? What we actually want is to ignore dir-locals (?).
- (setq buffer-read-only nil) ; bug#11118
(goto-char (point-min))
(setq old-tut-point
(string-to-number
@@ -849,10 +848,9 @@
(setq tutorial--point-before-chkeys (point-marker)))
(insert-file-contents (expand-file-name filename tutorial-directory))
(let ((enable-local-variables :safe)
- (enable-local-eval nil))
+ (enable-local-eval nil)
+ (enable-dir-local-variables nil)) ; bug#11127
(hack-local-variables))
- ;; FIXME? What we actually want is to ignore dir-locals (?).
- (setq buffer-read-only nil) ; bug#11118
(forward-line)
(setq tutorial--point-before-chkeys (point-marker)))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r111730: Add `enable-dir-local-variables',
Glenn Morris <=