all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: [PATCH] Let input queue deal gracefully with up-events
Date: Wed, 28 Jan 2015 23:55:10 +0100	[thread overview]
Message-ID: <878ugmplbl.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <jwvh9vamu3j.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Wed, 28 Jan 2015 17:14:25 -0500")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> How else would you want to call the key release from a piano keyboard?
>> It is basically auxiliary information that can often be discarded: the
>> key press event is much more important when using a piano keyboard.
>
> I see, that makes sense.

Well, at least there does not seem to be much of a point of Emacs having
only half-baked support of "up-" with optional segfaults when the event
queue is writeable for program-generated events.  While I want to add
native Midi support eventually (it will make the timing info have much
less jitter and should make portability to Windows etc easier), this
would require the same sort of changes anyway, and so will other
attempts at playing with synthetic key events.

Discarding unbound up-events without error like down-events are
currently discarded is, of course, a somewhat arbitrary design decision.
However, if up-xxx is a modified version of xxx, chances are that its
state is comparable to down-xxx.

For Midi, I am still vacillating between using xxx/up-xxx or
down-xxx/up-xxx.  The former (where an unbound xxx leads to a complaint
and an unbound up-xxx is silently discarded) actually corresponds pretty
well with the normal semantics expected from a keyboard and would
probably also operate nicer in connection with M-x local-set-key RET.

My first approach was not messing with Emacs current modifier handling
at all and using xxx-down for keypress and xxx for keyrelease.  But that
was not really satisfactory since then M-x local-set-key RET binds the
keyrelease if you press a key.

Pre-stuffing the modifier caches is also only half-satisfactory since if
you then press a piano key, type C-x @ m and release the key again,
Emacs will still emacs_abort (since the modifier cache was not
pre-filled for M-up-xxx).

So at least in the long run, I think it makes good sense to make the
keyboard-queue backend not complain about data that could not have
originated from the keyboard-queue frontend.  It's not like the crashes
and inconsistencies serve any useful purpose.

Arguably, even if some problem is caused by unexpected things happening
in the keyboard-queue frontend, you may be better served with the
keyboard-queue backend delivering a quite descriptive and printable
strange event rather than crashing: after all, the actual program
location that could have _generated_ the data is no longer connected
with the call stack when emacs_abort is called.

-- 
David Kastrup



  reply	other threads:[~2015-01-28 22:55 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-28 13:31 [PATCH] Let input queue deal gracefully with up-events David Kastrup
2015-01-28 14:58 ` Alan Mackenzie
2015-01-28 15:19   ` [PATCH v1] " David Kastrup
2015-02-05 17:23     ` David Kastrup
2015-02-05 19:11       ` Stefan Monnier
2015-02-05 19:27         ` David Kastrup
2015-02-05 21:07           ` Ivan Shmakov
2015-02-05 21:42             ` David Kastrup
2015-02-05 19:17       ` Ivan Shmakov
2015-01-28 19:35 ` [PATCH] " Stefan Monnier
2015-01-28 19:50   ` David Kastrup
2015-01-28 22:14     ` Stefan Monnier
2015-01-28 22:55       ` David Kastrup [this message]
2015-01-28 22:19 ` Stefan Monnier
2015-01-28 23:06   ` David Kastrup
2015-01-29  3:57     ` Stefan Monnier
2015-01-29  8:49       ` David Kastrup
2015-01-29 15:00         ` Stefan Monnier
2015-01-29 15:14           ` David Kastrup

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=878ugmplbl.fsf@fencepost.gnu.org \
    --to=dak@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.