Closed
Description
Steps to reproduce:
- I compiled Emacs at git revision 6a9f1b504a5a3c096afd17f3b8f8ebeca6a03ed5
- Then I started
emacs -q ~/repro-emacs/hello1
(a directory) - (Only relevant for diagnosis) I switched to the scratch buffer and evaluated the following LISP code:
(defun my-file-notify-add-watch-logger (file event &rest args) "log a message whenever file-notify-add-watch is called" (message "file-notify-add-watch called with file: %s, event: %s" file event)) (advice-add 'file-notify-add-watch :before #'my-file-notify-add-watch-logger)
- Open
hello1.go
M-x eglot
gopls
RET
- In a terminal, I run
touch extra.go
and I see adidChangeWatchedFiles
event in the*EGLOT …*
buffer — good! - In a terminal, I run
mkdir newinternal
, thentouch newinternal/extra.go
and I see no event — this is unexpected. - In the
*Messages*
buffer, I see:
file-notify-add-watch called with file: /home/stapelberg/repro-emacs/hello1/, event: (change)
file-notify-add-watch called with file: /home/stapelberg/repro-emacs/hello1/internal/, event: (change)
- Notably, when creating the
newinternal
directory from my terminal, I see nofile-notify-add-watch
. I conclude that Eglot does not re-evaluate recursive glob patterns when new directories are created.- The Emacs “File Notifications” documentation states:
If file is a directory, change watches for file creation and deletion in that directory. Some of the native file notification libraries also report file changes in that case. This does not work recursively.
- …which I think is the reason why Eglot expands recursive glob patterns to directories in the first place.
- The Emacs “File Notifications” documentation states:
Metadata
Metadata
Assignees
Labels
No labels