GNU bug report logs - #8095
dir-locals-directory-cache confusion

Previous Next

Package: emacs;

Reported by: Glenn Morris <rgm <at> gnu.org>

Date: Tue, 22 Feb 2011 08:32:01 UTC

Severity: normal

Found in version 23.2.94

Fixed in version 24.1

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 8095 in the body.
You can then email your comments to 8095 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8095; Package emacs. (Tue, 22 Feb 2011 08:32:01 GMT) Full text and rfc822 format available.

Message #3 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: submit <at> debbugs.gnu.org
Subject: dir-locals-directory-cache confusion
Date: Tue, 22 Feb 2011 03:31:45 -0500
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.




Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Thu, 24 Feb 2011 08:59:02 GMT) Full text and rfc822 format available.

Notification sent to Glenn Morris <rgm <at> gnu.org>:
bug acknowledged by developer. (Thu, 24 Feb 2011 08:59:02 GMT) Full text and rfc822 format available.

Message #8 received at 8095-done <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 8095-done <at> debbugs.gnu.org
Subject: Re: bug#8095: dir-locals-directory-cache confusion
Date: Thu, 24 Feb 2011 03:58:24 -0500
Version: 24.1

I believe I fixed this mess in the trunk.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8095; Package emacs. (Thu, 24 Feb 2011 14:48:01 GMT) Full text and rfc822 format available.

Message #11 received at 8095 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: 8095 <at> debbugs.gnu.org
Cc: rgm <at> gnu.org
Subject: Re: bug#8095: dir-locals-directory-cache confusion
Date: Thu, 24 Feb 2011 09:47:16 -0500
> I believe I fixed this mess in the trunk.

Thank you,


        Stefan




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 25 Mar 2011 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 14 years and 149 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.