summaryrefslogtreecommitdiff
path: root/lisp/filenotify.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/filenotify.el')
-rw-r--r--lisp/filenotify.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/filenotify.el b/lisp/filenotify.el
index 271fa270836..26954cc73f2 100644
--- a/lisp/filenotify.el
+++ b/lisp/filenotify.el
@@ -480,6 +480,14 @@ DESCRIPTOR should be an object returned by `file-notify-add-watch'."
;; Modify `file-notify-descriptors' and send a `stopped' event.
(file-notify--rm-descriptor descriptor))))
+(defun file-notify-rm-all-watches ()
+ "Remove all existing file notification watches from Emacs."
+ (interactive)
+ (maphash
+ (lambda (key _value)
+ (file-notify-rm-watch key))
+ file-notify-descriptors))
+
(defun file-notify-valid-p (descriptor)
"Check a watch specified by its DESCRIPTOR.
DESCRIPTOR should be an object returned by `file-notify-add-watch'."