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

From: Alcor <[email-masked]>
Date: Fri, 22 Mar 2024 23:25:20 +0100

Tags: patch

Add patch available mark to bug (forgot to do that in the previous
message).

git blame'ing the line in question on yields a decade-old
commit. Apparently, this used to be (insert "\n\n") … (delete-region b
(+ b 2)) about ~10 years ago, and the last relevant change turned that
into (insert "\n") … (delete-region b (1+ b)), but it seems lots of
other things on that codepath changed in the meantime.

FWIW, (insert-image … "x") (insert "\n") inserts two characters,
i.e. the image itself "x" and "\n", so it should either be (insert "\n")
… (delete-region b (+ 2 b)) or, alternatively just (delete-region b (1+
b)) (without any `insert' call).