all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Chris Feng <chris.w.feng@gmail.com>
To: 23980@debbugs.gnu.org
Subject: bug#23980: 25.0.95; Events put in `unread-command-events' can be wrongly handled
Date: Thu, 14 Jul 2016 22:03:34 +0800	[thread overview]
Message-ID: <8660s871vt.fsf@gmail.com> (raw)


I encountered a bug in the command loop that when I put an event of the
form (t . EVENT) into `unread-command-events', there is a chance the
event won't get recognized with the message "<t> is undefined".
I did a bit research and found that in keyboard.c `read_char' calls
`read_decoded_event_from_main_queue' (which in turn calls
`read_event_from_main_queue' and `kbd_buffer_get_event') but does not
check if the returned event is from `Vunread_command_events'.
The problem in `read_char' can be demonstrated by the following form:

  (progn
    (run-with-timer 1 nil (lambda () (push '(t . 1) unread-command-events)))
    (read-event nil nil 2))

    => '(t . 1)

There is actually another related issue, that for an event returned by
`read_decoded_event_from_main_queue' other than the form (t . EVENT), we
can't tell whether it's from `Vunread_command_events' or not.
If it is, then we should not put it into `this_command_keys'.

Any ideas on how to fix these?





             reply	other threads:[~2016-07-14 14:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-14 14:03 Chris Feng [this message]
2017-11-19  9:39 ` bug#23980: 25.0.95; Events put in `unread-command-events' can be wrongly handled Chris Feng
2018-02-20 15:35   ` Dmitry Gutov
2018-02-20 18:37     ` Eli Zaretskii
2018-02-20 21:16       ` Dmitry Gutov
2018-02-21  4:22         ` Eli Zaretskii
2018-02-21  7:40           ` Chris Feng
2018-02-21 10:47             ` Dmitry Gutov
2018-02-21 12:23               ` Dmitry Gutov
2018-02-21 17:48               ` Eli Zaretskii
2018-02-21 21:45                 ` Dmitry Gutov
2018-02-22  7:39                   ` Eli Zaretskii
2018-12-19 13:54                     ` Dmitry Gutov
2018-12-19 15:27                       ` Eli Zaretskii
2018-12-19 16:07                         ` Dmitry Gutov

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=8660s871vt.fsf@gmail.com \
    --to=chris.w.feng@gmail.com \
    --cc=23980@debbugs.gnu.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.