aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier <[email protected]>2013-09-04 16:56:54 -0400
committerStefan Monnier <[email protected]>2013-09-04 16:56:54 -0400
commitabae272ccea2a9b01723c56d5ec60d6df9f0306c (patch)
tree6826024079494b1f577c15fba53ffb16f97522d0
parent6629638eb3d49be98cb9633d7b52d19acc0c5d18 (diff)
* lisp/autorevert.el (auto-revert-notify-handler): Explicitly ignore
`deleted'. Don't drop errors silently.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/autorevert.el49
2 files changed, 30 insertions, 24 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9088ca44af..1e8165a0a1 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
2013-09-04 Stefan Monnier <[email protected]>
+ * autorevert.el (auto-revert-notify-handler): Explicitly ignore
+ `deleted'. Don't drop errors silently.
+
* emacs-lisp/gv.el (gv-get): Warn about CL-compiled places.
2013-09-04 Xue Fuqiao <[email protected]>
@@ -15,7 +18,7 @@
2013-09-03 Stefan Monnier <[email protected]>
- * net/tramp-gvfs.el (tramp-gvfs-mount-spec, tramp-synce-list-devices):
+ * net/tramp-gvfs.el (tramp-gvfs-mount-spec, tramp-synce-list-devices):
* net/tramp-smb.el (tramp-smb-get-file-entries):
* net/tramp-sh.el (tramp-sh-handle-insert-directory)
(tramp-compute-multi-hops): Fix misuses of `add-to-list'.
diff --git a/lisp/autorevert.el b/lisp/autorevert.el
index 978a834cb4..0e2b6f32cf 100644
--- a/lisp/autorevert.el
+++ b/lisp/autorevert.el
@@ -531,7 +531,7 @@ will use an up-to-date value of `auto-revert-interval'"
(defun auto-revert-notify-handler (event)
"Handle an EVENT returned from file notification."
- (ignore-errors
+ (with-demoted-errors
(let* ((descriptor (car event))
(action (nth 1 event))
(file (nth 2 event))
@@ -541,28 +541,31 @@ will use an up-to-date value of `auto-revert-interval'"
;; Check, that event is meant for us.
(cl-assert descriptor)
;; We do not handle `deleted', because nothing has to be refreshed.
- (cl-assert (memq action '(attribute-changed changed created renamed)) t)
- ;; Since we watch a directory, a file name must be returned.
- (cl-assert (stringp file))
- (when (eq action 'renamed) (cl-assert (stringp file1)))
- ;; Loop over all buffers, in order to find the intended one.
- (dolist (buffer buffers)
- (when (buffer-live-p buffer)
- (with-current-buffer buffer
- (when (and (stringp buffer-file-name)
- (or
- (and (memq action '(attribute-changed changed created))
- (string-equal
- (file-name-nondirectory file)
- (file-name-nondirectory buffer-file-name)))
- (and (eq action 'renamed)
- (string-equal
- (file-name-nondirectory file1)
- (file-name-nondirectory buffer-file-name)))))
- ;; Mark buffer modified.
- (setq auto-revert-notify-modified-p t)
- ;; No need to check other buffers.
- (cl-return))))))))
+ (unless (eq action 'deleted)
+ (cl-assert (memq action '(attribute-changed changed created renamed))
+ t)
+ ;; Since we watch a directory, a file name must be returned.
+ (cl-assert (stringp file))
+ (when (eq action 'renamed) (cl-assert (stringp file1)))
+ ;; Loop over all buffers, in order to find the intended one.
+ (dolist (buffer buffers)
+ (when (buffer-live-p buffer)
+ (with-current-buffer buffer
+ (when (and (stringp buffer-file-name)
+ (or
+ (and (memq action '(attribute-changed changed
+ created))
+ (string-equal
+ (file-name-nondirectory file)
+ (file-name-nondirectory buffer-file-name)))
+ (and (eq action 'renamed)
+ (string-equal
+ (file-name-nondirectory file1)
+ (file-name-nondirectory buffer-file-name)))))
+ ;; Mark buffer modified.
+ (setq auto-revert-notify-modified-p t)
+ ;; No need to check other buffers.
+ (cl-return)))))))))
(defun auto-revert-active-p ()
"Check if auto-revert is active (in current buffer or globally)."