[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient a80307c7ce 06/20: transient--current-buffer:
From: |
Jonas Bernoulli |
Subject: |
[elpa] externals/transient a80307c7ce 06/20: transient--current-buffer: New variable |
Date: |
Tue, 24 Oct 2023 13:42:15 -0400 (EDT) |
branch: externals/transient
commit a80307c7ceb645ef9f9f29650ca5bf1f9e708c5b
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
transient--current-buffer: New variable
---
lisp/transient.el | 50 +++++++++++++++++++++++++++++---------------------
1 file changed, 29 insertions(+), 21 deletions(-)
diff --git a/lisp/transient.el b/lisp/transient.el
index 273060f760..1b87c615a9 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -1405,6 +1405,11 @@ Usually it remains selected while the transient is
active.")
"The buffer that was current before the transient was invoked.
Usually it remains current while the transient is active.")
+(defvar transient--current-buffer nil
+ "The buffer that is temporarily shadowed by the transient buffer.
+This is bound while the suffix predicate is being evaluated and while
+drawing in the transient buffer.")
+
(defvar transient--debug nil "Whether put debug information into *Messages*.")
(defvar transient--history nil)
@@ -1927,28 +1932,30 @@ value. Otherwise return CHILDREN as is."
(<= level (oref transient--prefix level)))))
(defun transient--use-suffix-p (obj)
- (transient--do-suffix-p
- (oref obj if)
- (oref obj if-not)
- (oref obj if-nil)
- (oref obj if-non-nil)
- (oref obj if-mode)
- (oref obj if-not-mode)
- (oref obj if-derived)
- (oref obj if-not-derived)
- t))
+ (let ((transient--current-buffer (current-buffer)))
+ (transient--do-suffix-p
+ (oref obj if)
+ (oref obj if-not)
+ (oref obj if-nil)
+ (oref obj if-non-nil)
+ (oref obj if-mode)
+ (oref obj if-not-mode)
+ (oref obj if-derived)
+ (oref obj if-not-derived)
+ t)))
(defun transient--inapt-suffix-p (obj)
- (transient--do-suffix-p
- (oref obj inapt-if)
- (oref obj inapt-if-not)
- (oref obj inapt-if-nil)
- (oref obj inapt-if-non-nil)
- (oref obj inapt-if-mode)
- (oref obj inapt-if-not-mode)
- (oref obj inapt-if-derived)
- (oref obj inapt-if-not-derived)
- nil))
+ (let ((transient--current-buffer (current-buffer)))
+ (transient--do-suffix-p
+ (oref obj inapt-if)
+ (oref obj inapt-if-not)
+ (oref obj inapt-if-nil)
+ (oref obj inapt-if-non-nil)
+ (oref obj inapt-if-mode)
+ (oref obj inapt-if-not-mode)
+ (oref obj inapt-if-derived)
+ (oref obj inapt-if-not-derived)
+ nil)))
(defun transient--do-suffix-p
(if if-not if-nil if-non-nil if-mode if-not-mode if-derived if-not-derived
@@ -3270,7 +3277,8 @@ have a history of their own.")
(defun transient--show ()
(transient--timer-cancel)
(setq transient--showp t)
- (let ((buf (get-buffer-create transient--buffer-name))
+ (let ((transient--current-buffer (current-buffer))
+ (buf (get-buffer-create transient--buffer-name))
(focus nil))
(with-current-buffer buf
(when transient-enable-popup-navigation
- [elpa] externals/transient updated (04f87b4ab3 -> 4f67a033fd), Jonas Bernoulli, 2023/10/24
- [elpa] externals/transient 3e43f1fd90 04/20: transient--pixel-width: Move definition, Jonas Bernoulli, 2023/10/24
- [elpa] externals/transient c2a75880ae 14/20: transient-suffix: Add FACE slot, Jonas Bernoulli, 2023/10/24
- [elpa] externals/transient 8b988fc4bd 03/20: Use the other variant of the and-let* kludge, Jonas Bernoulli, 2023/10/24
- [elpa] externals/transient dd7ed3869b 01/20: Indent code blocks in docstrings consistently, Jonas Bernoulli, 2023/10/24
- [elpa] externals/transient a19c0bda1d 05/20: transient--window: Tweak docstring, Jonas Bernoulli, 2023/10/24
- [elpa] externals/transient a80307c7ce 06/20: transient--current-buffer: New variable,
Jonas Bernoulli <=
- [elpa] externals/transient fb191f8cf3 08/20: Optionally refresh suffixes and keymaps after every command, Jonas Bernoulli, 2023/10/24
- [elpa] externals/transient a81eff942b 11/20: transient-font-lock-keywords: Remove transient-define-groups, Jonas Bernoulli, 2023/10/24
- [elpa] externals/transient 49a61fb905 13/20: Support setting per-suffix level for duplicated commands, Jonas Bernoulli, 2023/10/24
- [elpa] externals/transient 2776dbc07c 16/20: transient--flatten-suffixes: Cosmetics, Jonas Bernoulli, 2023/10/24
- [elpa] externals/transient aee5f23447 09/20: Improve docstrings, Jonas Bernoulli, 2023/10/24
- [elpa] externals/transient f8209cc8f4 15/20: transient--maybe-pad-keys: Ignore raw strings, Jonas Bernoulli, 2023/10/24
- [elpa] externals/transient ae4ac656b1 18/20: transient-group: Always bind PAD-KEYS slot, Jonas Bernoulli, 2023/10/24
- [elpa] externals/transient 4f67a033fd 20/20: Support display-only information in place of a suffix, Jonas Bernoulli, 2023/10/24
- [elpa] externals/transient d3e735f2d0 02/20: transient--post-command: Fix typo in docstring, Jonas Bernoulli, 2023/10/24
- [elpa] externals/transient 0717589a62 07/20: transient--pending-suffix: New variable, Jonas Bernoulli, 2023/10/24