* 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.
(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).