From 5e026c41afe0343f739c3d4fcd8783e75a022d9e Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Mon, 20 Apr 2026 21:54:27 +0300 Subject: mu4e-view: avoid cleaning up too much In mu4e--view-cleanup-message-text (used for "reply citing") we were removing all gnus "buttons", however gnus also includes buttons for addresses, URLs etc., which should stay. So be a bit let eager and only remove gnus-mm-display-part items. Issue #2922 --- mu4e/mu4e-view.el | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/mu4e/mu4e-view.el b/mu4e/mu4e-view.el index 7ee4761..5c79e79 100644 --- a/mu4e/mu4e-view.el +++ b/mu4e/mu4e-view.el @@ -517,20 +517,19 @@ As a side-effect, a message that is being viewed loses its (goto-char (point-min))))) (defun mu4e--view-cleanup-message-text () - "Clean up the rendered-message for use as cited text. + "Clean up the rendered message for use as cited text in replies. -This expects to be called while in that message buffer. +In particular, strip Gnus MIME-part buttons (e.g. attachment +lines like \"[2. foo.pdf --- application/pdf; foo.pdf]\") so +they do not end up in cited replies. -Strip Gnus MIME-part buttons (e.g. attachment lines like \"[2. -foo.pdf --- application/pdf; foo.pdf]\") so they do not end up in -cited replies. - -The buttons are identified via the -`gnus-callback' text property that Gnus puts on them, rather than -by matching their textual format." +This expects to be called while in that message buffer." (let ((pos (point-min)) start) - (while (setq start (text-property-not-all - pos (point-max) 'gnus-callback nil)) + (while (setq start (text-property-any + pos (point-max) + ;; filter out gnus-mm-display-part, not + ;; _all_ buttons (#2922) + 'gnus-callback 'gnus-mm-display-part)) (let* ((end (or (next-single-property-change start 'gnus-callback nil (point-max)) (point-max))) -- cgit v1.0