aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Politz2017-03-26 11:41:12 +0200
committerMichael Albinus2017-03-26 11:41:12 +0200
commit082e2cb3f40b717e4c00d31532927c9693b7cb9b (patch)
tree1253ac29628da55e1c4e5f8533f67d22efb2e88d
parent74129db63d690747c008b1b5d442fe41056584c3 (diff)
downloademacs-082e2cb3f40b717e4c00d31532927c9693b7cb9b.tar.gz
emacs-082e2cb3f40b717e4c00d31532927c9693b7cb9b.zip
Minor fixes for inotify.c and filenotify.el
* lisp/filenotify.el (file-notify--watch-absolute-filename): Add docstring. (file-notify-callback): Simplify. * src/inotify.c (Finotify_add_watch): Adapt docstring.
-rw-r--r--lisp/filenotify.el6
-rw-r--r--src/inotify.c14
2 files changed, 13 insertions, 7 deletions
diff --git a/lisp/filenotify.el b/lisp/filenotify.el
index 55ce94a1cad..c3d7d7223a7 100644
--- a/lisp/filenotify.el
+++ b/lisp/filenotify.el
@@ -52,6 +52,7 @@ could use another implementation.")
52 callback) 52 callback)
53 53
54(defun file-notify--watch-absolute-filename (watch) 54(defun file-notify--watch-absolute-filename (watch)
55 "Return the absolute filename observed by WATCH."
55 (if (file-notify--watch-filename watch) 56 (if (file-notify--watch-filename watch)
56 (expand-file-name 57 (expand-file-name
57 (file-notify--watch-filename watch) 58 (file-notify--watch-filename watch)
@@ -204,7 +205,7 @@ EVENT is the cadr of the event in `file-notify-handle-event'
204 (car file-notify--pending-event))) 205 (car file-notify--pending-event)))
205 ;; If the source is handled by another watch, we 206 ;; If the source is handled by another watch, we
206 ;; must fire the rename event there as well. 207 ;; must fire the rename event there as well.
207 (when (not (equal desc (caar file-notify--pending-event))) 208 (unless (equal desc (caar file-notify--pending-event))
208 (setq pending-event 209 (setq pending-event
209 `((,(caar file-notify--pending-event) 210 `((,(caar file-notify--pending-event)
210 renamed ,file ,file1) 211 renamed ,file ,file1)
@@ -214,9 +215,6 @@ EVENT is the cadr of the event in `file-notify-handle-event'
214 215
215 ;; Apply pending callback. 216 ;; Apply pending callback.
216 (when pending-event 217 (when pending-event
217 (setcar
218 (car pending-event)
219 (caar pending-event))
220 (funcall (cadr pending-event) (car pending-event)) 218 (funcall (cadr pending-event) (car pending-event))
221 (setq pending-event nil)) 219 (setq pending-event nil))
222 220
diff --git a/src/inotify.c b/src/inotify.c
index 470b60ba893..cb24e827626 100644
--- a/src/inotify.c
+++ b/src/inotify.c
@@ -382,9 +382,17 @@ If a directory is watched then NAME is the name of file that caused the event.
382COOKIE is an object that can be compared using `equal' to identify two matching 382COOKIE is an object that can be compared using `equal' to identify two matching
383renames (moved-from and moved-to). 383renames (moved-from and moved-to).
384 384
385See inotify(7) and inotify_add_watch(2) for further information. The inotify fd 385See inotify(7) and inotify_add_watch(2) for further information. The
386is managed internally and there is no corresponding inotify_init. Use 386inotify fd is managed internally and there is no corresponding
387`inotify-rm-watch' to remove a watch. */) 387inotify_init. Use `inotify-rm-watch' to remove a watch.
388
389Also note, that the following inotify bit-masks can not be used, due
390to the fact that descriptors are shared across different callers.
391
392IN_EXCL_UNLINK
393IN_MASK_ADD
394IN_ONESHOT
395IN_ONLYDIR */)
388 (Lisp_Object filename, Lisp_Object aspect, Lisp_Object callback) 396 (Lisp_Object filename, Lisp_Object aspect, Lisp_Object callback)
389{ 397{
390 Lisp_Object encoded_file_name; 398 Lisp_Object encoded_file_name;