Skip to content

Commit

Permalink
Support including a top-level group from a variable
Browse files Browse the repository at this point in the history
The first prefixes to use this are `magit-{log,diff}{,-refresh}',
which see.
  • Loading branch information
tarsius committed Dec 17, 2024
1 parent be2189a commit eebcbe3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lisp/transient.el
Original file line number Diff line number Diff line change
Expand Up @@ -1206,6 +1206,16 @@ commands are aliases for."
(setq level (pop spec)))
(when (stringp (car spec))
(setq args (plist-put args :description (pop spec))))
;; Merge value of [... GROUP-VARIABLE], if any.
(let ((spec* spec))
(while (keywordp (car spec*))
(setq spec* (cddr spec*)))
(when (and (length= spec* 1) (symbolp (car spec*)))
(let ((rest (append (symbol-value (car spec*)) nil))
(args nil))
(while (keywordp (car rest))
(setq args (nconc (list (pop rest) (pop rest)) args)))
(setq spec (nconc args (butlast spec) rest)))))
(while (keywordp (car spec))
(let* ((key (pop spec))
(val (if spec (pop spec) (error "No value for `%s'" key))))
Expand Down

0 comments on commit eebcbe3

Please sign in to comment.