Function: forge--topic-set-slot-command

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

Signature

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

Documentation

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

Source Code

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

(defclass forge--topic-set-slot-command (transient-suffix)
  ((slot :initarg :slot)
   (setter)
   (reader :initarg :reader)
   (formatter :initarg :formatter)
   (definition
    :initform (lambda (value)
                (interactive
                  (list (funcall (oref (transient-suffix-object) reader)
                                 (forge-current-topic t))))
                (let ((topic (forge-current-topic t)))
                  (funcall (oref (transient-suffix-object) setter)
                           (forge-get-repository topic)
                           topic value))))
   (description
    :initform (lambda (obj)
                (with-slots (slot inapt-if-not) obj
                  (if-let* ((topic (if inapt-if-not
                                       (funcall inapt-if-not)
                                     (forge-current-topic)))
                            (value (funcall (oref obj formatter) topic)))
                      (format "%s %s" slot value)
                    (format "%s" slot)))))))