From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: bug#8095: dir-locals-directory-cache confusion Date: Tue, 22 Feb 2011 03:31:45 -0500 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1298363820 20121 80.91.229.12 (22 Feb 2011 08:37:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 22 Feb 2011 08:37:00 +0000 (UTC) To: 8095@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 22 09:36:51 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Prnjm-0007hu-3R for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 Feb 2011 09:36:50 +0100 Original-Received: from localhost ([127.0.0.1]:51569 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Prnjl-0000pW-MU for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 Feb 2011 03:36:49 -0500 Original-Received: from [140.186.70.92] (port=46539 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Prnjf-0000nQ-O6 for bug-gnu-emacs@gnu.org; Tue, 22 Feb 2011 03:36:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Prnje-0003OI-MB for bug-gnu-emacs@gnu.org; Tue, 22 Feb 2011 03:36:43 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52664) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Prnje-0003OC-Ki for bug-gnu-emacs@gnu.org; Tue, 22 Feb 2011 03:36:42 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Prnf7-0004Bv-Om; Tue, 22 Feb 2011 03:32:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Glenn Morris Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Feb 2011 08:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 8095 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: submit@debbugs.gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.129836351616097 (code B ref -1); Tue, 22 Feb 2011 08:32:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Feb 2011 08:31:56 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Prnf1-0004Ba-DT for submit@debbugs.gnu.org; Tue, 22 Feb 2011 03:31:55 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Prnez-0004BO-2N for submit@debbugs.gnu.org; Tue, 22 Feb 2011 03:31:53 -0500 Original-Received: from localhost ([127.0.0.1]:58917) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Prnes-0000kw-MP; Tue, 22 Feb 2011 03:31:46 -0500 X-Spook: Forte mindwar Europol CNCIS lynch subversive Pine Gap X-Ran: ^8+DfX?U^Yli,5\ifyp".L5+SKp5wK[p83+ane2wT'YCe($ddE-(6!^-=XNIiVI*4|V=r4 X-Hue: white X-Attribution: GM User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Tue, 22 Feb 2011 03:32:01 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:44295 Archived-At: Package: emacs Version: 23.2.94 There is some weirdness going on with caching of dir-locals files: mkdir foo cat < 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.