summaryrefslogtreecommitdiff
path: root/lisp/filenotify.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2015-09-23 21:21:49 +0200
committerMichael Albinus <michael.albinus@gmx.de>2015-09-23 21:21:49 +0200
commit8c3c506aa52b96bac8a24ebfd81f403fcfe0228d (patch)
treee4cc7c410a8ca0b6101c2118b1c79a4a8f3652c9 /lisp/filenotify.el
parentcad8aef3241efa0873fb0c003b563cf31a4c0f2e (diff)
downloademacs-8c3c506aa52b96bac8a24ebfd81f403fcfe0228d.tar.gz
emacs-8c3c506aa52b96bac8a24ebfd81f403fcfe0228d.tar.bz2
emacs-8c3c506aa52b96bac8a24ebfd81f403fcfe0228d.zip
; Fix thinko in last commit of filenotify.el
Diffstat (limited to 'lisp/filenotify.el')
-rw-r--r--lisp/filenotify.el33
1 files changed, 17 insertions, 16 deletions
diff --git a/lisp/filenotify.el b/lisp/filenotify.el
index d48d3f94bc6..a07f99adcbf 100644
--- a/lisp/filenotify.el
+++ b/lisp/filenotify.el
@@ -327,30 +327,31 @@ DESCRIPTOR should be an object returned by `file-notify-add-watch'."
(let* ((desc (if (consp descriptor) (car descriptor) descriptor))
(file (if (consp descriptor) (cdr descriptor)))
(dir (car (gethash desc file-notify-descriptors)))
- handler registered)
+ (handler (and (stringp dir)
+ (find-file-name-handler dir 'file-notify-rm-watch)))
+ (registered (gethash desc file-notify-descriptors)))
(when (stringp dir)
;; Call low-level function.
- (setq handler (find-file-name-handler dir 'file-notify-rm-watch))
- (condition-case nil
- (if handler
- ;; A file name handler could exist even if there is no
- ;; local file notification support.
- (funcall handler 'file-notify-rm-watch desc)
-
- (funcall
- (cond
- ((eq file-notify--library 'gfilenotify) 'gfile-rm-watch)
- ((eq file-notify--library 'inotify) 'inotify-rm-watch)
- ((eq file-notify--library 'w32notify) 'w32notify-rm-watch))
- desc))
- (file-notify-error nil))
+ (when (null (cdr registered))
+ (condition-case nil
+ (if handler
+ ;; A file name handler could exist even if there is no local
+ ;; file notification support.
+ (funcall handler 'file-notify-rm-watch desc)
+
+ (funcall
+ (cond
+ ((eq file-notify--library 'gfilenotify) 'gfile-rm-watch)
+ ((eq file-notify--library 'inotify) 'inotify-rm-watch)
+ ((eq file-notify--library 'w32notify) 'w32notify-rm-watch))
+ desc))
+ (file-notify-error nil)))
;; Modify `file-notify-descriptors'.
(if (not file)
(remhash desc file-notify-descriptors)
- (setq registered (gethash desc file-notify-descriptors))
(setcdr registered
(delete (assoc file (cdr registered)) (cdr registered)))
(if (null (cdr registered))