From a2c27c0c5a8baf834d7c71fc2463dfdc305297d4 Mon Sep 17 00:00:00 2001 From: djcb Date: Sat, 27 Apr 2019 08:38:53 +0300 Subject: [PATCH] mu4e: construct attach map even when not showing header This is a bit of hack, but solves the problem; even when not _showing_ the attachments-header, construct the corresponding map, so the keybindings work. --- mu4e/mu4e-view.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mu4e/mu4e-view.el b/mu4e/mu4e-view.el index 177a1ed9..0da6e0ad 100644 --- a/mu4e/mu4e-view.el +++ b/mu4e/mu4e-view.el @@ -316,6 +316,12 @@ Depending on the value of `mu4e-view-use-gnus', either use mu4e's internal display mode, or a display mode based on Gnu's article-mode." (mu4e~view-define-mode) + + ;; XXX(djcb): only called for the side-effect of setting up + ;; `mu4e~view-attach-map'. Instead, we should split that function + ;; into setting up the map, and actually producing the header. + (mu4e~view-construct-attachments-header msg) + ;; When MSG is unread, mu4e~view-mark-as-read-maybe will trigger ;; another call to mu4e-view (via mu4e~headers-update-handler as ;; the reply handler to mu4e~proc-move) @@ -1188,7 +1194,7 @@ the attachment; otherwise (MULTI is non-nil), accept ranges of attachment numbers, as per `mu4e-split-ranges-to-numbers', and return the corresponding string." (let* ((count (hash-table-count mu4e~view-attach-map)) (def)) - (when (zerop count) (mu4e-error "No attachments for this message")) + (when (zerop count) (mu4e-warn "No attachments for this message")) (if (not multi) (if (= count 1) (read-number (mu4e-format "%s: " prompt) 1)