From: Lars Ingebrigtsen <larsi@gnus.org>
To: Johan Claesson <johanclaesson@bredband.net>
Cc: 13860@debbugs.gnu.org
Subject: bug#13860: 24.2; dir-locals-directory-cache unreliable in one rare case
Date: Sun, 18 Aug 2019 15:49:49 -0700 [thread overview]
Message-ID: <87tvae3x82.fsf@mouse.gnus.org> (raw)
In-Reply-To: <87y2zqs2my.fsf@bredband.net> (Johan Claesson's message of "Sun, 18 Aug 2019 21:19:01 +0200")
Johan Claesson <johanclaesson@bredband.net> writes:
> I think one way to remedy this would be to explicitly invalidate the
> directory cache every time a .dir-local.el file is modified. Something
> like the following seem to do the trick:
>
> diff --git a/lisp/files-x.el b/lisp/files-x.el
> index b71e9204f3..6b04518fe4 100644
> --- a/lisp/files-x.el
> +++ b/lisp/files-x.el
> @@ -491,6 +491,13 @@ modify-dir-local-variable
> (cons `(,mode . ((,variable . ,value)))
> variables))))
>
> + ;; Invalidate cache (may be needed if this .dir-locals.el file
> + ;; will be written with the same timestamp as is already present
> + ;; in the cache, see bug#13860).
> + (setq dir-locals-directory-cache
> + (assoc-delete-all (file-name-directory variables-file)
> + dir-locals-directory-cache))
> +
Thanks; I think this makes sense, so I've applied it to Emacs 27.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
prev parent reply other threads:[~2019-08-18 22:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-03 11:01 bug#13860: 24.2; dir-locals-directory-cache unreliable in one rare case Johan Claesson
2019-08-15 6:18 ` Lars Ingebrigtsen
2019-08-18 19:19 ` Johan Claesson
2019-08-18 22:49 ` Lars Ingebrigtsen [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=87tvae3x82.fsf@mouse.gnus.org \
--to=larsi@gnus.org \
--cc=13860@debbugs.gnu.org \
--cc=johanclaesson@bredband.net \
/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.