Skip to content

Commit

Permalink
Handle syntactically invalid .dir-locals.el files better
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
larsmagne committed May 25, 2021
1 parent ffd2a5c commit df17725
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lisp/files.el
Expand Up @@ -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).
Expand Down

0 comments on commit df17725

Please sign in to comment.