From: Jared Finder via "Emacs development discussions." <emacs-devel@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: Additional cleanup around xterm-mouse
Date: Sun, 27 Dec 2020 08:30:44 -0800 [thread overview]
Message-ID: <90ff03cd289ec32998b44bb486b32d5e@finder.org> (raw)
In-Reply-To: <jwv7dp3l2ra.fsf-monnier+emacs@gnu.org>
On 2020-12-27 7:36 am, Stefan Monnier wrote:
>> -@defun read-key &optional prompt
>> +@defun read-key &optional prompt all-fallbacks-disabled
>
> FWIW, I would call it "fallbacks-disabled".
I want to distinguish it from the very similar intentioned but somewhat
differing behaving parameter to read-key-sequence. If I don't need to
change read-key-sequence's behavior (see below), then I am 100% on
board.
> Hmm... now that I think about it, I wonder if we need to make changes
> in
> `read_key_sequence` at all, because we can instead arrange for all keys
> to be bound:
>
> diff --git a/lisp/subr.el b/lisp/subr.el
> index 725722cbee..1ca1d51d44 100644
> --- a/lisp/subr.el
> +++ b/lisp/subr.el
> @@ -2453,10 +2453,11 @@ memory-limit
> ;;;; Input and display facilities.
>
> (defconst read-key-empty-map (make-sparse-keymap))
> -
> +(defconst read-key-full-map
> + (let ((map (make-sparse-keymap))) (define-key map [t] 'dummy)
> map))
> (defvar read-key-delay 0.01) ;Fast enough for 100Hz repeat rate,
> hopefully.
>
> -(defun read-key (&optional prompt)
> +(defun read-key (&optional prompt dont-fallback)
> "Read a key from the keyboard.
> Contrary to `read-event' this will not return a raw event but
> instead will
> obey the input decoding and translations usually done by
> `read-key-sequence'.
> @@ -2468,7 +2469,8 @@ read-key
> ;; always inherits the input method, in practice read-key does
> not
> ;; inherit the input method (at least not if it's based on
> quail).
> (let ((overriding-terminal-local-map nil)
> - (overriding-local-map read-key-empty-map)
> + (overriding-local-map
> + (if dont-fallback read-key-full-map read-key-empty-map))
> (echo-keystrokes 0)
> (old-global-map (current-global-map))
> (timer (run-with-idle-timer
>
> WDYT?
This needs to also avoid binding ESC as well, e.g. adding (define-key
map [?\e] nil). Cursory testing locally with that as well shows this
working out well.
This assumes that ESC is the only prefix key in input-decode-map. Is
that an okay assumption to make? It appears true locally on my xterm.
All other suggestions integrated into my local patch.
-- MJF
next prev parent reply other threads:[~2020-12-27 16:30 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-26 23:49 Additional cleanup around xterm-mouse Jared Finder via Emacs development discussions.
2020-12-27 15:36 ` Stefan Monnier
2020-12-27 16:30 ` Jared Finder via Emacs development discussions. [this message]
2020-12-27 17:10 ` Stefan Monnier
2020-12-28 0:22 ` Jared Finder via Emacs development discussions.
2021-01-02 8:17 ` Eli Zaretskii
2021-01-02 22:20 ` Jared Finder via Emacs development discussions.
2021-01-09 12:27 ` Eli Zaretskii
2021-01-09 23:01 ` Jared Finder via Emacs development discussions.
2021-01-15 11:54 ` Eli Zaretskii
-- strict thread matches above, loose matches on Subject: below --
2020-11-16 6:29 Jared Finder via Emacs development discussions.
2020-11-16 17:30 ` Jared Finder via Emacs development discussions.
2020-11-18 17:40 ` Eli Zaretskii
2020-11-19 8:03 ` Jared Finder via Emacs development discussions.
2020-11-21 9:31 ` Eli Zaretskii
2020-11-22 23:56 ` Jared Finder via Emacs development discussions.
2020-11-28 16:36 ` Eli Zaretskii
2020-12-01 7:36 ` Jared Finder via Emacs development discussions.
2020-12-01 15:21 ` Stefan Monnier
2020-12-01 18:23 ` Eli Zaretskii
2020-12-02 6:45 ` Jared Finder via Emacs development discussions.
2020-12-02 16:53 ` Stefan Monnier
2020-12-03 5:46 ` Jared Finder via Emacs development discussions.
2020-12-03 14:45 ` Stefan Monnier
2020-12-03 17:31 ` Jared Finder via Emacs development discussions.
2020-12-14 0:54 ` Jared Finder via Emacs development discussions.
2020-12-14 15:32 ` Eli Zaretskii
2020-12-16 5:30 ` Jared Finder via Emacs development discussions.
2020-12-19 18:32 ` Eli Zaretskii
2020-12-19 22:50 ` Stefan Monnier
2020-12-20 7:26 ` Jared Finder via Emacs development discussions.
2020-12-20 14:07 ` Stefan Monnier
2020-12-20 23:27 ` Jared Finder via Emacs development discussions.
2020-12-23 16:52 ` Eli Zaretskii
2020-12-23 17:21 ` Jared Finder via Emacs development discussions.
2020-12-24 18:43 ` Eli Zaretskii
2020-12-14 0:36 ` Jared Finder via Emacs development discussions.
2020-11-21 17:00 ` Stefan Monnier
2020-11-21 8:23 ` Eli Zaretskii
2020-11-15 8:49 Jared Finder via Emacs development discussions.
2020-11-15 18:11 ` Eli Zaretskii
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=90ff03cd289ec32998b44bb486b32d5e@finder.org \
--to=emacs-devel@gnu.org \
--cc=eliz@gnu.org \
--cc=jared@finder.org \
--cc=monnier@iro.umontreal.ca \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).