emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 082e2cb: Minor fixes for inotify.c and filenotify.e


From: Michael Albinus
Subject: [Emacs-diffs] master 082e2cb: Minor fixes for inotify.c and filenotify.el
Date: Sun, 26 Mar 2017 05:41:32 -0400 (EDT)

branch: master
commit 082e2cb3f40b717e4c00d31532927c9693b7cb9b
Author: Andreas Politz <address@hidden>
Commit: Michael Albinus <address@hidden>

    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.
---
 lisp/filenotify.el |  6 ++----
 src/inotify.c      | 14 +++++++++++---
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/lisp/filenotify.el b/lisp/filenotify.el
index 55ce94a..c3d7d72 100644
--- a/lisp/filenotify.el
+++ b/lisp/filenotify.el
@@ -52,6 +52,7 @@ could use another implementation.")
   callback)
 
 (defun file-notify--watch-absolute-filename (watch)
+  "Return the absolute filename observed by WATCH."
   (if (file-notify--watch-filename watch)
       (expand-file-name
        (file-notify--watch-filename watch)
@@ -204,7 +205,7 @@ EVENT is the cadr of the event in `file-notify-handle-event'
                                 (car file-notify--pending-event)))
                     ;; If the source is handled by another watch, we
                     ;; must fire the rename event there as well.
-                    (when (not (equal desc (caar file-notify--pending-event)))
+                    (unless (equal desc (caar file-notify--pending-event))
                       (setq pending-event
                             `((,(caar file-notify--pending-event)
                                renamed ,file ,file1)
@@ -214,9 +215,6 @@ EVENT is the cadr of the event in `file-notify-handle-event'
 
           ;; Apply pending callback.
           (when pending-event
-            (setcar
-             (car pending-event)
-             (caar pending-event))
             (funcall (cadr pending-event) (car pending-event))
             (setq pending-event nil))
 
diff --git a/src/inotify.c b/src/inotify.c
index 470b60b..cb24e82 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.
 COOKIE is an object that can be compared using `equal' to identify two matching
 renames (moved-from and moved-to).
 
-See inotify(7) and inotify_add_watch(2) for further information.  The inotify 
fd
-is managed internally and there is no corresponding inotify_init.  Use
-`inotify-rm-watch' to remove a watch.  */)
+See inotify(7) and inotify_add_watch(2) for further information.  The
+inotify fd is managed internally and there is no corresponding
+inotify_init.  Use `inotify-rm-watch' to remove a watch.
+
+Also note, that the following inotify bit-masks can not be used, due
+to the fact that descriptors are shared across different callers.
+
+IN_EXCL_UNLINK
+IN_MASK_ADD
+IN_ONESHOT
+IN_ONLYDIR  */)
      (Lisp_Object filename, Lisp_Object aspect, Lisp_Object callback)
 {
   Lisp_Object encoded_file_name;



reply via email to

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