emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/transient e627d45166 054/366: transient-prefix: Add new


From: Jonas Bernoulli
Subject: [elpa] externals/transient e627d45166 054/366: transient-prefix: Add new history-key slot
Date: Tue, 25 Jan 2022 18:54:26 -0500 (EST)

branch: externals/transient
commit e627d4516602c1a47cd85eb96ea4a3d69f202cfd
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    transient-prefix: Add new history-key slot
---
 lisp/transient.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/transient.el b/lisp/transient.el
index 47e6175a41..37adcc44cf 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -407,6 +407,7 @@ If `transient-save-history' is nil, then do nothing."
    (scope       :initarg :scope       :initform nil)
    (history     :initarg :history     :initform nil)
    (history-pos :initarg :history-pos :initform 0)
+   (history-key :initarg :history-key :initform nil)
    (man-page    :initarg :man-page    :initform nil)
    (info-manual :initarg :info-manual :initform nil)
    (transient-suffix     :initarg :transient-suffix     :initform nil)
@@ -2254,8 +2255,11 @@ which is not the same as nil."
 ;;; History
 
 (cl-defgeneric transient--history-key (obj)
-  "Return OBJ's history key."
-  (oref obj command))
+  "Return OBJ's history key.
+If the value of the `history-key' slot is non-nil, then return
+that.  Otherwise return the value of the `command' slot."
+  (or (oref obj history-key)
+      (oref obj command)))
 
 (defun transient--history-push (&optional slot)
   (unless slot



reply via email to

[Prev in Thread] Current Thread [Next in Thread]