Skip to content

Commit

Permalink
forge--format-boolean: Add optional OBJ argument
Browse files Browse the repository at this point in the history
  • Loading branch information
tarsius committed Jun 3, 2024
1 parent 61d129e commit b8956a4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lisp/forge-topic.el
Original file line number Diff line number Diff line change
Expand Up @@ -787,14 +787,14 @@ can be selected from the start."
(funcall forge-format-avatar-function person)
""))

(defun forge--format-boolean (slot name)
(defun forge--format-boolean (slot name &optional obj)
;; Booleans are formatted differently in transients and headers.
;; Use this to format the (complete) description of suffix commands.
(let ((topic (forge-current-topic)))
(if (and topic (slot-exists-p topic slot))
(let ((obj (or obj (forge-current-topic))))
(if (and obj (slot-exists-p obj slot))
(format (propertize "[%s]" 'face 'transient-delimiter)
(propertize name 'face
(if (eieio-oref topic slot)
(if (eieio-oref obj slot)
'transient-value
'transient-inactive-value)))
(format "[%s]" name))))
Expand Down

0 comments on commit b8956a4

Please sign in to comment.