emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Remove all existing file notification watches from Emacs


From: Stefan Monnier
Subject: Re: Remove all existing file notification watches from Emacs
Date: Sat, 16 Oct 2021 09:23:30 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.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---

I can see its use while debugging but I can't imagine it being of any
use in real ELisp code because it's much too blunt.
[ Personally I'd put a `--` in its name and/or add some blurb in the
docstring explaining it's only for debugging.  ]

> The code is simple enough to avoid regressions. I'd like to add it to
> the emacs-28 branch (plus doc), any objection?

I don't see any reason why it needs to be in emacs-28.
It's not a bugfix and there's no hurry.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]