From: Po Lu <luangruo@yahoo.com>
To: Kai Ma <justksqsf@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: [PATCH] On the nasty "ghost key" problem on NS
Date: Fri, 04 Nov 2022 08:32:53 +0800 [thread overview]
Message-ID: <87leord0ei.fsf@yahoo.com> (raw)
In-Reply-To: <E0CC6F22-3F3F-4132-92E1-F5F17067C92A@gmail.com> (Kai Ma's message of "Fri, 4 Nov 2022 02:07:39 +0800")
Kai Ma <justksqsf@gmail.com> writes:
> Hi all,
>
> Attached is a one-liner patch to the “ghost key” problem on NS. (The name is made up by me.) I didn’t have luck finding a bug report (but it did happen to many to-be-liberated Mac users [1-3]), so I decided to directly send it here.
>
> On certain occasions (*), the key event buffer is not cleared to be
> empty even if the events have been processed. This results in a nasty
> problem: when you press a key, say “y”, a key that is pressed earlier
> will be prepended to the current key. There’s no way to reset the
> event buffer.
>
> This problem is highly unpredictable, making it very hard to reproduce. A probably quicker way: hack Emacs’ C codebase with corfu-auto and citre-mode.
>
> (*) The root cause is still not clear to me. It’s observed that
> sometimes, the [interpretKeyEvents] call seems not to return. (Blocked
> inside Cocoa?) And the supposedly matched “remove” is never
> called. Now “nsEvArray” is left with an earlier keyDown event, and
> since “nsEvArray” is static, you have the problem as described
> above. I guess it may be some Cocoa internal changes that caused this.
>
> This patch is just a workaround, but it improves the current user experience a bit.
I am sorry, but this patch breaks compose processing. So we're
certainly not installing anything like this in Emacs 29.
I will try to figure out a way to reproduce the bug and why it actually
happens.
next prev parent reply other threads:[~2022-11-04 0:32 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-03 18:07 [PATCH] On the nasty "ghost key" problem on NS Kai Ma
2022-11-04 0:32 ` Po Lu [this message]
2022-11-04 6:28 ` Kai Ma
2022-11-04 7:16 ` Po Lu
2022-11-04 8:53 ` Kai Ma
2022-11-04 9:29 ` Po Lu
2022-11-04 11:04 ` Kai Ma
2022-11-04 11:27 ` Po Lu
2022-11-04 12:09 ` Kai Ma
2022-11-04 12:17 ` Po Lu
2022-11-04 15:09 ` Stefan Monnier
2022-11-05 0:43 ` Po Lu
2022-11-05 14:40 ` Stefan Monnier
2022-11-05 15:26 ` Kai Ma
2022-11-05 15:47 ` Stefan Monnier
2022-11-06 0:25 ` Po Lu
2022-11-10 11:59 ` Kai Ma
2022-11-10 12:25 ` Po Lu
2022-11-12 17:49 ` Stefan Monnier
2022-11-04 11:40 ` Eli Zaretskii
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=87leord0ei.fsf@yahoo.com \
--to=luangruo@yahoo.com \
--cc=emacs-devel@gnu.org \
--cc=justksqsf@gmail.com \
/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.