Skip to content

Commit bce386f

Browse files
committed
transient--suffix-props
1 parent 1c79133 commit bce386f

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

lisp/transient.el

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1668,19 +1668,21 @@ See info node `(transient)Modifying Existing Transients'."
16681668

16691669
(defun transient--loc-match-p (suffix loc)
16701670
(and (not (stringp suffix))
1671-
(let* ((plist (cdr suffix))
1672-
(cmd (plist-get plist :command)))
1671+
(let* ((props (transient--suffix-props suffix))
1672+
(cmd (plist-get props :command)))
16731673
(if (symbolp loc)
16741674
(eq cmd loc)
1675-
(equal (kbd (or (plist-get plist :key)
1675+
(equal (kbd (or (plist-get props :key)
16761676
(transient--command-key cmd)))
16771677
(kbd loc))))))
16781678

1679+
(defalias 'transient--suffix-props #'cdr)
1680+
16791681
(defun transient--spec-key (spec)
1680-
(let ((plist (cdr spec)))
1681-
(or (plist-get plist :key)
1682+
(let ((props (transient--suffix-props spec)))
1683+
(or (plist-get props :key)
16821684
(transient--command-key
1683-
(plist-get plist :command)))))
1685+
(plist-get props :command)))))
16841686

16851687
(defun transient--command-key (cmd)
16861688
(and-let* ((obj (transient--suffix-prototype cmd)))
@@ -2584,9 +2586,9 @@ value. Otherwise return CHILDREN as is.")
25842586
(default)))
25852587

25862588
(defun transient--suffix-predicate (spec)
2587-
(let ((plist (cdr spec)))
2589+
(let ((props (transient--suffix-props spec)))
25882590
(seq-some (lambda (prop)
2589-
(and-let* ((pred (plist-get plist prop)))
2591+
(and-let* ((pred (plist-get props prop)))
25902592
(list prop pred)))
25912593
'( :if :if-not
25922594
:if-nil :if-non-nil

0 commit comments

Comments
 (0)