all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Yuri Khan <yurivkhan@gmail.com>
Cc: 33749@debbugs.gnu.org
Subject: bug#33749: 26.1; input-decode-map to empty vector should preserve echo area
Date: Sat, 15 Dec 2018 08:57:47 +0200	[thread overview]
Message-ID: <83imzvff9w.fsf@gnu.org> (raw)
In-Reply-To: <CAP_d_8XMu1aCTV8RGO-6exMbYsie2VNP-P_x3Y4t91DbJSM1Bw@mail.gmail.com> (message from Yuri Khan on Sat, 15 Dec 2018 03:48:00 +0700)

> From: Yuri Khan <yurivkhan@gmail.com>
> 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.





  reply	other threads:[~2018-12-15  6:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-14 20:48 bug#33749: 26.1; input-decode-map to empty vector should preserve echo area Yuri Khan
2018-12-15  6:57 ` Eli Zaretskii [this message]
2018-12-15  8:07   ` Yuri Khan
2018-12-15  9:09     ` Eli Zaretskii
2018-12-16  8:29     ` bug#33749: [PATCH] Preserve echo area contents when decoding an empty key sequence (Bug#33749) Yuri Khan
2018-12-19 18:05 ` bug#33749: 26.1; input-decode-map to empty vector should preserve echo area Stefan Monnier
2018-12-20 17:33   ` Yuri Khan
2018-12-20 18:56     ` Stefan Monnier
2018-12-21 18:36       ` Yuri Khan
2018-12-25 19:35         ` Stefan Monnier
2018-12-25 19:44           ` Eli Zaretskii
2018-12-25 20:07             ` Stefan Monnier
2018-12-26  3:32               ` Eli Zaretskii
2019-01-01 16:09               ` Yuri Khan

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=83imzvff9w.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=33749@debbugs.gnu.org \
    --cc=yurivkhan@gmail.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.