aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2013-09-04 16:56:54 -0400
committerStefan Monnier2013-09-04 16:56:54 -0400
commitabae272ccea2a9b01723c56d5ec60d6df9f0306c (patch)
tree6826024079494b1f577c15fba53ffb16f97522d0
parent6629638eb3d49be98cb9633d7b52d19acc0c5d18 (diff)
downloademacs-abae272ccea2a9b01723c56d5ec60d6df9f0306c.tar.gz
emacs-abae272ccea2a9b01723c56d5ec60d6df9f0306c.zip
* 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 9088ca44af5..1e8165a0a1e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
12013-09-04 Stefan Monnier <monnier@iro.umontreal.ca> 12013-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * autorevert.el (auto-revert-notify-handler): Explicitly ignore
4 `deleted'. Don't drop errors silently.
5
3 * emacs-lisp/gv.el (gv-get): Warn about CL-compiled places. 6 * emacs-lisp/gv.el (gv-get): Warn about CL-compiled places.
4 7
52013-09-04 Xue Fuqiao <xfq.free@gmail.com> 82013-09-04 Xue Fuqiao <xfq.free@gmail.com>
@@ -15,7 +18,7 @@
15 18
162013-09-03 Stefan Monnier <monnier@iro.umontreal.ca> 192013-09-03 Stefan Monnier <monnier@iro.umontreal.ca>
17 20
18 * net/tramp-gvfs.el (tramp-gvfs-mount-spec, tramp-synce-list-devices): 21 * net/tramp-gvfs.el (tramp-gvfs-mount-spec, tramp-synce-list-devices):
19 * net/tramp-smb.el (tramp-smb-get-file-entries): 22 * net/tramp-smb.el (tramp-smb-get-file-entries):
20 * net/tramp-sh.el (tramp-sh-handle-insert-directory) 23 * net/tramp-sh.el (tramp-sh-handle-insert-directory)
21 (tramp-compute-multi-hops): Fix misuses of `add-to-list'. 24 (tramp-compute-multi-hops): Fix misuses of `add-to-list'.
diff --git a/lisp/autorevert.el b/lisp/autorevert.el
index 978a834cb4c..0e2b6f32cf3 100644
--- a/lisp/autorevert.el
+++ b/lisp/autorevert.el
@@ -531,7 +531,7 @@ will use an up-to-date value of `auto-revert-interval'"
531 531
532(defun auto-revert-notify-handler (event) 532(defun auto-revert-notify-handler (event)
533 "Handle an EVENT returned from file notification." 533 "Handle an EVENT returned from file notification."
534 (ignore-errors 534 (with-demoted-errors
535 (let* ((descriptor (car event)) 535 (let* ((descriptor (car event))
536 (action (nth 1 event)) 536 (action (nth 1 event))
537 (file (nth 2 event)) 537 (file (nth 2 event))
@@ -541,28 +541,31 @@ will use an up-to-date value of `auto-revert-interval'"
541 ;; Check, that event is meant for us. 541 ;; Check, that event is meant for us.
542 (cl-assert descriptor) 542 (cl-assert descriptor)
543 ;; We do not handle `deleted', because nothing has to be refreshed. 543 ;; We do not handle `deleted', because nothing has to be refreshed.
544 (cl-assert (memq action '(attribute-changed changed created renamed)) t) 544 (unless (eq action 'deleted)
545 ;; Since we watch a directory, a file name must be returned. 545 (cl-assert (memq action '(attribute-changed changed created renamed))
546 (cl-assert (stringp file)) 546 t)
547 (when (eq action 'renamed) (cl-assert (stringp file1))) 547 ;; Since we watch a directory, a file name must be returned.
548 ;; Loop over all buffers, in order to find the intended one. 548 (cl-assert (stringp file))
549 (dolist (buffer buffers) 549 (when (eq action 'renamed) (cl-assert (stringp file1)))
550 (when (buffer-live-p buffer) 550 ;; Loop over all buffers, in order to find the intended one.
551 (with-current-buffer buffer 551 (dolist (buffer buffers)
552 (when (and (stringp buffer-file-name) 552 (when (buffer-live-p buffer)
553 (or 553 (with-current-buffer buffer
554 (and (memq action '(attribute-changed changed created)) 554 (when (and (stringp buffer-file-name)
555 (string-equal 555 (or
556 (file-name-nondirectory file) 556 (and (memq action '(attribute-changed changed
557 (file-name-nondirectory buffer-file-name))) 557 created))
558 (and (eq action 'renamed) 558 (string-equal
559 (string-equal 559 (file-name-nondirectory file)
560 (file-name-nondirectory file1) 560 (file-name-nondirectory buffer-file-name)))
561 (file-name-nondirectory buffer-file-name))))) 561 (and (eq action 'renamed)
562 ;; Mark buffer modified. 562 (string-equal
563 (setq auto-revert-notify-modified-p t) 563 (file-name-nondirectory file1)
564 ;; No need to check other buffers. 564 (file-name-nondirectory buffer-file-name)))))
565 (cl-return)))))))) 565 ;; Mark buffer modified.
566 (setq auto-revert-notify-modified-p t)
567 ;; No need to check other buffers.
568 (cl-return)))))))))
566 569
567(defun auto-revert-active-p () 570(defun auto-revert-active-p ()
568 "Check if auto-revert is active (in current buffer or globally)." 571 "Check if auto-revert is active (in current buffer or globally)."