help-gnu-emacs
[Top][All Lists]
Advanced

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

Help debugging `file-notify-handle-event`


From: Alejandro Pérez Carballo
Subject: Help debugging `file-notify-handle-event`
Date: Tue, 8 Nov 2022 20:50:37 -0500

Hello, 

I've been trying to figure out the source of this recurring error message for 
weeks. I thought I had found a bug, but discussion with Michael Albinus after 
my bug report made me think I was confused.

https://lists.gnu.org/archive/html/bug-gnu-emacs/2022-11/msg00123.html

The error message I've gotten for months now, often multiple times overnight, 
is just this: 

    file-notify--call-handler: Symbol’s function definition is void: nil

I don't really know what's triggering it, but having once caught a backtrace 
(which I failed to save somewhere), I ended up suspecting that the issue was 
related to the fact that, just loading this in vanilla Emacs:

```
(require 'filenotify)
(require 'autorevert)
(require 'subr-x)
(global-auto-revert-mode)

(save-window-excursion
  (find-file "~/tmp/test.el"))
```

and then running this:

    (file-notify--handle-event (car (hash-table-keys file-notify-descriptors)) 
'(renamed deleted) "/Users/apc/tmp/test.el" nil)

led to the same error: 

    file-notify--call-handler: Symbol’s function definition is void: nil

But in his follow up to my bug report, Michael suggested that this call

    file-notify--handle-event(20 (renamed deleted) 
"/Users/apc/org/agenda/work.org" nil)

was invalid (assuming 20 is the descriptor corresponding to the relevant file). 

I now have a backtrace to point to, and it does seem that something is causing 
that invalid call to be made. My question is: what can I do to figure out 
what's triggering it? 

---
Debugger entered--Lisp error: (void-function nil)
  nil((20 deleted "/Users/apc/org/agenda/work.org"))
  file-notify--call-handler(#s(file-notify--watch :directory 
"/Users/apc/org/agenda" :filename "work.org" :callback nil) 20 deleted 
"/Users/apc/org/agenda/work.org" nil)
  file-notify--handle-event(20 (renamed deleted) 
"/Users/apc/org/agenda/work.org" nil)
  file-notify--callback-kqueue((20 (rename delete) 
"/Users/apc/org/agenda/work.org"))
  file-notify-handle-event((file-notify (20 (rename delete) 
"/Users/apc/org/agenda/work.org") file-notify--callback-kqueue))
  funcall-interactively(file-notify-handle-event (file-notify (20 (rename 
delete) "/Users/apc/org/agenda/work.org") file-notify--callback-kqueue))
  call-interactively(file-notify-handle-event nil [(file-notify (20 (rename 
delete) "/Users/apc/org/agenda/work.org") file-notify--callback-kqueue)])
  command-execute(file-notify-handle-event nil [(file-notify (20 (rename 
delete) "/Users/apc/org/agenda/work.org") file-notify--callback-kqueue)] t)
---

Thanks in advance, 

A.


reply via email to

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