From 57f36666cf322fbe8cda894b860aa7a299bdedd5 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Sat, 18 Apr 2026 21:10:39 +0300 Subject: mu4e-view: improve html/text toggling Fix the mu4e-view-toggle-html switching, which could re-insert body parts when an Attachments: header was present. I.e. specifically toggle the part in the body. --- mu4e/mu4e-view.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mu4e/mu4e-view.el b/mu4e/mu4e-view.el index 2b9dda2..7ee4761 100644 --- a/mu4e/mu4e-view.el +++ b/mu4e/mu4e-view.el @@ -1091,8 +1091,12 @@ corresponding Gnus selector button in the buffer." (lambda (h) (equal (mm-handle-media-type h) "text/plain")) children)) (target (if (mm-handle-displayed-p html) plain html)) - (pos (text-property-any (point-min) (point-max) - 'gnus-data target))) + ;; Search from the body (this avoids find the wrong + ;; `gnus-data' in the Attachments: header, if any. + (pos (save-excursion + (article-goto-body) + (text-property-any (point) (point-max) + 'gnus-data target)))) (progn (goto-char pos) (gnus-article-press-button) -- cgit v1.0