aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias EngdegÄrd2019-04-22 18:04:00 +0200
committerMattias EngdegÄrd2019-04-22 18:06:10 +0200
commitf20c1ffd05aab43a14ade3c433216a6c6fbe4b24 (patch)
treea0e8d6351dd84cdb18e84947a484146f0813a035
parent87d1dc19c933de522a6f4341701903b6418f3abe (diff)
downloademacs-f20c1ffd05aab43a14ade3c433216a6c6fbe4b24.tar.gz
emacs-f20c1ffd05aab43a14ade3c433216a6c6fbe4b24.zip
* autorevert.el (auto-revert-notify-rm-watch): Simplify.
-rw-r--r--lisp/autorevert.el22
1 files changed, 10 insertions, 12 deletions
diff --git a/lisp/autorevert.el b/lisp/autorevert.el
index 4fb865e8adb..6f2415a3ae4 100644
--- a/lisp/autorevert.el
+++ b/lisp/autorevert.el
@@ -499,18 +499,16 @@ will use an up-to-date value of `auto-revert-interval'"
499 499
500(defun auto-revert-notify-rm-watch () 500(defun auto-revert-notify-rm-watch ()
501 "Disable file notification for current buffer's associated file." 501 "Disable file notification for current buffer's associated file."
502 (when auto-revert-notify-watch-descriptor 502 (let ((desc auto-revert-notify-watch-descriptor)
503 (maphash 503 (table auto-revert-notify-watch-descriptor-hash-list))
504 (lambda (key value) 504 (when desc
505 (when (equal key auto-revert-notify-watch-descriptor) 505 (let ((buffers (delq (current-buffer) (gethash desc table))))
506 (setq value (delete (current-buffer) value)) 506 (if buffers
507 (if value 507 (puthash desc buffers table)
508 (puthash key value auto-revert-notify-watch-descriptor-hash-list) 508 (remhash desc table)))
509 (remhash key auto-revert-notify-watch-descriptor-hash-list) 509 (ignore-errors
510 (ignore-errors 510 (file-notify-rm-watch desc))
511 (file-notify-rm-watch auto-revert-notify-watch-descriptor))))) 511 (remove-hook 'kill-buffer-hook #'auto-revert-notify-rm-watch t)))
512 auto-revert-notify-watch-descriptor-hash-list)
513 (remove-hook 'kill-buffer-hook #'auto-revert-notify-rm-watch t))
514 (setq auto-revert-notify-watch-descriptor nil 512 (setq auto-revert-notify-watch-descriptor nil
515 auto-revert-notify-modified-p nil)) 513 auto-revert-notify-modified-p nil))
516 514