mu4e: fix mu4e--main-action alt

As per #2439.
This commit is contained in:
Dirk-Jan C. Binnema 2023-03-30 23:54:42 +03:00
parent 631abbccd1
commit b9d23d34e7
1 changed files with 5 additions and 3 deletions

View File

@ -178,6 +178,7 @@ the reasonable thing in most cases. Still, such a rebinding
;; reset the baseline and get updated results.
(mu4e--query-items-refresh 'reset-baseline))))
(defun mu4e--main-action (title cmd &optional bindstr alt)
"Produce main view action string with TITLE.
@ -187,12 +188,13 @@ In the result, used the TITLE string, with the first occurrence
of [@] replaced by a textual replacement of a binding to CMD as
per `mu4e-key-description', or, if specified, BINDSTR.
If ALT is specified, and BINDSTR is longer than a single character,
use ALT as a substitute.
If a string ALT is specified, and BINDSTR is longer than a single
character, use ALT as a substitute. ALT should be a string of
length 1.
If the first letter after the [@] is equal to the last letter of the
binding representation, remove that first letter."
(let* ((bindstr (or bindstr (mu4e-key-description cmd) (and alt (string alt))
(let* ((bindstr (or bindstr (mu4e-key-description cmd) alt
(mu4e-error "No binding for %s" cmd)))
(bindstr
(if (and alt (> (length bindstr) 1)) alt bindstr))