diff options
| author | Jonas Bernoulli <jonas@bernoul.li> | 2023-11-20 20:11:54 +0100 |
|---|---|---|
| committer | Jonas Bernoulli <jonas@bernoul.li> | 2023-11-20 20:11:54 +0100 |
| commit | 7da468ef9d492d5e95853bd3871317bdc5feea21 (patch) | |
| tree | bc87bc4a9fab65b12225db1226e3ed144a1d2405 | |
| parent | fdd05325759f516ed35e5cac8063ecba82c6eeea (diff) | |
transient-format(around:suffix): Absorb around:infix method
| -rw-r--r-- | lisp/transient.el | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/lisp/transient.el b/lisp/transient.el index 8a030c8..0e9d94c 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -3611,18 +3611,17 @@ making `transient--original-buffer' current.") "Return a string containing just the ARG character." (char-to-string arg)) -(cl-defmethod transient-format :around ((obj transient-infix)) - "When reading user input for this infix, then highlight it." - (let ((str (cl-call-next-method obj))) - (if (eq (oref obj command) this-original-command) - (transient--add-face (concat str "\n") 'transient-active-infix nil - (if (eq this-command 'transient-set-level) 3 0)) - str))) - (cl-defmethod transient-format :around ((obj transient-suffix)) - "When edit-mode is enabled, then prepend the level information. -Optional support for popup buttons is also implemented here." + "Add additional formatting if appropriate. +When reading user input for this infix, then highlight it. +When edit-mode is enabled, then prepend the level information. +When `transient-enable-popup-navigation' is non-nil then format + as a button." (let ((str (cl-call-next-method obj))) + (when (and (cl-typep obj 'transient-infix) + (eq (oref obj command) this-original-command)) + (setq str (transient--add-face (concat str "\n") + 'transient-active-infix))) (when transient--editp (setq str (concat (let ((level (oref obj level))) (propertize (format " %s " level) |
