GNU bug report logs - #69920
29.2; gnus: article-mode: Toggling MIME inline attachment previews adds superfluous newlines

Previous Next

Package: emacs;

Reported by: Alcor <alcor <at> tilde.club>

Date: Wed, 20 Mar 2024 18:11:02 UTC

Severity: normal

Found in version 29.2

Done: Eric Abrahamsen <eric <at> ericabrahamsen.net>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 69920 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alcor <alcor <at> tilde.club>
Cc: 69920 <at> debbugs.gnu.org
Subject: Re: bug#69920: Proposed fix - Toggling MIME inline attachment previews
 adds superfluous newlines
Date: Sat, 23 Mar 2024 08:59:27 +0200
> Date: Fri, 22 Mar 2024 23:25:20 +0100
> From:  Alcor via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> 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.

That commit explains the rationale:

  commit 14ff920dc885636a763d6ab7f256cc9981c24781
  Author:     Katsumi Yamaoka <yamaoka <at> jpl.org>
  AuthorDate: Fri May 2 09:44:34 2014 +0000
  Commit:     Katsumi Yamaoka <yamaoka <at> jpl.org>
  CommitDate: Fri May 2 09:44:34 2014 +0000

      Gnus: Make gnus-mime-inline-part and gnus-mime-inline-part work similarly

> FWIW, (insert-image … "x") (insert "\n") inserts two characters,
> i.e. the image itself "x" and "\n"

The code inserts the character "x" with a 'display' property on it
(which causes the image to be shown instead of "x"), followed by the
newline.

> so it should either be (insert "\n") … (delete-region b (+ 2 b)) or,
> alternatively just (delete-region b (1+ b)) (without any `insert'
> call).

Are you saying that the problem is with the function that
"un-displays" the inline image, in that it fails to remove the
inserted newline?  (AFAIU, the code before the above commit also had
the same issue.)  That wasn't clear from the description of the
problem, and the Subject is ambiguous wrt what newlines are deemed
"superfluous".  So please clarify what is the problem you are flagging
here.

Thanks.




This bug report was last modified 1 year and 25 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.