diff options
| author | Artur Malabarba | 2015-11-10 13:14:49 +0000 |
|---|---|---|
| committer | Artur Malabarba | 2015-11-10 13:14:49 +0000 |
| commit | 77cebbc1e77edf23bc2c23a218b56d9d6ad68e74 (patch) | |
| tree | 023d4981cc5047b9c744a55a2bb5116004a7755d /lisp | |
| parent | 4d82aa3abdad1871b99f0a9e56fe54ec497bd290 (diff) | |
| download | emacs-77cebbc1e77edf23bc2c23a218b56d9d6ad68e74.tar.gz emacs-77cebbc1e77edf23bc2c23a218b56d9d6ad68e74.zip | |
* lisp/files.el (dir-locals-read-from-file): Better handle errors
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/files.el | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lisp/files.el b/lisp/files.el index 58ed35730fe..efba15ea15f 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -3808,6 +3808,7 @@ is found. Returns the new class name." | |||
| 3808 | (class-name (intern dir-name)) | 3808 | (class-name (intern dir-name)) |
| 3809 | (files (dir-locals--all-files file)) | 3809 | (files (dir-locals--all-files file)) |
| 3810 | (read-circle nil) | 3810 | (read-circle nil) |
| 3811 | (success nil) | ||
| 3811 | (variables)) | 3812 | (variables)) |
| 3812 | (with-demoted-errors "Error reading dir-locals: %S" | 3813 | (with-demoted-errors "Error reading dir-locals: %S" |
| 3813 | (dolist (file files) | 3814 | (dolist (file files) |
| @@ -3818,13 +3819,19 @@ is found. Returns the new class name." | |||
| 3818 | (map-merge-with 'list (lambda (a b) (map-merge 'list a b)) | 3819 | (map-merge-with 'list (lambda (a b) (map-merge 'list a b)) |
| 3819 | variables | 3820 | variables |
| 3820 | (read (current-buffer)))) | 3821 | (read (current-buffer)))) |
| 3821 | (end-of-file nil))))) | 3822 | (end-of-file nil)))) |
| 3823 | (setq success t)) | ||
| 3822 | (dir-locals-set-class-variables class-name variables) | 3824 | (dir-locals-set-class-variables class-name variables) |
| 3823 | (dir-locals-set-directory-class | 3825 | (dir-locals-set-directory-class |
| 3824 | dir-name class-name | 3826 | dir-name class-name |
| 3825 | (seconds-to-time (apply #'max (mapcar (lambda (file) | 3827 | (seconds-to-time |
| 3826 | (time-to-seconds (nth 5 (file-attributes file)))) | 3828 | (if success |
| 3827 | files)))) | 3829 | (apply #'max (mapcar (lambda (file) |
| 3830 | (time-to-seconds (nth 5 (file-attributes file)))) | ||
| 3831 | files)) | ||
| 3832 | ;; If there was a problem, use the values we could get but | ||
| 3833 | ;; don't let the cache prevent future reads. | ||
| 3834 | 0))) | ||
| 3828 | class-name)) | 3835 | class-name)) |
| 3829 | 3836 | ||
| 3830 | (defcustom enable-remote-dir-locals nil | 3837 | (defcustom enable-remote-dir-locals nil |