emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master b82adee: Invalidate dir-locals-directory-cache when


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master b82adee: Invalidate dir-locals-directory-cache when writing dir-local file
Date: Sun, 18 Aug 2019 18:49:34 -0400 (EDT)

branch: master
commit b82adee1f64231236d50b48662d3419417ba5d48
Author: Johan Claesson <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Invalidate dir-locals-directory-cache when writing dir-local file
    
    * lisp/files-x.el (modify-dir-local-variable): Remove file from
    the cache when writing to ensure that we load the new version
    later (bug#13860).
---
 lisp/files-x.el | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lisp/files-x.el b/lisp/files-x.el
index b71e920..6b04518 100644
--- a/lisp/files-x.el
+++ b/lisp/files-x.el
@@ -491,6 +491,13 @@ from the MODE alist ignoring the input argument VALUE."
                (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))
+
       ;; Insert modified alist of directory-local variables.
       (insert ";;; Directory Local Variables\n")
       (insert ";;; For more information see (info \"(emacs) Directory 
Variables\")\n\n")



reply via email to

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