From: Eli Zaretskii Date: Sun, 7 Oct 2012 12:34:33 +0000 (+0200) Subject: After fixing several bugs, the code works now for watching a single directory. X-Git-Tag: emacs-24.3.90~173^2~7^2~679 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ae7565592486ecb484970e7cfaba508f047e7e03;p=emacs.git After fixing several bugs, the code works now for watching a single directory. Need to remove debug code. Also need to add w32notify.c. --- diff --git a/src/keyboard.c b/src/keyboard.c index 6597ebd884b..ad0c5db0fc3 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -3961,9 +3961,9 @@ kbd_buffer_get_event (KBOARD **kbp, { /* Make an event (file-notify (DESCRIPTOR ACTION FILE) CALLBACK). */ obj = Fcons (Qfile_notify, - list2 (list3 (event->code, + list2 (list3 (make_number (event->code), XCAR (event->arg), - CAR_SAFE (XCDR (event->arg))), + XCDR (event->arg)), event->frame_or_window)); kbd_fetch_ptr = event + 1; } @@ -12179,7 +12179,7 @@ keys_of_keyboard (void) initial_define_lispy_key (Vspecial_event_map, "language-change", "ignore"); initial_define_lispy_key (Vspecial_event_map, "file-notify", - "w32notify-handlde-event"); + "w32notify-handle-event"); #endif } diff --git a/src/w32fns.c b/src/w32fns.c index 6d5d6822354..2d36da3b56b 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -2259,6 +2259,8 @@ w32_msg_pump (deferred_msg * msg_buf) while ((w32_unicode_gui ? GetMessageW : GetMessageA) (&msg, NULL, 0, 0)) { + if (msg.message == WM_EMACS_FILENOTIFY) + DebPrint (("w32_msg_pump: File notification, hwnd = 0x%p\n", msg.hwnd)); if (msg.hwnd == NULL) { switch (msg.message) @@ -3807,6 +3809,10 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) return retval; } + case WM_EMACS_FILENOTIFY: + DebPrint (("w32_wnd_proc: File notification arrived, posting\n")); + my_post_msg (&wmsg, hwnd, msg, wParam, lParam); + return 1; default: /* Check for messages registered at runtime. */ diff --git a/src/w32term.c b/src/w32term.c index 951ce9ef2df..1c32383098f 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -4945,6 +4945,7 @@ w32_read_socket (struct terminal *terminal, break; case WM_EMACS_FILENOTIFY: + DebPrint (("w32_read_socket: File notification arrived\n")); f = x_window_to_frame (dpyinfo, msg.msg.hwnd); if (f) queue_notifications (&inev, &msg, f, &count);