]> code.delx.au - gnu-emacs/commitdiff
Minor fix in filenotify.el
authorMichael Albinus <michael.albinus@gmx.de>
Sat, 31 Oct 2015 13:42:16 +0000 (14:42 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Sat, 31 Oct 2015 13:42:16 +0000 (14:42 +0100)
* lisp/filenotify.el (file-notify--event-file-name)
(file-notify--event-file1-name): Normalize result with
`directory-file-name'.

lisp/filenotify.el
test/automated/file-notify-tests.el

index 6a180a86570bc0318c9c40d65a86934d0af639d7..132f1644f8fc1c832603cf47607b3839d880ca51 100644 (file)
@@ -100,17 +100,19 @@ It is a form ((DESCRIPTOR ACTION FILE [FILE1-OR-COOKIE]) CALLBACK).")
 
 (defun file-notify--event-file-name (event)
   "Return file name of file notification event, or nil."
-  (expand-file-name
-   (or  (and (stringp (nth 2 event)) (nth 2 event)) "")
-   (car (gethash (car event) file-notify-descriptors))))
+  (directory-file-name
+   (expand-file-name
+    (or  (and (stringp (nth 2 event)) (nth 2 event)) "")
+    (car (gethash (car event) file-notify-descriptors)))))
 
 ;; Only `gfilenotify' could return two file names.
 (defun file-notify--event-file1-name (event)
   "Return second file name of file notification event, or nil.
 This is available in case a file has been moved."
   (and (stringp (nth 3 event))
-       (expand-file-name
-       (nth 3 event) (car (gethash (car event) file-notify-descriptors)))))
+       (directory-file-name
+        (expand-file-name
+         (nth 3 event) (car (gethash (car event) file-notify-descriptors))))))
 
 ;; Cookies are offered by `inotify' only.
 (defun file-notify--event-cookie (event)
index 222bdc529286223aebd44a3746d96bf5327eeb0a..d848f4b9c652da9cf3d1959cf81b09400cf797a8 100644 (file)
@@ -623,7 +623,7 @@ Don't wait longer than TIMEOUT seconds for the events to be delivered."
 
 ;; TODO:
 
-;; * It does not work yet for local gfilenotify and remote inotifywait.
+;; * It does not work yet for local gfilenotify.
 ;; * For w32notify, no stopped events arrive when a directory is removed.
 
 (provide 'file-notify-tests)