From unknown Mon Aug 18 18:13:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8095: dir-locals-directory-cache confusion 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: To: 8095@debbugs.gnu.org X-Debbugs-Original-To: submit@debbugs.gnu.org Received: via spool by submit@debbugs.gnu.org id=B.129836351616097 (code B ref -1); Tue, 22 Feb 2011 08:32:01 +0000 Received: (at submit) by debbugs.gnu.org; 22 Feb 2011 08:31:56 +0000 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 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 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 From: Glenn Morris 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 Date: Tue, 22 Feb 2011 03:31:45 -0500 Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.3 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) 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. From unknown Mon Aug 18 18:13:20 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Glenn Morris Subject: bug#8095: closed (Re: bug#8095: dir-locals-directory-cache confusion) Message-ID: References: X-Gnu-PR-Message: they-closed 8095 X-Gnu-PR-Package: emacs Reply-To: 8095@debbugs.gnu.org Date: Thu, 24 Feb 2011 08:59:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1298537942-24392-1" This is a multi-part message in MIME format... ------------=_1298537942-24392-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #8095: dir-locals-directory-cache confusion which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 8095@debbugs.gnu.org. --=20 8095: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D8095 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1298537942-24392-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 8095-done) by debbugs.gnu.org; 24 Feb 2011 08:58:34 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PsX1t-0006Kh-4v for submit@debbugs.gnu.org; Thu, 24 Feb 2011 03:58:33 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PsX1s-0006KV-2u for 8095-done@debbugs.gnu.org; Thu, 24 Feb 2011 03:58:32 -0500 Received: from localhost ([127.0.0.1]:39308) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PsX1l-0006XQ-7Y; Thu, 24 Feb 2011 03:58:25 -0500 From: Glenn Morris To: 8095-done@debbugs.gnu.org Subject: Re: bug#8095: dir-locals-directory-cache confusion References: X-Spook: Croatian Uzbekistan csim Merlin mania AGT. AMME PET Kosovo X-Ran: G8{C@`#a}}&-'N/Ql^<4rNf3|paJ<5-~Qb_JkJ+8m+&9Lk5TJS/]wMd*m%h6komf[D:d+4 X-Hue: magenta X-Debbugs-No-Ack: yes X-Attribution: GM Date: Thu, 24 Feb 2011 03:58:24 -0500 Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: 8095-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) Version: 24.1 I believe I fixed this mess in the trunk. ------------=_1298537942-24392-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 22 Feb 2011 08:31:56 +0000 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 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 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 From: Glenn Morris To: submit@debbugs.gnu.org Subject: dir-locals-directory-cache confusion 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-Debbugs-No-Ack: yes X-Attribution: GM Date: Tue, 22 Feb 2011 03:31:45 -0500 Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) 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. ------------=_1298537942-24392-1-- From unknown Mon Aug 18 18:13:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8095: dir-locals-directory-cache confusion Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 24 Feb 2011 14:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8095 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 8095@debbugs.gnu.org Cc: rgm@gnu.org Received: via spool by 8095-submit@debbugs.gnu.org id=B8095.129855884527994 (code B ref 8095); Thu, 24 Feb 2011 14:48:01 +0000 Received: (at 8095) by debbugs.gnu.org; 24 Feb 2011 14:47:25 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PscTT-0007HT-Tp for submit@debbugs.gnu.org; Thu, 24 Feb 2011 09:47:24 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PscTS-0007HI-PZ for 8095@debbugs.gnu.org; Thu, 24 Feb 2011 09:47:23 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArEGAPb9ZU1FxIPF/2dsb2JhbACYFI4TdL1RhWAEhRCPWw X-IronPort-AV: E=Sophos;i="4.62,218,1297054800"; d="scan'208";a="93397035" Received: from 69-196-131-197.dsl.teksavvy.com (HELO pastel.home) ([69.196.131.197]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 24 Feb 2011 09:47:17 -0500 Received: by pastel.home (Postfix, from userid 20848) id 1561A4E050; Thu, 24 Feb 2011 09:47:17 -0500 (EST) From: Stefan Monnier Message-ID: References: Date: Thu, 24 Feb 2011 09:47:16 -0500 In-Reply-To: (Glenn Morris's message of "Thu, 24 Feb 2011 03:58:24 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.1 (--) > I believe I fixed this mess in the trunk. Thank you, Stefan