diff options
Diffstat (limited to 'lisp/filenotify.el')
-rw-r--r-- | lisp/filenotify.el | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lisp/filenotify.el b/lisp/filenotify.el index 986dc093bc9..5d37f39a70b 100644 --- a/lisp/filenotify.el +++ b/lisp/filenotify.el @@ -307,12 +307,12 @@ FILE is the name of the file whose event is being reported." (unless (functionp callback) (signal 'wrong-type-argument `(,callback))) - (let* ((handler (find-file-name-handler file 'file-notify-add-watch)) - (dir (directory-file-name - (if (file-directory-p file) - file - (file-name-directory file)))) - desc func l-flags) + (let ((handler (find-file-name-handler file 'file-notify-add-watch)) + (dir (directory-file-name + (if (file-directory-p file) + file + (file-name-directory file)))) + desc func l-flags) (unless (file-directory-p dir) (signal 'file-notify-error `("Directory does not exist" ,dir))) @@ -363,6 +363,10 @@ FILE is the name of the file whose event is being reported." func (if (eq file-notify--library 'kqueue) file dir) l-flags 'file-notify-callback))) + ;; We do not want to enter quoted file names into the hash. + (setq file (file-name-unquote file) + dir (file-name-unquote dir)) + ;; Modify `file-notify-descriptors'. (let ((watch (file-notify--watch-make dir |