From 7da468ef9d492d5e95853bd3871317bdc5feea21 Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Mon, 20 Nov 2023 20:11:54 +0100 Subject: [PATCH] transient-format(around:suffix): Absorb around:infix method --- lisp/transient.el | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/lisp/transient.el b/lisp/transient.el index 8a030c82..0e9d94cc 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)