Function: file-notify-callback

file-notify-callback is a byte-compiled function defined in filenotify.el.gz.

Signature

(file-notify-callback (DESC ACTIONS FILE &optional FILE1-OR-COOKIE))

Documentation

Notification callback for file name handlers.

Source Code

;; Defined in /usr/src/emacs/lisp/filenotify.el.gz
(cl-defun file-notify-callback ((desc actions file &optional file1-or-cookie))
  "Notification callback for file name handlers."
  (file-notify--handle-event
   desc
   ;; File name handlers use gfilenotify or inotify actions.
   (delq nil (mapcar
              (lambda (action)
                (cond
                 ;; gfilenotify actions:
                 ((memq action '(created changed attribute-changed deleted))
                  action)
                 ((eq action 'moved) 'renamed)
                 ((eq action 'unmounted) 'stopped)
                 ;; inotify actions:
                 ((eq action 'create) 'created)
                 ((eq action 'modify) 'changed)
                 ((eq action 'attrib) 'attribute-changed)
                 ((memq action '(delete delete-self move-self)) 'deleted)
                 ((eq action 'moved-from) 'renamed-from)
                 ((eq action 'moved-to) 'renamed-to)
                 ((memq action '(ignored unmount)) 'stopped)))
              (if (consp actions) actions (list actions))))
   file file1-or-cookie))