summaryrefslogtreecommitdiff
path: root/lisp/files-x.el
diff options
context:
space:
mode:
authorJohan Claesson <johanclaesson@bredband.net>2019-08-18 15:49:24 -0700
committerLars Ingebrigtsen <larsi@gnus.org>2019-08-18 15:49:29 -0700
commitb82adee1f64231236d50b48662d3419417ba5d48 (patch)
tree500a8f9699962aadddce345e4c49ca815ba4f93c /lisp/files-x.el
parentf9464020d403be8344f8293297b27276872571d4 (diff)
downloademacs-b82adee1f64231236d50b48662d3419417ba5d48.tar.gz
emacs-b82adee1f64231236d50b48662d3419417ba5d48.tar.bz2
emacs-b82adee1f64231236d50b48662d3419417ba5d48.zip
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).
Diffstat (limited to 'lisp/files-x.el')
-rw-r--r--lisp/files-x.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/lisp/files-x.el b/lisp/files-x.el
index b71e9204f32..6b04518fe40 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")