summaryrefslogtreecommitdiff
path: root/mu4e/mu4e-view.el
diff options
context:
space:
mode:
authorDirk-Jan C. Binnema <djcb@djcbsoftware.nl>2026-04-20 21:54:27 +0300
committerDirk-Jan C. Binnema <djcb@djcbsoftware.nl>2026-04-20 21:54:27 +0300
commit5e026c41afe0343f739c3d4fcd8783e75a022d9e (patch)
tree1a26ad4bb40fb6ecc7796e25598e47e30146f74c /mu4e/mu4e-view.el
parent78bca92578877e0833658078cadb0bb31a26ee79 (diff)
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
Diffstat (limited to 'mu4e/mu4e-view.el')
-rw-r--r--mu4e/mu4e-view.el21
1 files 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)))