Function: forge--topic-set-state-command

forge--topic-set-state-command is a byte-compiled function defined in forge-topic.el.

Signature

(forge--topic-set-state-command &rest SLOTS)

Documentation

Create a new object of class type forge--topic-set-state-command(var)/forge--topic-set-state-command(fun).

Source Code

;; Defined in ~/.emacs.d/elpa/forge-20260408.1922/forge-topic.el
;;;; State

(defclass forge--topic-set-state-command (transient-suffix)
  ((state :initarg :state)
   (getter :initarg :getter)
   (definition
    :initform (lambda ()
                (interactive)
                (with-slots (getter state) (transient-suffix-object)
                  (let ((topic (funcall getter t)))
                    (forge--set-topic-state (forge-get-repository topic)
                                            topic state)))))
   (description
    :initform (lambda (obj)
                (symbol-name (oref obj state))))
   (inapt-if
    :initform (lambda ()
                (or (forge-region-topics)
                    (with-slots (getter state) (transient-suffix-object)
                      (if-let ((topic (funcall getter)))
                          ;; Once a pull-request is merged,
                          ;; its state cannot be changed anymore.
                          (memq (oref topic state) (list state 'merged))
                        t)))))
   (inapt-face
    :initform (lambda (obj)
                (with-slots (getter state) (transient-suffix-object)
                  (if (and-let ((_(not (forge-region-topics)))
                                (topic (funcall getter)))
                        (eq (oref topic state) state))
                      'forge-suffix-active
                    'transient-inapt-suffix))))))