unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Alcor <alcor@tilde.club>
Cc: 69920@debbugs.gnu.org
Subject: bug#69920: Proposed fix - Toggling MIME inline attachment previews adds superfluous newlines
Date: Sat, 23 Mar 2024 08:59:27 +0200	[thread overview]
Message-ID: <86sf0hzb5c.fsf@gnu.org> (raw)
In-Reply-To: <87y1a952gf.fsf@tilde.club> (bug-gnu-emacs@gnu.org)

> 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@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@jpl.org>
  AuthorDate: Fri May 2 09:44:34 2014 +0000
  Commit:     Katsumi Yamaoka <yamaoka@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.





  reply	other threads:[~2024-03-23  6:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-20 17:59 bug#69920: 29.2; gnus: article-mode: Toggling MIME inline attachment previews adds superfluous newlines Alcor via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-22 21:01 ` bug#69920: Proposed fix - " Alcor via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-22 22:25   ` Alcor via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-23  6:59     ` Eli Zaretskii [this message]
2024-03-23  9:53       ` Alcor via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-23 10:20         ` Eli Zaretskii
2024-04-06  8:59           ` Eli Zaretskii
2024-04-18  9:00             ` Eli Zaretskii
2024-04-22  2:48               ` Eric Abrahamsen
2024-04-22 12:42                 ` Alcor via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-22 14:58                   ` bug#69920: 29.2; gnus: article-mode: " Eric Abrahamsen
2024-03-23  6:52   ` bug#69920: Proposed fix - " Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86sf0hzb5c.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=69920@debbugs.gnu.org \
    --cc=alcor@tilde.club \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).