bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#13860: 24.2; dir-locals-directory-cache unreliable in one rare case


From: Lars Ingebrigtsen
Subject: bug#13860: 24.2; dir-locals-directory-cache unreliable in one rare case
Date: Sun, 18 Aug 2019 15:49:49 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]