From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] On the nasty "ghost key" problem on NS Date: Sat, 12 Nov 2022 12:49:05 -0500 Message-ID: References: <87leord0ei.fsf@yahoo.com> <87h6zfchpu.fsf@yahoo.com> <394D8618-AF36-44C4-BA64-7AFDFBBDC429@gmail.com> <878rkrcbkx.fsf@yahoo.com> <87sfizaria.fsf@yahoo.com> <87k04ac3s6.fsf@yahoo.com> <36443E84-7646-4BD3-B1E4-C671C2BB46BC@gmail.com> <87tu373skg.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22314"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Kai Ma , emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 12 18:49:42 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1otudR-0005Wv-9R for ged-emacs-devel@m.gmane-mx.org; Sat, 12 Nov 2022 18:49:41 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1otud5-000111-Cb; Sat, 12 Nov 2022 12:49:19 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1otud2-00010s-O9 for emacs-devel@gnu.org; Sat, 12 Nov 2022 12:49:16 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1otud0-0004Nv-SC for emacs-devel@gnu.org; Sat, 12 Nov 2022 12:49:16 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 036E510012E; Sat, 12 Nov 2022 12:49:13 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 481E8100091; Sat, 12 Nov 2022 12:49:11 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1668275351; bh=TqExbBO8RLQxsBeCq6gCUa8K59wPYPNrubz52VRfw8Q=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=HdXd7XAyjsh8UCRoixHQteYu2HNojaNyAtyg+9RbjK133XCl9xilaIKgsTurSlUrj KVdcyt4Az8tYH1D2NFCziSh6owR6dmlzrFgWHmRnqCqEO0t25MgYwCxCPuG1ggpjL1 MSFIhqZ2Lbx9UctNJ217mgCTOasx5mhX0zvpje/1lp0DU2TtwSNN3L8f1RXEP6+wRM JOzvpsG3ew6sxeABHPIN6ilLCFp7nBsPJr8CBseJF0xXI+zpzr2zKED0HzTcUpaQdV eeXfRwUOicVlmEm1Y8ZSTD9RCggTH663y8nwyfpW18LoiBKx1laJOtTUtz2NEIjWZ+ o7XSgibvZkkuw== Original-Received: from pastel (unknown [104.247.241.157]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 189E7120330; Sat, 12 Nov 2022 12:49:11 -0500 (EST) In-Reply-To: <87tu373skg.fsf@yahoo.com> (Po Lu's message of "Thu, 10 Nov 2022 20:25:03 +0800") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:299668 Archived-At: Po Lu [2022-11-10 20:25:03] wrote: > Kai Ma writes: > >> On Nov 4, 2022, at 23:09, Stefan Monnier wro= te: >> >> 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 dangerou= s). >> >> 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= .=20=20 >> This will cause an error to be signaled, which explains why=20 >> `waiting_for_input` has to be masked. >> >> [ I guess we could add an assertion that numargs >=3D 0 in funcall_gener= al or >> somewhere else? ] >> >> This patch should be correct even without the ugly `waiting_for_input` h= ack. >> I=E2=80=99ve been running patched Emacs for some time without issues. >> >> With the current understanding of the bug, I guess the comment line coul= d 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