From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: michael.cadilhac@lrde.org (=?iso-8859-1?Q?Micha=EBl?= Cadilhac) Newsgroups: gmane.emacs.devel Subject: The order input events are processed. Date: Thu, 07 Sep 2006 13:21:18 +0200 Organization: Epita/LRDE Message-ID: <87odtrrkgh.fsf@lrde.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0800831684==" X-Trace: sea.gmane.org 1157628104 27945 80.91.229.2 (7 Sep 2006 11:21:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 7 Sep 2006 11:21:44 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 07 13:21:40 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GLHws-0007GT-DS for ged-emacs-devel@m.gmane.org; Thu, 07 Sep 2006 13:21:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GLHwr-0007kI-OE for ged-emacs-devel@m.gmane.org; Thu, 07 Sep 2006 07:21:33 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GLHwd-0007jV-Ep for emacs-devel@gnu.org; Thu, 07 Sep 2006 07:21:19 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GLHwc-0007hP-0x for emacs-devel@gnu.org; Thu, 07 Sep 2006 07:21:19 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GLHwb-0007hE-QG for emacs-devel@gnu.org; Thu, 07 Sep 2006 07:21:17 -0400 Original-Received: from [62.39.139.2] (helo=kualalumpur.lrde.epita.fr) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GLHwx-0000kZ-JM for emacs-devel@gnu.org; Thu, 07 Sep 2006 07:21:40 -0400 Original-Received: from mahaena.lrde.epita.fr ([192.168.101.66] helo=mahaena.lrde) by kualalumpur.lrde.epita.fr with esmtp (Exim 4.50) id 1GLHwZ-0001Yt-Ai for emacs-devel@gnu.org; Thu, 07 Sep 2006 13:21:15 +0200 Original-To: emacs-devel@gnu.org Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEVWPh+Tai+5r5YKBAEU CQQzGAtiq7gjAAACR0lEQVQ4jW2UzW7lIAyFzVW8BzTZX5DmCZLuU2H2pMXv/ypzbK7aSh2kRCRf /HNsE0q7Sg+RQ7JFKaqtrRNAl5AIIKe6D5DBqgbmUAe5hBI1wIRFAHjeM0RKtZi7XVVEpb0BSNfA IddChChT5DildSLWOWhY5IEItMnncZgFcUAc/5jjwCMsDosRNdfKPDTFEdVBW8C+RebDb4N5Orio RhM1+11IJyx0ng2+LryFHBMPDQDYHrY6IfGuU3ouiXTQNE8LIJDKOWpNxERTFrggQwRPd7USUsTW fJ0XbR3bdj5KgBYy4SACpxDeUYEUAzLmtJ1iIrD2gczPq8Qomjhsh/RjGIgKIO8p7NITjwlx7WID nsnQe5NeuTvoBpi8LX6vLLOh5icjOHqBypgnuSp7M+RE1agbQKHQr5E2z1WObhYW4gMqeGQL7joM jCf2DxSk5ApADSYHfFF4igNfJZL1z0GKP0FN02s4XiDXr7V5P94W6I9v8MfBOQDmfwAaVYt+x8Da v4DJvX8BAdin3Knm5yMZYAO4ABDkDniZLLfi4P40gP1F0TPGZOu0CGwA1lcowxwlGy6A9705mD0V jHCxwVZT/hYdRJVUGZNlx6l7ScQBTluof6Wj6bsPYlvpwoTvXFD9gHPn2TZPF3ntI2ecxVrW5MrV XiCie5EeNa7BlWu/HNSkprDUva163PHxAv5jyGV7gVzyAghSKOTnat85UIYFICXbD2NV9rRiv0BS tKQsg6OHH4A15F1WW+UHKHHa32h6aPnAm3/pUcWp+WYnTQAAAABJRU5ErkJggg== User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:59503 Archived-At: --===============0800831684== Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Try the following: (setq unread-post-input-method-events '(?a ?b ?c)) (sit-for 0.1) (Note: This is not a test for the test, this is an actual problem with input methods and sit-for) It will result in the unexpected behavior that events are processed as =AB bca =BB. IIUC, this is how it happens : =2D Sit-for takes the `a' with its `read-event' =2D Sit-for stores it back in `unread-command-events' _and it seems normal_: I think that users are expected to use that var, especially because the docstring says this is the FIRST input var processed. =2D read_char is made three times: for the two first times it will take events from post-input, then for the third, from unread-command-events, because post-input is processed BEFORE unread-command-events.=20 I think Handa's changes 2006-08-21 (fixing the docstring of post-input that indicated that it was processed AFTER unread-command-events, whilst it was the contrary) wasn't the good one. I propose to revert the docstring and make the code respect both this one and unread-command-events' one. --=-=-= Content-Type: text/x-patch; charset=iso-8859-1 Content-Disposition: inline; filename=keyboard.patch Content-Transfer-Encoding: quoted-printable Index: src/keyboard.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/emacs/emacs/src/keyboard.c,v retrieving revision 1.874 diff -c -r1.874 keyboard.c *** src/keyboard.c 27 Aug 2006 07:09:06 -0000 1.874 =2D-- src/keyboard.c 7 Sep 2006 11:19:24 -0000 *************** *** 2504,2526 **** retry: =20=20 reread =3D 0; =2D if (CONSP (Vunread_post_input_method_events)) =2D { =2D c =3D XCAR (Vunread_post_input_method_events); =2D Vunread_post_input_method_events =2D =3D XCDR (Vunread_post_input_method_events); =2D=20 =2D /* Undo what read_char_x_menu_prompt did when it unread =2D additional keys returned by Fx_popup_menu. */ =2D if (CONSP (c) =2D && (SYMBOLP (XCAR (c)) || INTEGERP (XCAR (c))) =2D && NILP (XCDR (c))) =2D c =3D XCAR (c); =2D=20 =2D reread =3D 1; =2D goto reread_first; =2D } =2D=20 if (unread_command_char !=3D -1) { XSETINT (c, unread_command_char); =2D-- 2504,2509 ---- *************** *** 2552,2557 **** =2D-- 2535,2557 ---- goto reread_for_input_method; } =20=20 + if (CONSP (Vunread_post_input_method_events)) + { + c =3D XCAR (Vunread_post_input_method_events); + Vunread_post_input_method_events + =3D XCDR (Vunread_post_input_method_events); +=20 + /* Undo what read_char_x_menu_prompt did when it unread + additional keys returned by Fx_popup_menu. */ + if (CONSP (c) + && (SYMBOLP (XCAR (c)) || INTEGERP (XCAR (c))) + && NILP (XCDR (c))) + c =3D XCAR (c); +=20 + reread =3D 1; + goto reread_first; + } +=20 if (CONSP (Vunread_input_method_events)) { c =3D XCAR (Vunread_input_method_events); *************** *** 11218,11225 **** =20=20 DEFVAR_LISP ("unread-post-input-method-events", &Vunread_post_input_met= hod_events, doc: /* List of events to be processed as input by input methods. ! These events are processed before `unread-command-events' ! and actual keyboard input without given to `input-method-function'. */); Vunread_post_input_method_events =3D Qnil; =20=20 DEFVAR_LISP ("unread-input-method-events", &Vunread_input_method_events, =2D-- 11218,11225 ---- =20=20 DEFVAR_LISP ("unread-post-input-method-events", &Vunread_post_input_met= hod_events, doc: /* List of events to be processed as input by input methods. ! These events are processed after `unread-command-events', but ! before actual keyboard input without given to `input-method-function'. *= /); Vunread_post_input_method_events =3D Qnil; =20=20 DEFVAR_LISP ("unread-input-method-events", &Vunread_input_method_events, Index: src/ChangeLog =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/emacs/emacs/src/ChangeLog,v retrieving revision 1.5270 diff -c -0 -r1.5270 ChangeLog *** src/ChangeLog 6 Sep 2006 17:53:59 -0000 1.5270 =2D-- src/ChangeLog 7 Sep 2006 11:19:34 -0000 *************** *** 0 **** =2D-- 1,6 ---- + 2006-09-07 Micha=EBl Cadilhac +=20 + * keyboard.c (read_char): Read Vunread_post_input_method_events + after Vunread_command_events. + (syms_of_keyboard): Document it in `unread-post-input-method-events'. +=20 --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Regards =2D-=20 | Micha=EBl `Micha' Cadilhac | Pour les 35-40 ans, l'humour = | | Epita/LRDE Promo 2007 | c'est une plus-value. = | | http://www.lrde.org/~cadilh_m | -- Guillaume L. = | `-- - JID: micha@amessage.be --' - -= -' --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFFAACwZYNf4qobZ7kRAnYfAJ481zIfNud0dxg/Wfz3+M9aLd005ACeLxpK 8FIsOf7BJ/Ey8mssRbuy52I= =qcEg -----END PGP SIGNATURE----- --==-=-=-- --===============0800831684== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --===============0800831684==--