[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Remove all existing file notification watches from Emacs
From: |
Michael Albinus |
Subject: |
Remove all existing file notification watches from Emacs |
Date: |
Sat, 16 Oct 2021 09:14:17 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
While working on bug#51146, I found the following command useful, which
removes all file notification watches from an Emacs instance:
--8<---------------cut here---------------start------------->8---
(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))
--8<---------------cut here---------------end--------------->8---
The code is simple enough to avoid regressions. I'd like to add it to
the emacs-28 branch (plus doc), any objection?
Best regards, Michael.
- Remove all existing file notification watches from Emacs,
Michael Albinus <=
Re: Remove all existing file notification watches from Emacs, Stefan Kangas, 2021/10/16