branch: externals/transient commit 3668aeb81db07b4648f4e7ae228b3227d74bccb7 Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@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