]> git.eshelyaron.com Git - emacs.git/commitdiff
Handle syntactically invalid .dir-locals.el files better
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 25 May 2021 20:17:40 +0000 (22:17 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 25 May 2021 20:17:40 +0000 (22:17 +0200)
* lisp/files.el (dir-locals-read-from-dir): Handle syntactically
invalid .dir-locals.el files more gently (bug#48568).  Give a
message instead of bugging out later.

lisp/files.el

index 62e1702fdf9f7d4cfd6e07f8a6a4ead794bc2823..c694507e78af1402988d140532471a7b297035a7 100644 (file)
@@ -4359,6 +4359,9 @@ Return the new class name, which is a symbol named DIR."
                      (let ((read-circle nil))
                        (read (current-buffer)))
                    (end-of-file nil))))
+            (unless (listp newvars)
+              (message "Invalid data in %s: %s" file newvars)
+              (setq newvars nil))
             (setq variables
                   ;; Try and avoid loading `map' since that also loads cl-lib
                   ;; which then might hamper bytecomp warnings (bug#30635).