emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 547a234 1/2: Minor fix in filenotify.el


From: Michael Albinus
Subject: [Emacs-diffs] master 547a234 1/2: Minor fix in filenotify.el
Date: Sat, 31 Oct 2015 13:43:06 +0000

branch: master
commit 547a23469a20b7fa90c9a3554b8f7fb58fe100ab
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    Minor fix in filenotify.el
    
    * lisp/filenotify.el (file-notify--event-file-name)
    (file-notify--event-file1-name): Normalize result with
    `directory-file-name'.
---
 lisp/filenotify.el                  |   12 +++++++-----
 test/automated/file-notify-tests.el |    2 +-
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/lisp/filenotify.el b/lisp/filenotify.el
index 6a180a8..132f164 100644
--- a/lisp/filenotify.el
+++ b/lisp/filenotify.el
@@ -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)
diff --git a/test/automated/file-notify-tests.el 
b/test/automated/file-notify-tests.el
index 222bdc5..d848f4b 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."
 
 ;; 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]