aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/filenotify.el21
1 files changed, 9 insertions, 12 deletions
diff --git a/lisp/filenotify.el b/lisp/filenotify.el
index f7c97569825..23029427760 100644
--- a/lisp/filenotify.el
+++ b/lisp/filenotify.el
@@ -189,7 +189,7 @@ EVENT is the cadr of the event in `file-notify-handle-event'
189 ((memq action 189 ((memq action
190 '(attribute-changed changed created deleted renamed)) 190 '(attribute-changed changed created deleted renamed))
191 action) 191 action)
192 ((eq action 'moved) 192 ((memq action '(moved rename))
193 (setq file1 (file-notify--event-file1-name event)) 193 (setq file1 (file-notify--event-file1-name event))
194 'renamed) 194 'renamed)
195 ((eq action 'ignored) 195 ((eq action 'ignored)
@@ -329,7 +329,7 @@ FILE is the name of the file whose event is being reported."
329 (if (file-directory-p file) 329 (if (file-directory-p file)
330 file 330 file
331 (file-name-directory file)))) 331 (file-name-directory file))))
332 desc func l-flags registered) 332 desc func l-flags registered entry)
333 333
334 (unless (file-directory-p dir) 334 (unless (file-directory-p dir)
335 (signal 'file-notify-error `("Directory does not exist" ,dir))) 335 (signal 'file-notify-error `("Directory does not exist" ,dir)))
@@ -378,18 +378,15 @@ FILE is the name of the file whose event is being reported."
378 (setq desc (funcall func dir l-flags 'file-notify-callback))) 378 (setq desc (funcall func dir l-flags 'file-notify-callback)))
379 379
380 ;; Modify `file-notify-descriptors'. 380 ;; Modify `file-notify-descriptors'.
381 (setq registered (gethash desc file-notify-descriptors)) 381 (setq file (unless (file-directory-p file) (file-name-nondirectory file))
382 (puthash 382 desc (file-notify--descriptor desc file)
383 desc 383 registered (gethash desc file-notify-descriptors)
384 `(,dir 384 entry `(,file . ,callback))
385 (,(unless (file-directory-p file) (file-name-nondirectory file)) 385 (unless (member entry (cdr registered))
386 . ,callback) 386 (puthash desc `(,dir ,entry . ,(cdr registered)) file-notify-descriptors))
387 . ,(cdr registered))
388 file-notify-descriptors)
389 387
390 ;; Return descriptor. 388 ;; Return descriptor.
391 (file-notify--descriptor 389 desc))
392 desc (unless (file-directory-p file) (file-name-nondirectory file)))))
393 390
394(defun file-notify-rm-watch (descriptor) 391(defun file-notify-rm-watch (descriptor)
395 "Remove an existing watch specified by its DESCRIPTOR. 392 "Remove an existing watch specified by its DESCRIPTOR.