[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 77cebbc: * lisp/files.el (dir-locals-read-from-file
From: |
Artur Malabarba |
Subject: |
[Emacs-diffs] master 77cebbc: * lisp/files.el (dir-locals-read-from-file): Better handle errors |
Date: |
Tue, 10 Nov 2015 12:15:43 +0000 |
branch: master
commit 77cebbc1e77edf23bc2c23a218b56d9d6ad68e74
Author: Artur Malabarba <address@hidden>
Commit: Artur Malabarba <address@hidden>
* lisp/files.el (dir-locals-read-from-file): Better handle errors
---
lisp/files.el | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/lisp/files.el b/lisp/files.el
index 58ed357..efba15e 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3808,6 +3808,7 @@ is found. Returns the new class name."
(class-name (intern dir-name))
(files (dir-locals--all-files file))
(read-circle nil)
+ (success nil)
(variables))
(with-demoted-errors "Error reading dir-locals: %S"
(dolist (file files)
@@ -3818,13 +3819,19 @@ is found. Returns the new class name."
(map-merge-with 'list (lambda (a b) (map-merge 'list a b))
variables
(read (current-buffer))))
- (end-of-file nil)))))
+ (end-of-file nil))))
+ (setq success t))
(dir-locals-set-class-variables class-name variables)
(dir-locals-set-directory-class
dir-name class-name
- (seconds-to-time (apply #'max (mapcar (lambda (file)
- (time-to-seconds (nth 5
(file-attributes file))))
- files))))
+ (seconds-to-time
+ (if success
+ (apply #'max (mapcar (lambda (file)
+ (time-to-seconds (nth 5 (file-attributes
file))))
+ files))
+ ;; If there was a problem, use the values we could get but
+ ;; don't let the cache prevent future reads.
+ 0)))
class-name))
(defcustom enable-remote-dir-locals nil
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 77cebbc: * lisp/files.el (dir-locals-read-from-file): Better handle errors,
Artur Malabarba <=