Function: forge--topics-filter-state-command

forge--topics-filter-state-command is a byte-compiled function defined in forge-topics.el.

Signature

(forge--topics-filter-state-command &rest SLOTS)

Documentation

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

Source Code

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

(defclass forge--topics-filter-state-command (transient-suffix)
  ((state :initarg :state)
   (definition
    :initform (lambda ()
                (interactive)
                (let ((want (oref (transient-suffix-object) state))
                      (spec forge--buffer-topics-spec))
                  (cond ((and (eq want 'open)
                              (oref spec active))
                         (oset spec active nil)
                         (oset spec state want))
                        ((equal (oref spec state) want)
                         (oset spec state nil))
                        (t
                         (oset spec active nil)
                         (oset spec state want))))
                (forge-refresh-buffer)))
   (description
    :initform (lambda (suffix)
                (symbol-name (oref suffix state))))
   (face
    :initform (lambda (suffix)
                (let ((want   (oref suffix state))
                      (have   (oref forge--buffer-topics-spec state))
                      (active (oref forge--buffer-topics-spec active)))
                  (cond ((and (not active)
                              (equal have want))
                         'forge-suffix-active)
                        ((and (or active
                                  (eq have 'open))
                              (eq want 'open))
                         (if (eq have want)
                             'forge-suffix-active-and-implied
                           'forge-suffix-implied))
                        ((and (memq want '(unplanned duplicate outdated))
                              (equal have
                                     '(unplanned duplicate outdated rejected))
                              (not active))
                         'forge-suffix-implied)))))))