From b9d23d34e7905a8f501692472c962963a011704e Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Thu, 30 Mar 2023 23:54:42 +0300 Subject: [PATCH] mu4e: fix mu4e--main-action alt As per #2439. --- mu4e/mu4e-main.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mu4e/mu4e-main.el b/mu4e/mu4e-main.el index 3e1a24fd..33731f5a 100644 --- a/mu4e/mu4e-main.el +++ b/mu4e/mu4e-main.el @@ -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))