From: Glenn Morris <rgm@gnu.org>
To: 8095@debbugs.gnu.org
Subject: bug#8095: dir-locals-directory-cache confusion
Date: Tue, 22 Feb 2011 03:31:45 -0500 [thread overview]
Message-ID: <e039ng79n2.fsf@fencepost.gnu.org> (raw)
Package: emacs
Version: 23.2.94
There is some weirdness going on with caching of dir-locals files:
mkdir foo
cat <<EOF > foo/.dir-locals.el
((nil . ((sentence-end-double-space . t))))
EOF
emacs -q foo/.dir-locals.el
C-h v sentence-end-double-space
This variable is a directory local variable
from the file "/home/gm/tmp/foo/".
^^^^^^^^^^^^^^^^^^^^^^^
That's a directory, not a file. Then do:
M-: (setq dir-locals-directory-cache nil)
and repeat:
C-h v sentence-end-double-space
This variable is a directory local variable
from the file "/home/gm/tmp/foo/.dir-locals.el".
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OK, now it's a directory.
Analysis: dir-locals-find-file is either going to return a file (if it
did not find a matching entry in the cache), or a directory (if it did
find an entry in the cache).
Further comment: This line in dir-locals-find-file
(equal (nth 2 dir-elt)
(nth 5 (file-attributes (car dir-elt))))
compares the mtime element from the cache with the current mtime of the
*directory*. The mtime element in the cache is set by
dir-locals-read-from-file and is the mtime of the *file*.
So in summary there is some confusion between directory and files that
messes up the caching. The whole thing should be consistent about
whether it wants to refer to directories or files.
next reply other threads:[~2011-02-22 8:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-22 8:31 Glenn Morris [this message]
2011-02-24 8:58 ` bug#8095: dir-locals-directory-cache confusion Glenn Morris
2011-02-24 14:47 ` Stefan Monnier
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e039ng79n2.fsf@fencepost.gnu.org \
--to=rgm@gnu.org \
--cc=8095@debbugs.gnu.org \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).