Make file-notify--call-handler more robust

* lisp/filenotify.el (file-notify--call-handler): Make it more
robust.  (Bug#78712)
This commit is contained in:
Michael Albinus 2025-06-11 19:20:43 +02:00
parent 7e62c2cf3a
commit 81a3e4e511

View file

@ -233,6 +233,8 @@ It is nil or a `file-notify--rename' defstruct where the cookie can be nil.")
(and (stringp file1)
(string-equal (file-notify--watch-filename watch)
(file-name-nondirectory file1))))
;; The callback could have removed in `file-notify--rm-descriptor'.
(when (file-notify--watch-callback watch)
(when file-notify-debug
(message
"file-notify-callback %S %S %S %S %S %S %S"
@ -242,7 +244,7 @@ It is nil or a `file-notify--rename' defstruct where the cookie can be nil.")
(funcall (file-notify--watch-callback watch)
(if file1
(list desc action file file1)
(list desc action file)))))
(list desc action file))))))
(defun file-notify--handle-event (desc actions file file1-or-cookie)
"Handle an event returned from file notification.