emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r114130: * lisp/autorevert.el (auto-revert-notify-ha


From: Stefan Monnier
Subject: [Emacs-diffs] trunk r114130: * lisp/autorevert.el (auto-revert-notify-handler): Explicitly ignore
Date: Wed, 04 Sep 2013 20:56:58 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 114130
revision-id: address@hidden
parent: address@hidden
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Wed 2013-09-04 16:56:54 -0400
message:
  * lisp/autorevert.el (auto-revert-notify-handler): Explicitly ignore
  `deleted'.  Don't drop errors silently.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/autorevert.el             
autorevert.el-20091113204419-o5vbwnq5f7feedwu-1197
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-09-04 20:03:52 +0000
+++ b/lisp/ChangeLog    2013-09-04 20:56:54 +0000
@@ -1,5 +1,8 @@
 2013-09-04  Stefan Monnier  <address@hidden>
 
+       * 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  <address@hidden>
@@ -15,7 +18,7 @@
 
 2013-09-03  Stefan Monnier  <address@hidden>
 
-       * 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'.

=== modified file 'lisp/autorevert.el'
--- a/lisp/autorevert.el        2013-08-01 23:18:37 +0000
+++ b/lisp/autorevert.el        2013-09-04 20:56:54 +0000
@@ -531,7 +531,7 @@
 
 (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 @@
       ;; 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)."


reply via email to

[Prev in Thread] Current Thread [Next in Thread]