]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/autorevert.el (auto-revert-notify-handler): Explicitly ignore
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 4 Sep 2013 20:56:54 +0000 (16:56 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 4 Sep 2013 20:56:54 +0000 (16:56 -0400)
`deleted'.  Don't drop errors silently.

lisp/ChangeLog
lisp/autorevert.el

index 9088ca44af50106efb4e4356b35c0a00da89aac5..1e8165a0a1ef1a1513abc7be1deb1cebafb73b22 100644 (file)
@@ -1,5 +1,8 @@
 2013-09-04  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * 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  <xfq.free@gmail.com>
@@ -15,7 +18,7 @@
 
 2013-09-03  Stefan Monnier  <monnier@iro.umontreal.ca>
 
-       * 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'.
index 978a834cb4c93a248cb743071470b5a8c612b90b..0e2b6f32cf311e0ea22d4df22d169aff3c7449ab 100644 (file)
@@ -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)."