From c70d4b70d25c3c9fa6e2e41d4133593cbf4240f2 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Sun, 12 Feb 2023 11:07:42 +0200 Subject: [PATCH] mu4e-main: better handle :name workaround for maildirs Distinguish between the lambda and normal activation functions. --- mu4e/mu4e-main.el | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/mu4e/mu4e-main.el b/mu4e/mu4e-main.el index e16ad9aa..8e6f2ded 100644 --- a/mu4e/mu4e-main.el +++ b/mu4e/mu4e-main.el @@ -202,12 +202,16 @@ for aligning them." ;; hide items explicitly hidden, without key or wrong category. (if hide "" - (let ((qfunc-pair + (let ((item-info + ;; note, we have a function for the binding, + ;; and perhaps a different one for the lambda. (cond ((eq item-type 'maildirs) - (cons #'mu4e-search query)) + (list #'mu4e-search-maildir #'mu4e-search + query)) ((eq item-type 'bookmarks) - (cons #'mu4e-search-bookmark (mu4e-get-bookmark-query key))) + (list #'mu4e-search-bookmark #'mu4e-search-bookmark + (mu4e-get-bookmark-query key))) (t (mu4e-error "Invalid item-type %s" item-type))))) (concat @@ -220,9 +224,10 @@ for aligning them." 'help-echo query)) ;; function to call when activated (lambda () (interactive) - (funcall (car qfunc-pair) (cdr qfunc-pair))) + (funcall (nth 1 item-info) + (nth 2 item-info))) ;; custom key binding string - (concat (mu4e-key-description (car qfunc-pair)) (string key))) + (concat (mu4e-key-description (nth 0 item-info)) (string key))) ;; counts (format "%s%s\n" (make-string (- max-length (string-width name)) ?\s)