[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient 06697f75ac 11/17: Only use this-original-comm
From: |
Jonas Bernoulli |
Subject: |
[elpa] externals/transient 06697f75ac 11/17: Only use this-original-command when necessary |
Date: |
Fri, 25 Mar 2022 06:22:17 -0400 (EDT) |
branch: externals/transient
commit 06697f75ace79936e12709cfbd75547b7016b733
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
Only use this-original-command when necessary
It is necessary for `transient-help' and `transient-set-level'.
Invoking one of these commands enters a special mode. The next
command is always replaced with the command that entered the
special mode, which now behaves differently: it show the help
resp. sets the level for the `this-original-command'.
Other uses of `this-original-command' likely were "inspired" by
these legitimate uses.
---
lisp/transient.el | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/lisp/transient.el b/lisp/transient.el
index 66a2ac2111..059c3af0a3 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -1439,7 +1439,7 @@ probably use this instead:
transient-current-prefix)
(cl-find-if (lambda (obj)
(eq (transient--suffix-command obj)
- (or command this-original-command)))
+ (or command this-command)))
(or transient--suffixes
transient-current-suffixes))
(when-let ((obj (get (or command this-command) 'transient--suffix))
@@ -1989,8 +1989,7 @@ value. Otherwise return CHILDREN as is."
(setq this-command 'transient-set-level))
(t
(setq transient--exitp nil)
- (when (eq (if-let ((fn (transient--get-predicate-for
- this-original-command)))
+ (when (eq (if-let ((fn (transient--get-predicate-for this-command)))
(let ((action (funcall fn)))
(when (eq action transient--exit)
(setq transient--exitp (or transient--exitp t)))
@@ -2402,8 +2401,7 @@ to `transient--do-warn'."
'face 'font-lock-warning-face)
(propertize "C-g" 'face 'transient-key)
(propertize "?" 'face 'transient-key)
- (propertize (symbol-name (transient--suffix-symbol
- this-original-command))
+ (propertize (symbol-name (transient--suffix-symbol this-command))
'face 'font-lock-warning-face))
(unless (and transient--transient-map
(memq transient--transient-map overriding-terminal-local-map))
@@ -3715,9 +3713,7 @@ resumes the suspended transient.")
'face nil
'action (lambda (button)
(let ((command (button-get button 'command)))
- ;; Yes, I know that this is wrong(tm).
- ;; Unfortunately it is also necessary.
- (setq this-original-command command)
+ (setq this-command command)
(transient--pre-command)
(call-interactively command))))
- [elpa] externals/transient updated (7c771c94c8 -> 132090a4b6), Jonas Bernoulli, 2022/03/25
- [elpa] externals/transient 8d28d6ca5c 01/17: transient-reset: Fix docstring typo, Jonas Bernoulli, 2022/03/25
- [elpa] externals/transient 06697f75ac 11/17: Only use this-original-command when necessary,
Jonas Bernoulli <=
- [elpa] externals/transient 45ef6df3fb 03/17: Update changelog, Jonas Bernoulli, 2022/03/25
- [elpa] externals/transient 08ebdbc85d 02/17: manual: Mention more additions since last release, Jonas Bernoulli, 2022/03/25
- [elpa] externals/transient 8bd182c2de 05/17: Add ignore rules for ELPA, Jonas Bernoulli, 2022/03/25
- [elpa] externals/transient af49fd9447 04/17: Use more function quotes, Jonas Bernoulli, 2022/03/25
- [elpa] externals/transient 017eb7b3cb 07/17: Explicitly define generic functions, Jonas Bernoulli, 2022/03/25
- [elpa] externals/transient da97c6d18a 06/17: Revert most of "Use more function quotes", Jonas Bernoulli, 2022/03/25
- [elpa] externals/transient 0619c7ef19 08/17: Automatically publish statistics, Jonas Bernoulli, 2022/03/25
- [elpa] externals/transient 31d355b596 10/17: transient-set-level: Refresh shown levels after setting one, Jonas Bernoulli, 2022/03/25
- [elpa] externals/transient dd67ff9061 12/17: transient--do-pre-command: New function, Jonas Bernoulli, 2022/03/25
- [elpa] externals/transient bb056e7156 13/17: Invoke suffix commands directly when a button is pushed, Jonas Bernoulli, 2022/03/25