unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Remove all existing file notification watches from Emacs
@ 2021-10-16  7:14 Michael Albinus
  2021-10-16  7:29 ` Eli Zaretskii
  2021-10-16 13:23 ` Stefan Monnier
  0 siblings, 2 replies; 12+ messages in thread
From: Michael Albinus @ 2021-10-16  7:14 UTC (permalink / raw)
  To: emacs-devel

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.



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-10-16 16:34 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-16  7:14 Remove all existing file notification watches from Emacs Michael Albinus
2021-10-16  7:29 ` Eli Zaretskii
2021-10-16  7:36   ` Michael Albinus
2021-10-16  7:48     ` Eli Zaretskii
2021-10-16 13:23 ` Stefan Monnier
2021-10-16 13:30   ` Michael Albinus
2021-10-16 14:09     ` Stefan Monnier
2021-10-16 14:21       ` Michael Albinus
2021-10-16 16:13         ` Michael Albinus
2021-10-16 16:34           ` Stefan Monnier
2021-10-16 14:32   ` Stefan Kangas
2021-10-16 14:35     ` Michael Albinus

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).