diff --git a/NEWS.org b/NEWS.org index 2ed71721..7623284f 100644 --- a/NEWS.org +++ b/NEWS.org @@ -49,14 +49,17 @@ An old feature-request, finally implemented. (1.14.2) - In the message-view URLs/email addresses no longer automatically get an - indicator next to them; they appear only when you invoke + indicator next to them ([1],[2] etc.); these appear only when you invoke ~mu4e-view-go-to-url~ (~g~) or ~mu4e-view-save-url~ (~k~). However, you can set - ~mu4e-view-always-show-url-indicators~ to non-~nil~ to restore the old - behavior (1.14.3) + ~mu4e-view-always-show-url-indicators~ to non-~nil~ to restore the old behavior + (1.14.3) - In the message-view, now also generates HTML version for text-only messages, thus allowing for displaying them in external browser (1.14.3) + - Message "massaging" has been cleaned up an bit, with some non-working + options removed, and existing ones made to work better (1.14.3) + *** scm - added new ~--eval~ command-line option, so you can do e.g. diff --git a/mu4e/mu4e-view.el b/mu4e/mu4e-view.el index 289e0d0b..efcf0835 100644 --- a/mu4e/mu4e-view.el +++ b/mu4e/mu4e-view.el @@ -473,6 +473,10 @@ message." "Whether to show MIME part buttons (e.g. \"[1. text/html]\"). Toggle with `mu4e-view-toggle-mime-buttons'.") +(defvar mu4e--view-show-all-mime-parts nil + "Whether to display all MIME-parts. +Toggle with `mu4e-view-show-mime-parts'.") + (defun mu4e--original-article-field (field) "Get FIELD from the original article." (when (bufferp gnus-original-article-buffer) @@ -520,7 +524,9 @@ As a side-effect, a message that is being viewed loses its (append (list "multipart/signed" "multipart/encrypted" "multipart/alternative") gnus-buttonized-mime-types)) - (gnus-inhibit-mime-unbuttonizing mu4e--view-show-mime-buttons)) + (gnus-inhibit-mime-unbuttonizing mu4e--view-show-mime-buttons) + (gnus-mime-display-multipart-as-mixed + mu4e--view-show-all-mime-parts)) (erase-buffer) (insert-file-contents-literally (mu4e-message-readable-path msg) nil nil nil t) @@ -743,18 +749,17 @@ activates URLs (in plain-text mode only)." (mu4e-view msg))) (defun mu4e-view-show-mime-parts() - "Show all MIME-parts. + "Toggle display of all MIME-parts. -This can be useful for messages with embedded images etc. that -you want to save, and that are not accessible otherwise. However, -note that Emacs can get slow with big attached images. - -To go back to normal display, quit the message and re-open." +Showing all parts can be useful for messages with embedded images +etc. that you want to save, and that are not accessible otherwise. +However, note that Emacs can get slow with big attached images." (interactive) - (let* ((toggle (not gnus-mime-display-multipart-as-mixed)) - (gnus-inhibit-mime-unbuttonizing (not toggle)) - (gnus-mime-display-multipart-as-mixed toggle)) - (mu4e-view-refresh))) + (setq mu4e--view-show-all-mime-parts + (not mu4e--view-show-all-mime-parts)) + (mu4e-view-refresh) + (mu4e-message "All MIME parts %s" + (if mu4e--view-show-all-mime-parts "shown" "hidden"))) (defun mu4e-view-toggle-mime-buttons () "Toggle display of MIME part buttons and re-render." @@ -771,6 +776,18 @@ To go back to normal display, quit the message and re-open." (setq mm-fill-flowed (not mm-fill-flowed)) (mu4e-view-refresh)) +(defun mu4e-view-toggle-hide-citation () + "Toggle hiding of cited text in the message body. +Like `gnus-article-hide-citation', but keep point in place; if +point is inside cited text that gets hidden, move it just before +the hidden text." + (interactive) + (save-excursion (gnus-article-hide-citation)) + (when (get-char-property (point) 'invisible) + (goto-char (or (previous-single-char-property-change + (point) 'invisible) + (point-min))))) + (defun mu4e-view-toggle-emulate-mime() "Toggle GNUs MIME-emulation. Note that for some messages, this can trigger high CPU load." @@ -1133,28 +1150,27 @@ Based on Gnus' article-mode." ;;; Massaging the message view (defcustom mu4e-view-massage-options - '( ("ctoggle citations" . gnus-article-hide-citation) - ("htoggle headers" . gnus-article-hide-headers) - ("ytoggle crypto" . gnus-article-hide-pem) + '( ("ctoggle citations" . mu4e-view-toggle-hide-citation) ("ftoggle fill-flowed" . mu4e-view-toggle-fill-flowed) - ("btoggle MIME buttons" . mu4e-view-toggle-mime-buttons) - ("ntoggle URL numbers" . mu4e-view-toggle-url-numbers) - ("mtoggle show all MIME parts" . mu4e-view-show-mime-parts) - ("Mtoggle emulate MIME" . mu4e-view-toggle-emulate-mime)) + ("mtoggle show all MIME parts" . mu4e-view-show-mime-parts)) "Various options for \"massaging\" the message view. See `(gnus) -Article Treatment' for more options." +Article Treatment' for more options, e.g. +`gnus-article-hide-pem'. This is on a best-effort basis - not all +gnus toggles are supported in mu4e." :group 'mu4e-view :type '(alist :key-type string :value-type function)) -(defun mu4e-view-massage() - "Massage current message view as per `mu4e-view-massage-options'." - (interactive) - (funcall (mu4e-read-option "Massage: " mu4e-view-massage-options))) - (defvar-local mu4e--view-html-fallback nil "Non-nil if the view shows the shr-rendered html fallback. See `mu4e--view-render-html-fallback'.") +(defun mu4e-view-massage() + "Massage current message view as per `mu4e-view-massage-options'." + (interactive) + (when (or mu4e--view-html-fallback (mu4e--view-html-displayed-p)) + (mu4e-warn "Massage options not available for html display")) + (funcall (mu4e-read-option "Massage: " mu4e-view-massage-options))) + (defun mu4e--view-render-html-fallback () "Re-render the current message as html, using `shr'. This is used by `mu4e-view-toggle-html' for messages without a diff --git a/mu4e/mu4e.texi b/mu4e/mu4e.texi index b7595197..072a97b6 100644 --- a/mu4e/mu4e.texi +++ b/mu4e/mu4e.texi @@ -1367,12 +1367,12 @@ message body. Its major mode is @code{mu4e-view-mode}, which derives from @code{gnus-article-mode}. @menu -* Overview: MSGV Overview. What is the Message View -* Keybindings: MSGV Keybindings. Do things with your keyboard -* Rich-text and images: MSGV Rich-text and images. Reading rich-text messages -* Attachments and MIME-parts: MSGV Attachments and MIME-parts. Working with attachments and other MIME parts -* Custom headers: MSGV Custom headers. Your very own headers -* Actions: MSGV Actions. Defining and using actions +* Overview: MSGV Overview. What is the Message View. +* Keybindings: MSGV Keybindings. Do things with your keyboard. +* Rich-text and images: MSGV Rich-text and images. Reading rich-text messages. +* Attachments and MIME-parts: MSGV Attachments and MIME-parts. Working with attachments and other MIME parts. +* Custom headers: MSGV Custom headers. Your very own headers. +* Actions: MSGV Actions. Defining and using actions. * Detaching & reattaching: MSGV Detaching and reattaching. Multiple message views. * Mailing lists: MSGV Mailing lists. Subscribing and unsubscribing. @end menu @@ -1500,6 +1500,7 @@ J jump to MIME part by its number misc ---- +M ``massage'' various display options z, Z detach (or reattach) a message view to a headers buffer . show the raw message view. 'q' takes you back. C-+,C-- increase / decrease the number of headers shown @@ -1605,6 +1606,7 @@ Finally, for some message with big images it can be useful to enable buttons and full display, e.g. for saving inline images. For this you can try @kbd{M-x mu4e-view-show-mime-parts}. This can be a little slow. + @node MSGV Attachments and MIME-parts @section Attachments and MIME-parts @cindex attachments