emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r110422: Add a comment with overview


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110422: Add a comment with overview of how Emacs input works on MS-Windows.
Date: Sun, 07 Oct 2012 16:50:29 +0200
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110422
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Sun 2012-10-07 16:50:29 +0200
message:
  Add a comment with overview of how Emacs input works on MS-Windows.
modified:
  src/w32fns.c
  src/w32term.c
=== modified file 'src/w32fns.c'
--- a/src/w32fns.c      2012-09-30 21:36:42 +0000
+++ b/src/w32fns.c      2012-10-07 14:50:29 +0000
@@ -2246,6 +2246,27 @@
     }
 }
 
+/* Here's an overview of how Emacs input works on MS-Windows.
+
+   System messages are read and processed by w32_msg_pump below.  This
+   function runs in a separate thread.  It handles a small number of
+   custom WM_EMACS_* messages (posted by the main thread, look for
+   PostMessage calls), and dispatches the rest to w32_wnd_proc, which
+   is the main window procedure for the entire Emacs application.
+
+   w32_wnd_proc also runs in the same separate input thread.  It
+   handles some messages, mostly those that need GDI calls, by itself.
+   For the others, it calls my_post_msg, which inserts the messages
+   into the input queue serviced by w32_read_socket.
+
+   w32_read_socket runs in the main (a.k.a. "Lisp") thread, and is
+   called synchronously from keyboard.c when it is known or suspected
+   that some input is available.  w32_read_socket either handles
+   messages immediately, or converts them messages into Emacs input
+   events and stuffs them into kbd_buffer, where kbd_buffer_get_event
+   can get at them and process them when read_char and its callers
+   require input.  */
+
 /* Main message dispatch loop. */
 
 static void

=== modified file 'src/w32term.c'
--- a/src/w32term.c     2012-09-30 21:36:42 +0000
+++ b/src/w32term.c     2012-10-07 14:50:29 +0000
@@ -4138,6 +4138,9 @@
    This routine is called by the SIGIO handler.
    We return as soon as there are no more events to be read.
 
+   For an overview of how Emacs input works on MS-Windows, see the
+   commentary before w32_msg_pump in w32fns.c.
+
    We return the number of characters stored into the buffer,
    thus pretending to be `read'.
 


reply via email to

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