[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient 3a2b936a67 36/41: Fix highlighting infix for
|
From: |
Jonas Bernoulli |
|
Subject: |
[elpa] externals/transient 3a2b936a67 36/41: Fix highlighting infix for which user input is being read |
|
Date: |
Sun, 12 Nov 2023 20:04:09 -0500 (EST) |
branch: externals/transient
commit 3a2b936a67d07a6ffdec0a757c09b509ca4f582e
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
Fix highlighting infix for which user input is being read
---
lisp/transient.el | 33 ++++++++++-----------------------
1 file changed, 10 insertions(+), 23 deletions(-)
diff --git a/lisp/transient.el b/lisp/transient.el
index e015678c28..d347101e51 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -1417,8 +1417,6 @@ variable instead.")
(defvar transient--all-levels-p nil
"Whether temporary display of suffixes on all levels is active.")
-(defvar transient--active-infix nil "The active infix awaiting user input.")
-
(defvar transient--timer nil)
(defvar transient--stack nil)
@@ -2749,10 +2747,9 @@ transient is active."
(list command
(let ((keys (this-single-command-raw-keys)))
(and (lookup-key transient--transient-map keys)
- (string-to-number
- (let ((transient--active-infix
- (transient-suffix-object command)))
- (transient--show)
+ (progn
+ (transient--show)
+ (string-to-number
(transient--read-number-N
(format "Set level for `%s': " command)
nil nil (not (eq command prefix)))))))))))
@@ -3010,23 +3007,13 @@ infix command determines what the new value should be,
based
on the previous value.")
(cl-defmethod transient-infix-read :around ((obj transient-infix))
- "Highlight the infix in the popup buffer.
-
-This also wraps the call to `cl-call-next-method' with two
-macros.
-
-`transient--with-suspended-override' is necessary to allow
-reading user input using the minibuffer.
+ "Refresh the transient buffer buffer calling the next method.
-`transient--with-emergency-exit' arranges for the transient to
-be exited in case of an error because otherwise Emacs would get
-stuck in an inconsistent state, which might make it necessary to
-kill it from the outside.
-
-If you replace this method, then you must make sure to always use
-the latter macro and most likely also the former."
- (let ((transient--active-infix obj))
- (transient--show))
+Also wrap `cl-call-next-method' with two macros:
+- `transient--with-suspended-override' allows use of minibuffer.
+- `transient--with-emergency-exit' arranges for the transient to
+ be exited in case of an error."
+ (transient--show)
(transient--with-emergency-exit
(transient--with-suspended-override
(cl-call-next-method obj))))
@@ -3619,7 +3606,7 @@ making `transient--original-buffer' current.")
(cl-defmethod transient-format :around ((obj transient-infix))
"When reading user input for this infix, then highlight it."
(let ((str (cl-call-next-method obj)))
- (when (eq obj transient--active-infix)
+ (when (eq (oref obj command) this-original-command)
(setq str (concat str "\n"))
(add-face-text-property
(if (eq this-command 'transient-set-level) 3 0)
- [elpa] externals/transient 533578b6b2 32/41: transient-information: Use a space as the fake key, (continued)
- [elpa] externals/transient 533578b6b2 32/41: transient-information: Use a space as the fake key, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 59d8c0342a 18/41: transient--unset-incompatible: Remove unnecessary variable, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient ed5bd6fdc3 23/41: transient-infix-set(argument): Fix disabling incompatible options, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient bad91f79ec 29/41: transient-with-shadowed-buffer: Move definition, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient cf32cf6f98 39/41: transient--get-face: Favor face over function, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 4b9d831d28 10/41: transient--make-predicate-map: Drop obsolete condition, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 784887b781 14/41: Account for t as transient-suffix for nested prefixes, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 2eb214a6ec 24/41: transient-infix-set(argument): Also disable based on concrete value, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 94661e0ccd 34/41: transient--do-replace: Replace with two variants, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 9617b6c77c 35/41: transient--make-predicate-map: Support shorthands, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 3a2b936a67 36/41: Fix highlighting infix for which user input is being read,
Jonas Bernoulli <=
- [elpa] externals/transient 222c2bfbeb 38/41: transient--get-face: New function, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 02607dd9d9 04/41: manual: Move comparisons to wiki, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 0677e2c3d8 26/41: transient-format-description: Operate in transient--shadowed-buffer, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient b4a2963636 33/41: transient-format(around:suffix): Update for transient-information, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient d44c4fce39 40/41: transient--get-face: Use for inapt-face, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient eaf062a921 11/41: transient--make-predicate-map: Refactor, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 5ad5b627f6 15/41: transient--setup-recursion: When initiated by outer transient-suffix, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 2b7219cf6a 28/41: transient--current-buffer: Fix obsolete variable alias, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 0a0ba1aa90 01/41: transient--do-leave: Actually behave as documented, Jonas Bernoulli, 2023/11/12
- [elpa] externals/transient 8bfd92993f 17/41: manual: Update "Transient State" section, Jonas Bernoulli, 2023/11/12