aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/filenotify.el34
1 files changed, 16 insertions, 18 deletions
diff --git a/lisp/filenotify.el b/lisp/filenotify.el
index e2c0af0d1b7..d48d3f94bc6 100644
--- a/lisp/filenotify.el
+++ b/lisp/filenotify.el
@@ -291,7 +291,7 @@ FILE is the name of the file whose event is being reported."
291 291
292 ;; Determine respective flags. 292 ;; Determine respective flags.
293 (if (eq file-notify--library 'gfilenotify) 293 (if (eq file-notify--library 'gfilenotify)
294 (setq l-flags '(watch-mounts send-moved)) 294 (setq l-flags (append '(watch-mounts send-moved) flags))
295 (when (memq 'change flags) 295 (when (memq 'change flags)
296 (setq 296 (setq
297 l-flags 297 l-flags
@@ -330,7 +330,21 @@ DESCRIPTOR should be an object returned by `file-notify-add-watch'."
330 handler registered) 330 handler registered)
331 331
332 (when (stringp dir) 332 (when (stringp dir)
333 ;; Call low-level function.
333 (setq handler (find-file-name-handler dir 'file-notify-rm-watch)) 334 (setq handler (find-file-name-handler dir 'file-notify-rm-watch))
335 (condition-case nil
336 (if handler
337 ;; A file name handler could exist even if there is no
338 ;; local file notification support.
339 (funcall handler 'file-notify-rm-watch desc)
340
341 (funcall
342 (cond
343 ((eq file-notify--library 'gfilenotify) 'gfile-rm-watch)
344 ((eq file-notify--library 'inotify) 'inotify-rm-watch)
345 ((eq file-notify--library 'w32notify) 'w32notify-rm-watch))
346 desc))
347 (file-notify-error nil))
334 348
335 ;; Modify `file-notify-descriptors'. 349 ;; Modify `file-notify-descriptors'.
336 (if (not file) 350 (if (not file)
@@ -341,23 +355,7 @@ DESCRIPTOR should be an object returned by `file-notify-add-watch'."
341 (delete (assoc file (cdr registered)) (cdr registered))) 355 (delete (assoc file (cdr registered)) (cdr registered)))
342 (if (null (cdr registered)) 356 (if (null (cdr registered))
343 (remhash desc file-notify-descriptors) 357 (remhash desc file-notify-descriptors)
344 (puthash desc registered file-notify-descriptors))) 358 (puthash desc registered file-notify-descriptors))))))
345
346 ;; Call low-level function.
347 (when (null (cdr registered))
348 (condition-case nil
349 (if handler
350 ;; A file name handler could exist even if there is no local
351 ;; file notification support.
352 (funcall handler 'file-notify-rm-watch desc)
353
354 (funcall
355 (cond
356 ((eq file-notify--library 'gfilenotify) 'gfile-rm-watch)
357 ((eq file-notify--library 'inotify) 'inotify-rm-watch)
358 ((eq file-notify--library 'w32notify) 'w32notify-rm-watch))
359 desc))
360 (file-notify-error nil))))))
361 359
362(defun file-notify-valid-p (descriptor) 360(defun file-notify-valid-p (descriptor)
363 "Check a watch specified by its DESCRIPTOR. 361 "Check a watch specified by its DESCRIPTOR.