Function: transient--parse-group

transient--parse-group is a byte-compiled function defined in transient.el.

Signature

(transient--parse-group PREFIX SPEC)

Source Code

;; Defined in ~/.emacs.d/elpa/transient-20260414.1009/transient.el
(defun transient--parse-group (prefix spec)
  (let (class args)
    (setq spec (append spec nil))
    (when (integerp (car spec))
      (setq args (plist-put args :level (pop spec))))
    (when (stringp (car spec))
      (setq args (plist-put args :description (pop spec))))
    (while (keywordp (car spec))
      (let* ((key (pop spec))
             (val (if spec (pop spec) (error "No value for `%s'" key))))
        (cond ((eq key :class)
               (setq class val))
              ((or (symbolp val)
                   (and (listp val)
                        (not (memq (car val) (list 'lambda (intern ""))))))
               (setq args (plist-put args key (macroexp-quote val))))
              ((setq args (plist-put args key val))))))
    (unless (or spec class (not (plist-get args :setup-children)))
      (message "WARNING: %s: When %s is used, %s must also be specified"
               'transient-define-prefix :setup-children :class))
    (list 'vector
          (list 'quote
                (cond (class)
                      ((cl-typep (car spec)
                                 '(or vector (and symbol (not null))))
                       'transient-columns)
                      ('transient-column)))
          (and args (cons 'list args))
          (cons 'list
                (mapcan (lambda (s) (transient--parse-child prefix s)) spec)))))