From: Kai Ma <justksqsf@gmail.com>
To: Po Lu <luangruo@yahoo.com>
Cc: emacs-devel@gnu.org
Subject: Re: [PATCH] On the nasty "ghost key" problem on NS
Date: Fri, 4 Nov 2022 16:53:34 +0800 [thread overview]
Message-ID: <394D8618-AF36-44C4-BA64-7AFDFBBDC429@gmail.com> (raw)
In-Reply-To: <87h6zfchpu.fsf@yahoo.com>
> On Nov 4, 2022, at 15:16, Po Lu <luangruo@yahoo.com> wrote:
>
> Kai Ma <justksqsf@gmail.com> writes:
>
>> I’ve narrowed the problem further to [firstRectForCharRange].
>
> I'm either blind, or there is no method by that name...
firstRectForCharacterRange.
>
>> Some calls never return. Activating an input method makes Emacs issue
>> excessive calls to this method. Specifically, the following code gets
>> stuck somewhere.
>>
>> if (WINDOWP (echo_area_window) && ! NILP (call0 (intern ("ns-in-echo-area"))))
>> win = XWINDOW (echo_area_window);
>> else
>> win = XWINDOW (FRAME_SELECTED_WINDOW (emacsframe));
>
> So Emacs completely locks up in that function (ns-in-echo-area)?
Yes and no. Emacs still responds to new key events, but a previous call is stuck and does not return. Presumably in another thread. To be more clear: changing that code to be
static int enter_cnt, leave_cnt;
enter_cnt++;
[referenced piece of code]
leave_cnt++;
/* (Or just count the return/leave counts of (ns-in-echo-area).) */
leave_cnt can be less than enter_cnt. I’ve confirmed re-entrance to [firstRectForCharacterRange] leads to the problem.
Pardon my ignorance, is there any reason to special-case the echo area? Simply let win = XWINDOW (FRAME_SELECTED_WINDOW (emacsframe)) and the problem is gone.
next prev parent reply other threads:[~2022-11-04 8:53 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
2022-11-04 6:28 ` Kai Ma
2022-11-04 7:16 ` Po Lu
2022-11-04 8:53 ` Kai Ma [this message]
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=394D8618-AF36-44C4-BA64-7AFDFBBDC429@gmail.com \
--to=justksqsf@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=luangruo@yahoo.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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).