From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#33749: 26.1; input-decode-map to empty vector should preserve echo area Date: Sat, 15 Dec 2018 08:57:47 +0200 Message-ID: <83imzvff9w.fsf@gnu.org> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1544857029 17679 195.159.176.226 (15 Dec 2018 06:57:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 15 Dec 2018 06:57:09 +0000 (UTC) Cc: 33749@debbugs.gnu.org To: Yuri Khan Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 15 07:57:05 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1gY3sm-0004Tk-M7 for geb-bug-gnu-emacs@m.gmane.org; Sat, 15 Dec 2018 07:57:04 +0100 Original-Received: from localhost ([::1]:38091 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gY3ut-0000i7-7r for geb-bug-gnu-emacs@m.gmane.org; Sat, 15 Dec 2018 01:59:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gY3ul-0000i0-OR for bug-gnu-emacs@gnu.org; Sat, 15 Dec 2018 01:59:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gY3ug-0006Kb-GG for bug-gnu-emacs@gnu.org; Sat, 15 Dec 2018 01:59:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44638) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gY3ug-0006KX-CB for bug-gnu-emacs@gnu.org; Sat, 15 Dec 2018 01:59:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gY3ug-0001dk-64 for bug-gnu-emacs@gnu.org; Sat, 15 Dec 2018 01:59:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Dec 2018 06:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33749 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33749-submit@debbugs.gnu.org id=B33749.15448570826235 (code B ref 33749); Sat, 15 Dec 2018 06:59:02 +0000 Original-Received: (at 33749) by debbugs.gnu.org; 15 Dec 2018 06:58:02 +0000 Original-Received: from localhost ([127.0.0.1]:48896 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gY3ti-0001cU-DD for submit@debbugs.gnu.org; Sat, 15 Dec 2018 01:58:02 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:49022) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gY3tg-0001bz-3O for 33749@debbugs.gnu.org; Sat, 15 Dec 2018 01:58:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gY3tV-0005qI-MZ for 33749@debbugs.gnu.org; Sat, 15 Dec 2018 01:57:54 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41683) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gY3tV-0005q7-Ij; Sat, 15 Dec 2018 01:57:49 -0500 Original-Received: from [176.228.60.248] (port=2333 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gY3tT-00031N-VR; Sat, 15 Dec 2018 01:57:49 -0500 In-reply-to: (message from Yuri Khan on Sat, 15 Dec 2018 03:48:00 +0700) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:153472 Archived-At: > From: Yuri Khan > Date: Sat, 15 Dec 2018 03:48:00 +0700 > > The call sequence that causes the echo to be cleared looks like this: > > command_loop_1 (in keyboard.c) > read_key_sequence > read_char > redisplay > > and much of the read_char and read_key_sequence mechanics maintain > echoing of the current prefix sequence. > > > My suggestion is to add two changes: > > * If ‘read_key_sequence’ detects that the whole key sequence has been > rewritten to an empty sequence, return -1. This is the same code as a > canceled menu selection, upon receiving which clients call > ‘read_key_sequence’ again. > > * In ‘command_loop_1’, save the echo area contents before calling > ‘read_key_sequence’, and restore it if the return value is -1. Thanks for digging into this issue. Based on bitter past experience, I generally would like to avoid changes in these low-level mechanisms based on analysis of the code's logic and their presumed semantics. We had quite a few of cases where such analyses seemed sound when they were presented, but later turned out to miss some more or less rare situations and use cases, and changes based on such analyses thus caused subtle bugs that were hard or even impossible to fix without reverting to the old code (and losing the improvements provided by the new code). Therefore, if you want to propose a new feature in this area, I very much prefer to trigger such a feature by some (new) variable that is bound to a special value, rather than base the feature on decisions made by some modified logic. Doing this by such a variable might be slightly less elegant and general, but OTOH it runs a much lower risk of causing unintended consequences elsewhere.