summaryrefslogtreecommitdiff
path: root/lisp/files.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2013-09-11 22:32:57 -0700
committerGlenn Morris <rgm@gnu.org>2013-09-11 22:32:57 -0700
commit30213927b6eebe291cd425d5863f54bffe0b8a83 (patch)
treea66f7b728c1ba3723a02d2b242cecf3660053bc4 /lisp/files.el
parent170266d096bc4d0952bee907532d14503e882bf6 (diff)
downloademacs-30213927b6eebe291cd425d5863f54bffe0b8a83.tar.gz
Use with-demoted-errors now that it can format any error messages
* dframe.el (dframe-timer-fn): * files.el (dir-locals-read-from-file): * mpc.el (mpc--status-timer-run, mpc--status-idle-timer-run, mpc-format): * reveal.el (reveal-post-command): * saveplace.el (load-save-place-alist-from-file): * shell.el (shell-resync-dirs): * w32-common-fns.el (x-get-selection-value): * emacs-lisp/copyright.el (copyright-find-copyright): * emacs-lisp/eldoc.el (eldoc-print-current-symbol-info): * emulation/tpu-edt.el (tpu-copy-keyfile): * play/bubbles.el (bubbles--mark-neighbourhood): * progmodes/executable.el (executable-make-buffer-file-executable-if-script-p): * term/pc-win.el (x-get-selection-value): Use with-demoted-errors.
Diffstat (limited to 'lisp/files.el')
-rw-r--r--lisp/files.el26
1 files changed, 11 insertions, 15 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 85bbc8596be..ca55c646699 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3637,21 +3637,17 @@ FILE is the name of the file holding the variables to apply.
The new class name is the same as the directory in which FILE
is found. Returns the new class name."
(with-temp-buffer
- ;; This is with-demoted-errors, but we want to mention dir-locals
- ;; in any error message.
- (condition-case err
- (progn
- (insert-file-contents file)
- (unless (zerop (buffer-size))
- (let* ((dir-name (file-name-directory file))
- (class-name (intern dir-name))
- (variables (let ((read-circle nil))
- (read (current-buffer)))))
- (dir-locals-set-class-variables class-name variables)
- (dir-locals-set-directory-class dir-name class-name
- (nth 5 (file-attributes file)))
- class-name)))
- (error (message "Error reading dir-locals: %S" err) nil))))
+ (with-demoted-errors "Error reading dir-locals: %S"
+ (insert-file-contents file)
+ (unless (zerop (buffer-size))
+ (let* ((dir-name (file-name-directory file))
+ (class-name (intern dir-name))
+ (variables (let ((read-circle nil))
+ (read (current-buffer)))))
+ (dir-locals-set-class-variables class-name variables)
+ (dir-locals-set-directory-class dir-name class-name
+ (nth 5 (file-attributes file)))
+ class-name)))))
(defcustom enable-remote-dir-locals nil
"Non-nil means dir-local variables will be applied to remote files."