[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient d9ced840fa 5/8: transient--make-redisplay-map
From: |
Jonas Bernoulli |
Subject: |
[elpa] externals/transient d9ced840fa 5/8: transient--make-redisplay-map: Ensure unread-command-events is used |
Date: |
Sat, 2 Nov 2024 09:09:38 -0400 (EDT) |
branch: externals/transient
commit d9ced840fa89dba2e22708d1e247f310da139245
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
transient--make-redisplay-map: Ensure unread-command-events is used
We use an additional transient keymap, which binds every incomplete key
sequence, which exists in the keymap with the real suffix bindings, to
the command `transient-update'. That command updates the menu, dimming
all the suffixes that can no longer be reached using the current
incomplete key sequence. Additionally it sets `unread-command-events'
to the incomplete key sequence. This command is called for every key
in the sequence individually, but it sets the variable to the full
sequence.
Turns out, for many purposes, all but the first of these events is
ignored, which matters as soon as the final sequence has more than two
elements. We could start using `this-single-command-raw-keys' more,
as that always returns the full sequence, but that would not help with
features implemented outside of Emacs (such as the incomplete sequence
being shown in the echo area). So instead use the special (t . KEY)
form for elements added to `unread-command-events'. That way we get
the same behavior we would get if the redisplay map did not exist.
Fixes #324 and similar issues.
---
CHANGELOG | 3 +++
lisp/transient.el | 5 +++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
index 454ac3699b..63b2b1eab8 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -18,6 +18,9 @@ Bug fixes:
~transient-current-*~ variables were not immediately reset to
~nil~. #323
+- Key sequences with three or more events broke
+ ~transient-suffix-object~. #324
+
* v0.7.7 2024-10-04
Bug fix:
diff --git a/lisp/transient.el b/lisp/transient.el
index 0575dc73be..cb4243d511 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -2019,8 +2019,9 @@ of the corresponding object."
(pcase this-command
('transient-update
(setq transient--showp t)
- (setq unread-command-events
- (listify-key-sequence (this-single-command-raw-keys))))
+ (let ((keys (listify-key-sequence (this-single-command-raw-keys))))
+ (setq unread-command-events (mapcar (lambda (key) (cons t key))
keys))
+ keys))
('transient-quit-seq
(setq unread-command-events
(butlast (listify-key-sequence
- [elpa] externals/transient updated (fcc54cb5d1 -> d6b52b6eb7), Jonas Bernoulli, 2024/11/02
- [elpa] externals/transient dd91827b41 3/8: Update changelog, Jonas Bernoulli, 2024/11/02
- [elpa] externals/transient cb11650a60 2/8: Show information about the suffix at point in the echo area, Jonas Bernoulli, 2024/11/02
- [elpa] externals/transient 0ed0094919 4/8: Ensure transient-current-* variables are unset on every exit, Jonas Bernoulli, 2024/11/02
- [elpa] externals/transient 1b7f9be7b9 6/8: transient-suffix-object: Drop faulty fallback behavior, Jonas Bernoulli, 2024/11/02
- [elpa] externals/transient d9ced840fa 5/8: transient--make-redisplay-map: Ensure unread-command-events is used,
Jonas Bernoulli <=
- [elpa] externals/transient 03f9f314cd 7/8: Re-generate manual, Jonas Bernoulli, 2024/11/02
- [elpa] externals/transient d6b52b6eb7 8/8: Release version 0.7.8, Jonas Bernoulli, 2024/11/02
- [elpa] externals/transient 38f7f46826 1/8: transient-enable-popup-navigation: Update documentation, Jonas Bernoulli, 2024/11/02