aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2015-10-31 14:42:16 +0100
committerMichael Albinus2015-10-31 14:42:16 +0100
commit547a23469a20b7fa90c9a3554b8f7fb58fe100ab (patch)
tree006191be6121c65294b3fae033c4e394c165c422
parentb059c6b584e964296d425667642650f42972c238 (diff)
downloademacs-547a23469a20b7fa90c9a3554b8f7fb58fe100ab.tar.gz
emacs-547a23469a20b7fa90c9a3554b8f7fb58fe100ab.zip
Minor fix in filenotify.el
* lisp/filenotify.el (file-notify--event-file-name) (file-notify--event-file1-name): Normalize result with `directory-file-name'.
-rw-r--r--lisp/filenotify.el12
-rw-r--r--test/automated/file-notify-tests.el2
2 files changed, 8 insertions, 6 deletions
diff --git a/lisp/filenotify.el b/lisp/filenotify.el
index 6a180a86570..132f1644f8f 100644
--- a/lisp/filenotify.el
+++ b/lisp/filenotify.el
@@ -100,17 +100,19 @@ It is a form ((DESCRIPTOR ACTION FILE [FILE1-OR-COOKIE]) CALLBACK).")
100 100
101(defun file-notify--event-file-name (event) 101(defun file-notify--event-file-name (event)
102 "Return file name of file notification event, or nil." 102 "Return file name of file notification event, or nil."
103 (expand-file-name 103 (directory-file-name
104 (or (and (stringp (nth 2 event)) (nth 2 event)) "") 104 (expand-file-name
105 (car (gethash (car event) file-notify-descriptors)))) 105 (or (and (stringp (nth 2 event)) (nth 2 event)) "")
106 (car (gethash (car event) file-notify-descriptors)))))
106 107
107;; Only `gfilenotify' could return two file names. 108;; Only `gfilenotify' could return two file names.
108(defun file-notify--event-file1-name (event) 109(defun file-notify--event-file1-name (event)
109 "Return second file name of file notification event, or nil. 110 "Return second file name of file notification event, or nil.
110This is available in case a file has been moved." 111This is available in case a file has been moved."
111 (and (stringp (nth 3 event)) 112 (and (stringp (nth 3 event))
112 (expand-file-name 113 (directory-file-name
113 (nth 3 event) (car (gethash (car event) file-notify-descriptors))))) 114 (expand-file-name
115 (nth 3 event) (car (gethash (car event) file-notify-descriptors))))))
114 116
115;; Cookies are offered by `inotify' only. 117;; Cookies are offered by `inotify' only.
116(defun file-notify--event-cookie (event) 118(defun file-notify--event-cookie (event)
diff --git a/test/automated/file-notify-tests.el b/test/automated/file-notify-tests.el
index 222bdc52928..d848f4b9c65 100644
--- a/test/automated/file-notify-tests.el
+++ b/test/automated/file-notify-tests.el
@@ -623,7 +623,7 @@ Don't wait longer than TIMEOUT seconds for the events to be delivered."
623 623
624;; TODO: 624;; TODO:
625 625
626;; * It does not work yet for local gfilenotify and remote inotifywait. 626;; * It does not work yet for local gfilenotify.
627;; * For w32notify, no stopped events arrive when a directory is removed. 627;; * For w32notify, no stopped events arrive when a directory is removed.
628 628
629(provide 'file-notify-tests) 629(provide 'file-notify-tests)