GNU bug report logs - #26127
26.0.50; Using file-notify-rm-watch on invalid descriptor raises invalid-function

Previous Next

Package: emacs;

Reported by: Andreas Politz <politza <at> hochschule-trier.de>

Date: Thu, 16 Mar 2017 14:25:01 UTC

Severity: minor

Found in version 26.0.50

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Andreas Politz <politza <at> hochschule-trier.de>
Cc: 26127 <at> 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
Andreas Politz <politza <at> 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.




This bug report was last modified 8 years and 56 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.