Commit f20c1ffd authored by Mattias Engdegård's avatar Mattias Engdegård
Browse files

* autorevert.el (auto-revert-notify-rm-watch): Simplify.

parent 87d1dc19
Pipeline #1405 failed with stage
in 90 minutes and 1 second
......@@ -499,18 +499,16 @@ will use an up-to-date value of `auto-revert-interval'"
(defun auto-revert-notify-rm-watch ()
"Disable file notification for current buffer's associated file."
(when auto-revert-notify-watch-descriptor
(lambda (key value)
(when (equal key auto-revert-notify-watch-descriptor)
(setq value (delete (current-buffer) value))
(if value
(puthash key value auto-revert-notify-watch-descriptor-hash-list)
(remhash key auto-revert-notify-watch-descriptor-hash-list)
(file-notify-rm-watch auto-revert-notify-watch-descriptor)))))
(remove-hook 'kill-buffer-hook #'auto-revert-notify-rm-watch t))
(let ((desc auto-revert-notify-watch-descriptor)
(table auto-revert-notify-watch-descriptor-hash-list))
(when desc
(let ((buffers (delq (current-buffer) (gethash desc table))))
(if buffers
(puthash desc buffers table)
(remhash desc table)))
(file-notify-rm-watch desc))
(remove-hook 'kill-buffer-hook #'auto-revert-notify-rm-watch t)))
(setq auto-revert-notify-watch-descriptor nil
auto-revert-notify-modified-p nil))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment