From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master 5b5f441: read_key_sequence: correct the handling of raw_keybuf in recursive calls Date: Mon, 20 Nov 2017 13:41:54 -0500 Message-ID: References: <20171120181209.23553.97060@vcs0.savannah.gnu.org> <20171120181210.7946F20416@vcs0.savannah.gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1511203361 4651 195.159.176.226 (20 Nov 2017 18:42:41 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 20 Nov 2017 18:42:41 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Alan Mackenzie To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 20 19:42:37 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eGr1e-0000lu-2s for ged-emacs-devel@m.gmane.org; Mon, 20 Nov 2017 19:42:34 +0100 Original-Received: from localhost ([::1]:59209 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGr1l-0008Fo-Ei for ged-emacs-devel@m.gmane.org; Mon, 20 Nov 2017 13:42:41 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38469) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGr1B-0008FX-GJ for emacs-devel@gnu.org; Mon, 20 Nov 2017 13:42:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGr17-00047M-E9 for emacs-devel@gnu.org; Mon, 20 Nov 2017 13:42:05 -0500 Original-Received: from pmta31.teksavvy.com ([76.10.157.38]:13603) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1eGr17-000475-7H for emacs-devel@gnu.org; Mon, 20 Nov 2017 13:42:01 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2F/FABbIRNa/3HQSC1bHAEBAQQBAQoBA?= =?us-ascii?q?YM8gVSDW4pRj0GTbocCHYUoAoUAQxQBAQEBAQEBAQEDaCiFIAZ5EAsNJwcLFBi?= =?us-ascii?q?Kaap/IQKKUwEBAQEGAgElgzSCB4M+gyuFZ4UsBZMIjzagfyiHMUiXJDYjgXQ0I?= =?us-ascii?q?Qgygy6DEIFsI4wCAQEB?= X-IPAS-Result: =?us-ascii?q?A2F/FABbIRNa/3HQSC1bHAEBAQQBAQoBAYM8gVSDW4pRj0G?= =?us-ascii?q?TbocCHYUoAoUAQxQBAQEBAQEBAQEDaCiFIAZ5EAsNJwcLFBiKaap/IQKKUwEBA?= =?us-ascii?q?QEGAgElgzSCB4M+gyuFZ4UsBZMIjzagfyiHMUiXJDYjgXQ0IQgygy6DEIFsI4w?= =?us-ascii?q?CAQEB?= X-IronPort-AV: E=Sophos;i="5.44,429,1505793600"; d="scan'208";a="9434343" Original-Received: from unknown (HELO pastel.home) ([45.72.208.113]) by smtp.teksavvy.com with ESMTP; 20 Nov 2017 13:41:54 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 78E7A607D3; Mon, 20 Nov 2017 13:41:54 -0500 (EST) In-Reply-To: <20171120181210.7946F20416@vcs0.savannah.gnu.org> (Alan Mackenzie's message of "Mon, 20 Nov 2017 13:12:10 -0500 (EST)") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 76.10.157.38 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:220305 Archived-At: > + outer_raw_keybuf_count = raw_keybuf_count; > + outer_raw_keybuf = raw_keybuf; > + inner_raw_keybuf_count_buffer = 0; > + raw_keybuf_count = &inner_raw_keybuf_count_buffer; > + raw_keybuf = &inner_raw_keybuf_buffer; Looks good, thanks (tho I think I would have bundled the buf and the count into a struct, so it's clear that they're switched together). > /* Calling read_char with COMMANDFLAG = -2 avoids > redisplay in read_char and its subroutines. */ > key = read_char (prevent_redisplay ? -2 : NILP (prompt), > current_binding, last_nonmenu_event, > &used_mouse_menu, NULL); > + raw_keybuf_count = outer_raw_keybuf_count; > + raw_keybuf = outer_raw_keybuf; But here I worry: what if `read_char` exits non-locally because of a signal or a throw? Stefan