From: michael.cadilhac@lrde.org (Michaël Cadilhac)
Subject: The order input events are processed.
Date: Thu, 07 Sep 2006 13:21:18 +0200 [thread overview]
Message-ID: <87odtrrkgh.fsf@lrde.org> (raw)
[-- Attachment #1.1.1: Type: text/plain, Size: 1087 bytes --]
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
« bca ». IIUC, this is how it happens :
- Sit-for takes the `a' with its `read-event'
- 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.
- 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.
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.
[-- Attachment #1.1.2: keyboard.patch --]
[-- Type: text/x-patch, Size: 3226 bytes --]
Index: src/keyboard.c
===================================================================
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
--- src/keyboard.c 7 Sep 2006 11:19:24 -0000
***************
*** 2504,2526 ****
retry:
reread = 0;
- if (CONSP (Vunread_post_input_method_events))
- {
- c = XCAR (Vunread_post_input_method_events);
- Vunread_post_input_method_events
- = XCDR (Vunread_post_input_method_events);
-
- /* 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 = XCAR (c);
-
- reread = 1;
- goto reread_first;
- }
-
if (unread_command_char != -1)
{
XSETINT (c, unread_command_char);
--- 2504,2509 ----
***************
*** 2552,2557 ****
--- 2535,2557 ----
goto reread_for_input_method;
}
+ if (CONSP (Vunread_post_input_method_events))
+ {
+ c = XCAR (Vunread_post_input_method_events);
+ Vunread_post_input_method_events
+ = XCDR (Vunread_post_input_method_events);
+
+ /* 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 = XCAR (c);
+
+ reread = 1;
+ goto reread_first;
+ }
+
if (CONSP (Vunread_input_method_events))
{
c = XCAR (Vunread_input_method_events);
***************
*** 11218,11225 ****
DEFVAR_LISP ("unread-post-input-method-events", &Vunread_post_input_method_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 = Qnil;
DEFVAR_LISP ("unread-input-method-events", &Vunread_input_method_events,
--- 11218,11225 ----
DEFVAR_LISP ("unread-post-input-method-events", &Vunread_post_input_method_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 = Qnil;
DEFVAR_LISP ("unread-input-method-events", &Vunread_input_method_events,
Index: src/ChangeLog
===================================================================
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
--- src/ChangeLog 7 Sep 2006 11:19:34 -0000
***************
*** 0 ****
--- 1,6 ----
+ 2006-09-07 Michaël Cadilhac <michael.cadilhac@lrde.org>
+
+ * 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'.
+
[-- Attachment #1.1.3: Type: text/plain, Size: 334 bytes --]
Regards
--
| Michaël `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 --' - --'
[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]
[-- Attachment #2: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel
next reply other threads:[~2006-09-07 11:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-07 11:21 Michaël Cadilhac [this message]
2006-09-09 20:45 ` The order input events are processed Richard Stallman
2006-09-10 9:08 ` Michaël Cadilhac
2006-09-10 13:05 ` Richard Stallman
2006-09-10 13:14 ` Michaël Cadilhac
2006-09-10 21:28 ` Kim F. Storm
2006-09-11 14:12 ` Richard Stallman
2006-09-11 14:17 ` Kim F. Storm
2006-09-11 14:11 ` Richard Stallman
2006-09-11 14:19 ` Kim F. Storm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87odtrrkgh.fsf@lrde.org \
--to=michael.cadilhac@lrde.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.