From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#69920: Proposed fix - Toggling MIME inline attachment previews adds superfluous newlines Date: Sat, 23 Mar 2024 08:59:27 +0200 Message-ID: <86sf0hzb5c.fsf@gnu.org> References: <87wmpuouay.fsf@tilde.club> <87y1a952gf.fsf@tilde.club> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19649"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 69920@debbugs.gnu.org To: Alcor Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 23 08:10:03 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 1rnvVy-0004oj-Qj for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 23 Mar 2024 08:10:02 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rnvVL-0005hM-2j; Sat, 23 Mar 2024 03:09:23 -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 1rnvVJ-0005go-Uu for bug-gnu-emacs@gnu.org; Sat, 23 Mar 2024 03:09:21 -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 1rnvVJ-0008Oq-Lj for bug-gnu-emacs@gnu.org; Sat, 23 Mar 2024 03:09:21 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rnvVy-0001k1-Cq for bug-gnu-emacs@gnu.org; Sat, 23 Mar 2024 03:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Mar 2024 07:10: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.17111777586561 (code B ref 69920); Sat, 23 Mar 2024 07:10:02 +0000 Original-Received: (at 69920) by debbugs.gnu.org; 23 Mar 2024 07:09:18 +0000 Original-Received: from localhost ([127.0.0.1]:58870 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rnvVF-0001hi-HF for submit@debbugs.gnu.org; Sat, 23 Mar 2024 03:09:17 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55116) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rnvV9-0001gh-Nf for 69920@debbugs.gnu.org; Sat, 23 Mar 2024 03:09:12 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rnvLm-0006jy-UN; Sat, 23 Mar 2024 02:59:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=qJ2GmKxjvRxda/1x6PcPjMnnmSkaYZyBrExiiLfZAqc=; b=QhtePOtv0/MRJCKTsRse +JvAx2oeL0HcH705Fy16Oj5+12zYywjTNgBIXkQ4FFHGd249jmMhelwXLXcQXw/aniDc+SF3H+9gZ qOWbH8hXlFTwsOsEsV6Gjd3r4JNbFCH/gqAWdu9xN19NjOTOPCGf9W1YYG9QPB5x5yfay4oWbC2nc yxsJ6f2OG9ExQbDqZT0b5dvDxJySQBruf+zGfaUzuaBjUKn845kZcuG87Wtxt+YtVFHDhMQzRPr2x Y0ga62EfoPv7DBDvvSXdb4/Hj+yNdPjCLUZm3z29IW55qWMumrJsShTMVyNjVdoezCSYHO/b8DdYI Wi/051oxnl4PAQ==; In-Reply-To: <87y1a952gf.fsf@tilde.club> (bug-gnu-emacs@gnu.org) 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:281966 Archived-At: > Date: Fri, 22 Mar 2024 23:25:20 +0100 > From: Alcor via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > 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 AuthorDate: Fri May 2 09:44:34 2014 +0000 Commit: Katsumi Yamaoka 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.