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: Michael Albinus
Subject: Re: Remove all existing file notification watches from Emacs
Date: Sat, 16 Oct 2021 16:21:38 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

Hi Stefan,

> I mean, using this instead of restarting Emacs may work sometimes, but
> it can have undesirable (and hard to predict, for the end user) side
> effects since packages have had their watches killed from under them.

Like this?

(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))
> So it's OK to use when the alternative is to kill Emacs, but it should
> come with some warnings

Do you want a confirmation à la "Are you really really sure?"

> (in a pessimistic scenario I can see some blog
> mentioning this command alongside the usual "set your GC threshold super
> high" and a few other things, in the toolbox of "make your Emacs more
> faster").

Such blogs will always happen ...

>         Stefan

Best regards, Michael.

reply via email to

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