emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] elisp manual patch: add to file notification documentation


From: Stefan Monnier
Subject: Re: [PATCH] elisp manual patch: add to file notification documentation
Date: Tue, 13 Dec 2022 13:06:28 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

> The documentation for `file-notify-add-watch' says: "If the file cannot
> be watched for some reason, this function signals a `file-notify-error'
> error."

If this error is not good enough, maybe we should improve it, e.g. it
could return different contents depending on whether the problem is
a lack of notification support in Emacs, or a lack of notification
support for this particular file/dir (e.g. via Tramp), etc...

> I think that there is value in documenting a way for us to check if the
> emacs we are running supports file notification, short of actually
> trying to run `file-notify-add-watch', getting a generic
> `file-notify-error', and reading the associated message to find out if
> it is a simple problem, like a missing directory, or a difficult
> problem, like a missing library.

I guess it depends what you intend to do with that info.

AFAIK all callers of `file-notify-add-watch` need to handle the case
where the addition fails, but I wonder how you intend to use the
specific kind of error in the rest of the code.

I guess you could also perform a dummy `file-notify-add-watch` on
something like $HOME as a way to check whether there is basic support
for file notifications.


        Stefan




reply via email to

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