(progress-reporter-done ,temp2)
nil ,@(cdr (cdr spec)))))
- "Handle file system monitoring event.
-If EVENT is a filewatch event then the callback is called. If EVENT is
-not a filewatch event then a `filewatch-error' is signaled."
+ \f
+ ;;;; Support for watching filesystem events.
+
+ (defun inotify-event-p (event)
+ "Check if EVENT is an inotify event."
+ (and (listp event)
+ (>= (length event) 3)
+ (eq (car event) 'file-inotify)))
+
+ ;;;###autoload
+ (defun inotify-handle-event (event)
-
++ "Handle inotify file system monitoring event.
++If EVENT is an inotify filewatch event, call its callback.
++Otherwise, signal a `filewatch-error'."
+ (interactive "e")
+ (unless (inotify-event-p event)
+ (signal 'filewatch-error (cons "Not a valid inotify event" event)))
+ (funcall (nth 2 event) (nth 1 event)))
+
++(defun w32notify-handle-event (event)
++ "Handle MS-Windows file system monitoring event.
++If EVENT is an MS-Windows filewatch event, call its callback.
++Otherwise, signal a `filewatch-error'."
++ (interactive "e")
++ (if (and (eq (car event) 'file-w32notify)
++ (= (length event) 3))
++ (funcall (nth 2 event) (nth 1 event))
++ (signal 'filewatch-error
++ (cons "Not a valid MS-Windows file-notify event" event))))
++
\f
;;;; Comparing version strings.
Lisp_Object Qmouse_click;
#ifdef HAVE_NTGUI
Lisp_Object Qlanguage_change;
- Lisp_Object Qfile_notify;
+#ifdef WINDOWSNT
++Lisp_Object Qfile_w32notify;
+#endif
#endif
static Lisp_Object Qdrag_n_drop;
static Lisp_Object Qsave_session;
make_number (event->modifiers)));
kbd_fetch_ptr = event + 1;
}
- obj = Fcons (Qfile_notify,
+ else if (event->kind == FILE_NOTIFY_EVENT)
+ {
+ /* Make an event (file-notify (DESCRIPTOR ACTION FILE) CALLBACK). */
++ obj = Fcons (Qfile_w32notify,
+ list2 (list3 (make_number (event->code),
+ XCAR (event->arg),
+ XCDR (event->arg)),
+ event->frame_or_window));
+ kbd_fetch_ptr = event + 1;
+ }
#endif
else if (event->kind == SAVE_SESSION_EVENT)
{
#ifdef HAVE_NTGUI
DEFSYM (Qlanguage_change, "language-change");
- DEFSYM (Qfile_notify, "file-notify");
++ DEFSYM (Qfile_w32notify, "file-w32notify");
#endif
#ifdef HAVE_DBUS
#if defined (WINDOWSNT)
initial_define_lispy_key (Vspecial_event_map, "language-change",
"ignore");
- initial_define_lispy_key (Vspecial_event_map, "file-notify",
++ initial_define_lispy_key (Vspecial_event_map, "file-w32notify",
+ "w32notify-handle-event");
#endif
}
extern Lisp_Object Qfont_param;
#endif
+#ifdef WINDOWSNT
+/* Defined on w32notify.c. */
+extern void syms_of_w32notify (void);
+#endif
+
+ /* Defined in inotify.c */
+ #ifdef HAVE_INOTIFY
+ extern void syms_of_inotify (void);
+ #endif
+
/* Defined in xfaces.c. */
extern Lisp_Object Qdefault, Qtool_bar, Qfringe;
extern Lisp_Object Qheader_line, Qscroll_bar, Qcursor;