all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Po Lu <luangruo@yahoo.com>
Cc: Kai Ma <justksqsf@gmail.com>,  emacs-devel@gnu.org
Subject: Re: [PATCH] On the nasty "ghost key" problem on NS
Date: Sat, 12 Nov 2022 12:49:05 -0500	[thread overview]
Message-ID: <jwv35aooykw.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87tu373skg.fsf@yahoo.com> (Po Lu's message of "Thu, 10 Nov 2022 20:25:03 +0800")

Po Lu [2022-11-10 20:25:03] wrote:

> Kai Ma <justksqsf@gmail.com> writes:
>
>>  On Nov 4, 2022, at 23:09, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>>
>>  I'm glad we found a way to make the code work, apparently, but
>>  Here we need a comment explaining why we do this gymnastic of
>>  `safe_call` + `inhibit_quit` + `waiting_for_input`.
>>
>>  It's very unusual to have to do that.
>>
>> Thanks for the pointer, this indeed turned out unnecessary (and dangerous).
>>
>> A tester informed me of a problem in the v3 patch:
>>
>>   safe_call (0, Qns_in_echo_area)
>>
>> is incorrect. The 0 should be 1, or nargs will be -1 for funcall_general.  
>> This will cause an error to be signaled, which explains why 
>> `waiting_for_input` has to be masked.
>>
>> [ I guess we could add an assertion that numargs >= 0 in funcall_general or
>>   somewhere else? ]
>>
>> This patch should be correct even without the ugly `waiting_for_input` hack.
>> I’ve been running patched Emacs for some time without issues.
>>
>> With the current understanding of the bug, I guess the comment line could be
>>   /* Protect against throw-on-input. */
>
> I will install a change using internal_catch_all instead, if Stefan is
> fine with that.

I don't have any objection to any of the patches that were proposed.
My only point was that it looked like we were getting to the point where
we "add hacks upon hacks for lack of understanding".
Once we start doing that it's very important to add as much context in
the form of comments in order to help the poor sod who needs to deal
with the next problem (in the hope that they will get a chance to
actually understand at some point what is the true underlying problem).


        Stefan




  reply	other threads:[~2022-11-12 17:49 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
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 [this message]
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=jwv35aooykw.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=justksqsf@gmail.com \
    --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 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.