unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: emacs-devel@gnu.org
Subject: Re: Remove all existing file notification watches from Emacs
Date: Sat, 16 Oct 2021 09:23:30 -0400	[thread overview]
Message-ID: <jwvv91xkszu.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87zgr9igqe.fsf@gmx.de> (Michael Albinus's message of "Sat, 16 Oct 2021 09:14:17 +0200")

> 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




  parent reply	other threads:[~2021-10-16 13:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvv91xkszu.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=michael.albinus@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).