aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorMichael Albinus2015-10-31 14:42:16 +0100
committerMichael Albinus2015-10-31 14:42:16 +0100
commit547a23469a20b7fa90c9a3554b8f7fb58fe100ab (patch)
tree006191be6121c65294b3fae033c4e394c165c422 /lisp
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'.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/filenotify.el12
1 files changed, 7 insertions, 5 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)