From: Juri Linkov <juri@jurta.org>
To: "T.V. Raman" <tv.raman.tv@gmail.com>
Cc: Tom Tromey <tromey@redhat.com>, emacs-devel@gnu.org
Subject: Re: files.el: Once again impossible to turn off dir-settings
Date: Thu, 27 Nov 2008 02:00:51 +0200 [thread overview]
Message-ID: <874p1uox58.fsf@jurta.org> (raw)
In-Reply-To: <5f0ff9220811251419y4f6ac61cwab1a5c844829c6ea@mail.gmail.com> (T. V. Raman's message of "Tue, 25 Nov 2008 14:19:44 -0800")
> Yes, please introduce a customization option that disables
> dir-local settings.
This is implemented in the following patch:
Index: lisp/files.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/files.el,v
retrieving revision 1.1019
diff -c -r1.1019 files.el
*** lisp/files.el 24 Nov 2008 19:13:58 -0000 1.1019
--- lisp/files.el 27 Nov 2008 00:00:27 -0000
***************
*** 3290,3302 ****
(declare-function c-postprocess-file-styles "cc-mode" ())
(defun hack-dir-local-variables ()
"Read per-directory local variables for the current buffer.
Store the directory-local variables in `file-local-variables-alist',
without applying them."
(when (and enable-local-variables
(buffer-file-name)
! (not (file-remote-p (buffer-file-name))))
;; Find the variables file.
(let ((variables-file (dir-locals-find-file (buffer-file-name)))
(class nil)
--- 3290,3318 ----
(declare-function c-postprocess-file-styles "cc-mode" ())
+ (defcustom enable-dir-local-variables t
+ "Control use of directory-local variables in files you visit.
+ A value of nil means always ignore directory-local variables. A value
+ of t means obey directory-local variables except when they are on
+ a remote system. `remote' means search directory-local variables
+ in remote files as well.
+
+ File-local customization in variables like `enable-local-variables'
+ is checked in addition to this variable."
+ :type '(choice (const :tag "Enable" t)
+ (const :tag "Remote" remote)
+ (const :tag "Disable" nil))
+ :group 'find-file)
+
(defun hack-dir-local-variables ()
"Read per-directory local variables for the current buffer.
Store the directory-local variables in `file-local-variables-alist',
without applying them."
(when (and enable-local-variables
+ enable-dir-local-variables
(buffer-file-name)
! (or (eq enable-dir-local-variables 'remote)
! (not (file-remote-p (buffer-file-name)))))
;; Find the variables file.
(let ((variables-file (dir-locals-find-file (buffer-file-name)))
(class nil)
--
Juri Linkov
http://www.jurta.org/emacs/
prev parent reply other threads:[~2008-11-27 0:00 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-25 14:13 files.el: Once again impossible to turn off dir-settings T.V. Raman
2008-11-25 15:30 ` Stefan Monnier
2008-11-25 19:00 ` T.V. Raman
2008-11-25 21:48 ` Stefan Monnier
2008-11-25 22:42 ` Chong Yidong
2008-11-26 1:37 ` Stefan Monnier
2008-11-26 4:33 ` T.V. Raman
2008-11-26 14:37 ` Stefan Monnier
2008-11-29 3:46 ` Miles Bader
2008-11-25 16:04 ` Juri Linkov
2008-11-25 19:03 ` T.V. Raman
2008-11-25 20:02 ` Tom Tromey
2008-11-25 22:19 ` T.V. Raman
2008-11-27 0:00 ` Juri Linkov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874p1uox58.fsf@jurta.org \
--to=juri@jurta.org \
--cc=emacs-devel@gnu.org \
--cc=tromey@redhat.com \
--cc=tv.raman.tv@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.