[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#26127: 26.0.50; Using file-notify-rm-watch on invalid descriptor rai
From: |
Michael Albinus |
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 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
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.