diff options
| author | Michael Albinus | 2025-06-11 19:20:43 +0200 |
|---|---|---|
| committer | Michael Albinus | 2025-06-11 19:20:43 +0200 |
| commit | 81a3e4e51167be51c63eae682331210bc62f7280 (patch) | |
| tree | 3b00835aa573e6f9db3788af9152a3310c02cc66 | |
| parent | 7e62c2cf3aadb52397bcff8439d00084cd36afa0 (diff) | |
| download | emacs-81a3e4e51167be51c63eae682331210bc62f7280.tar.gz emacs-81a3e4e51167be51c63eae682331210bc62f7280.zip | |
Make file-notify--call-handler more robust
* lisp/filenotify.el (file-notify--call-handler): Make it more
robust. (Bug#78712)
| -rw-r--r-- | lisp/filenotify.el | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/lisp/filenotify.el b/lisp/filenotify.el index 9acf7651df5..96c2c46d1df 100644 --- a/lisp/filenotify.el +++ b/lisp/filenotify.el | |||
| @@ -233,16 +233,18 @@ It is nil or a `file-notify--rename' defstruct where the cookie can be nil.") | |||
| 233 | (and (stringp file1) | 233 | (and (stringp file1) |
| 234 | (string-equal (file-notify--watch-filename watch) | 234 | (string-equal (file-notify--watch-filename watch) |
| 235 | (file-name-nondirectory file1)))) | 235 | (file-name-nondirectory file1)))) |
| 236 | (when file-notify-debug | 236 | ;; The callback could have removed in `file-notify--rm-descriptor'. |
| 237 | (message | 237 | (when (file-notify--watch-callback watch) |
| 238 | "file-notify-callback %S %S %S %S %S %S %S" | 238 | (when file-notify-debug |
| 239 | desc action file file1 watch | 239 | (message |
| 240 | (file-notify--watch-absolute-filename watch) | 240 | "file-notify-callback %S %S %S %S %S %S %S" |
| 241 | (file-notify--watch-directory watch))) | 241 | desc action file file1 watch |
| 242 | (funcall (file-notify--watch-callback watch) | 242 | (file-notify--watch-absolute-filename watch) |
| 243 | (if file1 | 243 | (file-notify--watch-directory watch))) |
| 244 | (list desc action file file1) | 244 | (funcall (file-notify--watch-callback watch) |
| 245 | (list desc action file))))) | 245 | (if file1 |
| 246 | (list desc action file file1) | ||
| 247 | (list desc action file)))))) | ||
| 246 | 248 | ||
| 247 | (defun file-notify--handle-event (desc actions file file1-or-cookie) | 249 | (defun file-notify--handle-event (desc actions file file1-or-cookie) |
| 248 | "Handle an event returned from file notification. | 250 | "Handle an event returned from file notification. |