unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Andreas Politz <politza@hochschule-trier.de>
Cc: 26127@debbugs.gnu.org
Subject: bug#26127: 26.0.50; Using file-notify-rm-watch on invalid descriptor raises invalid-function
Date: Fri, 17 Mar 2017 10:31:59 +0100	[thread overview]
Message-ID: <87inn89rlc.fsf@detlef> (raw)
In-Reply-To: <87mvcl9u7f.fsf@luca> (Andreas Politz's message of "Thu, 16 Mar 2017 15:23:16 +0100")

Andreas Politz <politza@hochschule-trier.de> writes:

Hi Andreas,

Thanks for the bug report!

> Calling file-notify-rm-watch on an invalid descriptor may throw a
> invalid-function error, but it should throw a file-notify-error instead.

`file-notify-error' shall appear only from `file-notify-add-watch'.
`file-notify-rm-watch' shall not raise an error at all.

> For example, this may occur when calling the function multiple times on
> the same descriptor.
>
> The error stems from file-notify--rm-descriptor, which contains the expression
>
>       (funcall
>        (cdr (assoc file (cdr registered)))
>        `(,descriptor stopped ,(if file (expand-file-name file dir)
>        dir)))
>
> , but (assoc file (cdr registered)) is nil.  I think this error is
> confusing.

I've fixed this in the master branch; there shouldn't be an error anymore.

> Attached you'll find a test case for this.

Thanks also for this. I've added it, modified, to filenotify-tests.el.

> -ap

Best regards, Michael.





  reply	other threads:[~2017-03-17  9:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-16 14:23 bug#26127: 26.0.50; Using file-notify-rm-watch on invalid descriptor raises invalid-function Andreas Politz
2017-03-17  9:31 ` Michael Albinus [this message]
2017-03-27 14:52   ` 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=87inn89rlc.fsf@detlef \
    --to=michael.albinus@gmx.de \
    --cc=26127@debbugs.gnu.org \
    --cc=politza@hochschule-trier.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).