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

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

[elpa] externals/transient 3668aeb81d 053/366: transient--history-key: N


From: Jonas Bernoulli
Subject: [elpa] externals/transient 3668aeb81d 053/366: transient--history-key: New generic function
Date: Tue, 25 Jan 2022 18:54:26 -0500 (EST)

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

    transient--history-key: New generic function
---
 lisp/transient.el | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lisp/transient.el b/lisp/transient.el
index 5abda5b8b1..47e6175a41 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -2253,6 +2253,10 @@ which is not the same as nil."
 
 ;;; History
 
+(cl-defgeneric transient--history-key (obj)
+  "Return OBJ's history key."
+  (oref obj command))
+
 (defun transient--history-push (&optional slot)
   (unless slot
     (setq slot (oref transient--prefix command)))
@@ -2267,10 +2271,10 @@ have a history of their own.")
 
 (cl-defmethod transient--history-init ((obj transient-prefix))
   "Initialize OBJ's `history' slot from the variable `transient-history'."
-  (let ((val (oref obj value))
-        (cmd (oref obj command)))
+  (let ((val (oref obj value)))
     (oset obj history
-          (cons val (delete val (alist-get cmd transient-history))))))
+          (cons val (delete val (alist-get (transient--history-key obj)
+                                           transient-history))))))
 
 ;;; Draw
 



reply via email to

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