From df17725c80d60f1514488d40d2598ecb9e8382e9 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 25 May 2021 22:17:40 +0200 Subject: [PATCH] Handle syntactically invalid .dir-locals.el files better * 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lisp/files.el b/lisp/files.el index 62e1702fdf9..c694507e78a 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -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). -- 2.39.2