Subject: Proposed fix - Toggling MIME inline attachment previews adds superfluous newlines

From: Alcor <[email-masked]>
Date: Fri, 22 Mar 2024 22:01:09 +0100

Hi Emacs maintainers,

After some investigation, I noticed that `mm-inline-image' adds a
newline via (insert "\n") directly after `insert-image' for unclear
reasons.

Removing the (insert "\n") form seems to resolve the issue (along with
the other issues mentioned under "Additionally, the following can be
observed") in the initial bug report message.

A patch is included illustrating the change made, but I'm unfamiliar
with the gnus codebase. It would be great if somebody more experienced
took a look.

Cheers,
-A.

>From f04178b25010f1a91094bea6b4a0fcbc590b14b0 Mon Sep 17 00:00:00 2001
From: "F. Moukayed" <[email-masked]>
Date: Fri, 22 Mar 2024 20:46:21 +0000
Subject: [PATCH] Do not add a superfluous newline after `insert-image'.

* lisp/gnus/mm-view.el (mm-inline-image): Remove unnecessary (insert "\n") to resolve issues with toggling inline attachment previews (bug#69920).
---
 lisp/gnus/mm-view.el | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el
index 3a71920..50636de 100644
--- a/lisp/gnus/mm-view.el
+++ b/lisp/gnus/mm-view.el
@@ -99,7 +99,6 @@ This is only used if `mm-inline-large-images' is set to
 				 (- (nth 3 edges) (nth 1 edges)))))))
          image))
      "x")
-    (insert "\n")
     (mm-handle-set-undisplayer
      handle
      (lambda ()
-- 
2.34.1