From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alcor via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#69920: Proposed fix - Toggling MIME inline attachment previews adds superfluous newlines Date: Mon, 22 Apr 2024 14:42:09 +0200 Message-ID: <875xw9y3fi.fsf@tilde.club> References: <87wmpuouay.fsf@tilde.club> <87y1a952gf.fsf@tilde.club> <86sf0hzb5c.fsf@gnu.org> <874jcxmfzh.fsf@tilde.club> <86bk75z1un.fsf@gnu.org> <864jce50ju.fsf@gnu.org> <86bk67f3kq.fsf@gnu.org> <87sezejeoh.fsf@ericabrahamsen.net> Reply-To: Alcor Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27350"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 69920@debbugs.gnu.org, Eli Zaretskii To: Eric Abrahamsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 22 14:43:05 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ryt0j-0006uV-Ay for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 22 Apr 2024 14:43:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ryt0S-00061n-0o; Mon, 22 Apr 2024 08:42:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ryt0Q-00061C-Hd for bug-gnu-emacs@gnu.org; Mon, 22 Apr 2024 08:42:46 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ryt0Q-00044L-Aj for bug-gnu-emacs@gnu.org; Mon, 22 Apr 2024 08:42:46 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ryt0g-00022T-4y for bug-gnu-emacs@gnu.org; Mon, 22 Apr 2024 08:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alcor Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 Apr 2024 12:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69920 X-GNU-PR-Package: emacs Original-Received: via spool by 69920-submit@debbugs.gnu.org id=B69920.17137897577785 (code B ref 69920); Mon, 22 Apr 2024 12:43:02 +0000 Original-Received: (at 69920) by debbugs.gnu.org; 22 Apr 2024 12:42:37 +0000 Original-Received: from localhost ([127.0.0.1]:45918 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryt0H-00021V-8G for submit@debbugs.gnu.org; Mon, 22 Apr 2024 08:42:37 -0400 Original-Received: from tilde.club ([142.44.150.184]:54128 ident=postfix) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryt0E-00021N-Jd for 69920@debbugs.gnu.org; Mon, 22 Apr 2024 08:42:35 -0400 Original-Received: from topazii.tilde.club (unknown [IPv6:2001:9e8:7e0:db00:6372:d642:7ea3:be0c]) by tilde.club (Postfix) with ESMTPSA id 95E0D22565566; Mon, 22 Apr 2024 12:42:16 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 tilde.club 95E0D22565566 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tilde.club; s=mail; t=1713789737; bh=yl7ht51Hyel9C1Zl3iYcrB0JEMSH/LId5Gtudl/xsaY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=TMMlpHi0aCN3hQIVxhSZ3vEulSQSC6jFORU6R3TUpGTWChd0rOqH7wWaJ0t35G5Ww lmQw1XGXWefAhYtaag/Koxa1mi0JoMZd7YrkYogN1ESRl7lmLWWf8iq48z2C7W7ZKu FuH6jw8ucDrxIgaVWdoiBBAGX9CLNkGgULI3McTs= In-Reply-To: <87sezejeoh.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Sun, 21 Apr 2024 19:48:14 -0700") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:283825 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Eric Abrahamsen writes: > I also prefer #2, mostly because the other `mm-inline-*' functions here > all ensure that inlined content ends with a newline, and even if there's > no immediate consequence to not having it, I'd prefer the consistency. > Alcor, would you be willing to update your patch? Hello Eric, Eli =E2=80=93 Attached is an updated patch adjusting the `delete-region' call in the undisplayer to account for the additional newline, as discussed earlier. I have tested this change on Emacs 29.3 (Linux/GTK) with multiple image/png attachments and can confirm it works. Cheers, -A. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Ensure-that-inline-preview-undisplayer-removes-added.patch >From 31578f2c8d538eb4b944c073d4804f355f88f035 Mon Sep 17 00:00:00 2001 From: "F. Moukayed" Date: Mon, 22 Apr 2024 12:33:08 +0000 Subject: [PATCH] Ensure that inline preview undisplayer removes added newline * lisp/gnus/mm-view.el (mm-inline-image): Remove the regioninterval b..b+2 (aka "x\n") instead of removing b..b+1 ("x") and leaving behind a superfluous newline (bug#69920). --- lisp/gnus/mm-view.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el index 109b6c17c2..223da19a16 100644 --- a/lisp/gnus/mm-view.el +++ b/lisp/gnus/mm-view.el @@ -105,7 +105,7 @@ This is only used if `mm-inline-large-images' is set to (lambda () (let ((inhibit-read-only t)) (remove-images b b) - (delete-region b (1+ b))))))) + (delete-region b (+ b 2))))))) (defvar mm-w3m-setup nil "Whether gnus-article-mode has been setup to use emacs-w3m.") -- 2.34.1 --=-=-=--