bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#33749: 26.1; input-decode-map to empty vector should preserve echo a


From: Eli Zaretskii
Subject: bug#33749: 26.1; input-decode-map to empty vector should preserve echo area
Date: Sat, 15 Dec 2018 08:57:47 +0200

> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]