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: Fri, 22 Mar 2024 23:25:20 +0100 Message-ID: <87y1a952gf.fsf@tilde.club> References: <87wmpuouay.fsf@tilde.club> Reply-To: Alcor Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7954"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: 69920@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 23 00:40:43 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 1rnoV8-0001rz-Tc for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 23 Mar 2024 00:40:42 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rnoUo-0006Zs-JB; Fri, 22 Mar 2024 19:40:22 -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 1rnoUn-0006Ze-Fu for bug-gnu-emacs@gnu.org; Fri, 22 Mar 2024 19:40: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 1rnoUn-0001Wj-87 for bug-gnu-emacs@gnu.org; Fri, 22 Mar 2024 19:40:21 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rnoVR-0005HB-OC for bug-gnu-emacs@gnu.org; Fri, 22 Mar 2024 19:41:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alcor Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 22 Mar 2024 23:41:01 +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.171115082020126 (code B ref 69920); Fri, 22 Mar 2024 23:41:01 +0000 Original-Received: (at 69920) by debbugs.gnu.org; 22 Mar 2024 23:40:20 +0000 Original-Received: from localhost ([127.0.0.1]:58190 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rnoUl-0005ER-8C for submit@debbugs.gnu.org; Fri, 22 Mar 2024 19:40:20 -0400 Original-Received: from tilde.club ([142.44.150.184]:50012 ident=postfix) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rnnur-0003Gd-Mx for 69920@debbugs.gnu.org; Fri, 22 Mar 2024 19:03:14 -0400 Original-Received: from topazii.tilde.club (unknown [IPv6:2001:9e8:7cd:5200:bbe8:2b24:626f:ac56]) by tilde.club (Postfix) with ESMTPSA id 3D07D2213F7A6 for <69920@debbugs.gnu.org>; Fri, 22 Mar 2024 22:25:35 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 tilde.club 3D07D2213F7A6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tilde.club; s=mail; t=1711146335; bh=dkBXo7j14ZmK1gYfT+zCTMBeXK0ppGOQXejSJffctso=; h=From:To:Subject:In-Reply-To:References:Date:From; b=efcg99h4i6hD4OZx0aHy74Z9AvP5/ChvNUU7jMIcIY7V/NF5v3ZgcuwyzInDmBcEU uMCop1uNEYK4Tjc6AEwE+mLg4UKr3YtLjFuWe8V8gWc6h9nbeD5eOb7H0P8zoqCbHh uyY8fzzwLm00qY8H/JeSMbQpLEjM9g0Zn+LHVqEo= In-Reply-To: <87wmpuouay.fsf@tilde.club> (alcor@tilde.club's message of "Fri, 22 Mar 2024 22:01:09 +0100") 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:281959 Archived-At: 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") =E2=80=A6 (delete-regio= n b (+ b 2)) about ~10 years ago, and the last relevant change turned that into (insert "\n") =E2=80=A6 (delete-region b (1+ b)), but it seems lots of other things on that codepath changed in the meantime. FWIW, (insert-image =E2=80=A6 "x") (insert "\n") inserts two characters, i.e. the image itself "x" and "\n", so it should either be (insert "\n") =E2=80=A6 (delete-region b (+ 2 b)) or, alternatively just (delete-region b= (1+ b)) (without any `insert' call).