GNU bug report logs - #42311
[PATCH] Wrap skeleton logic in atomic-change-group

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: "Philip K." <philip@HIDDEN>; Keywords: fixed patch; Done: Lars Ingebrigtsen <larsi@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug marked as fixed in version 28.1, send any further explanations to 42311 <at> debbugs.gnu.org and "Philip K." <philip@HIDDEN> Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 42311 <at> debbugs.gnu.org:


Received: (at 42311) by debbugs.gnu.org; 5 Aug 2020 14:08:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 05 10:08:51 2020
Received: from localhost ([127.0.0.1]:51886 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1k3K67-0002rb-9n
	for submit <at> debbugs.gnu.org; Wed, 05 Aug 2020 10:08:51 -0400
Received: from quimby.gnus.org ([95.216.78.240]:42246)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1k3K64-0002rL-QN
 for 42311 <at> debbugs.gnu.org; Wed, 05 Aug 2020 10:08:49 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=3RFgBWXhccpZSDAtzMovlZ1UMTfIfFo+UF46K1crq4Q=; b=O0Fx/EzriU8yS4DafIFwF/TJs1
 ZSST3fLmBYYt4t/73ok6uRGxGFV6C0d9wqFGlgtE8LHCnTSSBVJdcEMveBxqkGOqZ0EdPnQKpSYE4
 bImIyZb3ISIKBbSP6zwHHMHQJwDclr7+g5wbADAaUaO8jW38G4ZsBnknqqDBnXLBTPHU=;
Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo)
 by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1k3K5w-0005WV-0K; Wed, 05 Aug 2020 16:08:42 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: "Philip K." <philip@HIDDEN>
Subject: Re: bug#42311: [PATCH] Wrap skeleton logic in atomic-change-group
References: <87v9ivfkac.fsf@HIDDEN>
Date: Wed, 05 Aug 2020 16:08:38 +0200
In-Reply-To: <87v9ivfkac.fsf@HIDDEN> (Philip K.'s message of "Fri, 10
 Jul 2020 17:43:07 +0200")
Message-ID: <873651kwwp.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: "Philip K." <philip@HIDDEN> writes: > I'm not sure if
 this is intended, but when expanding a skeleton > (e.g. using sgml-tag),
 I sometimes change my mind and press C-g. I'm > then left with a half finished
 HTML tag, like for example > > [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 42311
Cc: 42311 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

"Philip K." <philip@HIDDEN> writes:

> I'm not sure if this is intended, but when expanding a skeleton
> (e.g. using sgml-tag), I sometimes change my mind and press C-g. I'm
> then left with a half finished HTML tag, like for example
>
>      <a id="
>
> that is really never intended. The patch below ensures that all
> skeletons are either inserted correctly, or cleaned up as part of an
> atomic change group.

[...]

> -       (skeleton-proxy-new ',skeleton str arg))))
> +       (atomic-change-group
> +         (skeleton-proxy-new ',skeleton str arg)))))

Thanks.

I'm not a heavy user of skeletons, but this looks sensible to me, so
I've applied it to Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#42311; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 10 Jul 2020 15:43:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 10 11:43:17 2020
Received: from localhost ([127.0.0.1]:43279 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jtvBF-0006Hb-3m
	for submit <at> debbugs.gnu.org; Fri, 10 Jul 2020 11:43:17 -0400
Received: from lists.gnu.org ([209.51.188.17]:38168)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philip@HIDDEN>) id 1jtvBC-0006HT-Hg
 for submit <at> debbugs.gnu.org; Fri, 10 Jul 2020 11:43:15 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:33484)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <philip@HIDDEN>)
 id 1jtvBC-0001S4-1u
 for bug-gnu-emacs@HIDDEN; Fri, 10 Jul 2020 11:43:14 -0400
Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:36433)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <philip@HIDDEN>)
 id 1jtvBA-0007oX-06
 for bug-gnu-emacs@HIDDEN; Fri, 10 Jul 2020 11:43:13 -0400
Received: from compute2.internal (compute2.nyi.internal [10.202.2.42])
 by mailout.west.internal (Postfix) with ESMTP id 60BE8861
 for <bug-gnu-emacs@HIDDEN>; Fri, 10 Jul 2020 11:43:10 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute2.internal (MEProxy); Fri, 10 Jul 2020 11:43:10 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=warpmail.net; h=
 from:to:subject:date:message-id:mime-version:content-type; s=
 fm3; bh=L+Mn7X6oiFQxPksptJqJv8dj/phvUibw50qmBtBLE0A=; b=lPCgOSIL
 +ycIIxTpiQAXY3h1Z1rsvgmPjzwnlHbPAKxQUIUwE7VR6X0pqaabZ+BGy1MEUiYl
 Bj1c0iw39I2encp/pnsbs4nLGlO0QrMdJl8phIa72ZFXTdNlc3iUP5jhohxkNTWH
 gAm15iryli7lUy46U7TYc5KbDlyNRslOqRu8ptUHOHxjUIw/YT8y8UFIFkqDWT1c
 ziyqMPRtFk8CMA5is/34+ZHvxYNcHbzeoWFzDljw5v9cSDjT9iwgDgsjGetm99Wc
 6X+/Oa1VT6wiQxP6CcmjDCz1lPOom48hSn/19iRGZEkybw2osc9HD87wODBc9zd/
 sILLJI9m6wfGDQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=content-type:date:from:message-id
 :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender
 :x-me-sender:x-sasl-enc; s=fm3; bh=L+Mn7X6oiFQxPksptJqJv8dj/phvU
 ibw50qmBtBLE0A=; b=LMXNwkTX0XPSdj+1YzuoNFD8OIL95xKIZoJPamqMncKOd
 7GqBqZpIBwHsCJd2TAyAA8cLGf/g3zKdhGGBJzjzXhuIfF5pBRX7QMImC//Qm6fK
 dyokGjBee22VMeqOvOX9lxUEOztNqFxELbH5VfHPk9oCbn8aoEJy2W0sjMOVU0dP
 e+QsNEnvGPRA/ZFaK/rMlKddsCE4jT2hU3fum0oOUWJkGrQcO4g4xkkpStBgueYg
 DsuyKtEyWjS1BxJXpOcHLIGYj2RYw75pM8m3tnOWHZEDPLasT9p00QhVe92EvTxY
 szBZD9coUdB+Tjqddf0oxK7ESodEpjdvb9OuJlfJw==
X-ME-Sender: <xms:jYwIX0E4qT9NDJ5exdJkNykC_Smb910U6Qvji3m7dY3pWPKW9qqz_A>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrvddugdeljecutefuodetggdotefrodftvf
 curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
 uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkfggtgesmhdtreertddttd
 enucfhrhhomhepfdfrhhhilhhiphcumfdrfdcuoehphhhilhhiphesfigrrhhpmhgrihhl
 rdhnvghtqeenucggtffrrghtthgvrhhnpefgtdduhfdtleetjeeihedtkeejgfejgffftd
 etkeeftddvtefghfejvdeltdejfeenucfkphepkeejrddugeehrddugedrudejgeenucev
 lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehphhhilhhiph
 esfigrrhhpmhgrihhlrdhnvght
X-ME-Proxy: <xmx:jYwIX9V1eaXP4mv5473dR-VjPGHuFxl44h_hkr5s6q6xoVjRuSc9tQ>
 <xmx:jYwIX-LhUOLBLDg_xZs-_gYD8P7z_iVzCPEilogRswCjR5CRuAyKQg>
 <xmx:jYwIX2GlnIS38ywaChmf7cxJdhIy9PfnPuEkz34M-nYNzeHdKIHOUA>
 <xmx:jowIXzWlnn4dN8JwPysaecCziGHoTz1haUbDO9EXYewd1PCzAguO1g>
Received: from localhost (p57910eae.dip0.t-ipconnect.de [87.145.14.174])
 by mail.messagingengine.com (Postfix) with ESMTPA id 5755630600B2
 for <bug-gnu-emacs@HIDDEN>; Fri, 10 Jul 2020 11:43:09 -0400 (EDT)
From: "Philip K." <philip@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH] Wrap skeleton logic in atomic-change-group
Date: Fri, 10 Jul 2020 17:43:07 +0200
Message-ID: <87v9ivfkac.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=64.147.123.21; envelope-from=philip@HIDDEN;
 helo=wout5-smtp.messagingengine.com
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/10 11:43:10
X-ACL-Warn: Detected OS   = Linux 2.2.x-3.x [generic] [fuzzy]
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01,
 SPF_HELO_PASS=-0.001, SPF_PASS=-0.001,
 URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.4 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

--=-=-=
Content-Type: text/plain


I'm not sure if this is intended, but when expanding a skeleton
(e.g. using sgml-tag), I sometimes change my mind and press C-g. I'm
then left with a half finished HTML tag, like for example

     <a id="

that is really never intended. The patch below ensures that all
skeletons are either inserted correctly, or cleaned up as part of an
atomic change group.

I didn't thoroughly investigate each instance of define-skeleton I could
find, but from skimming the places I found examples, it seems like this
change shouldn't break any expected behaviour.

-- 
	Philip K.


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline;
 filename=0001-Wrap-skeleton-logic-in-atomic-change-group.patch

From c6dfdffa25e3d64f78f261b4b536dfae4f02a040 Mon Sep 17 00:00:00 2001
From: Philip K <philip@HIDDEN>
Date: Fri, 10 Jul 2020 17:37:02 +0200
Subject: [PATCH] Wrap skeleton logic in atomic-change-group

---
 lisp/skeleton.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/skeleton.el b/lisp/skeleton.el
index 8c694c128b..3609d6ba6a 100644
--- a/lisp/skeleton.el
+++ b/lisp/skeleton.el
@@ -135,7 +135,8 @@ define-skeleton
 A prefix argument of zero says to wrap around zero words---that is, nothing.
 This is a way of overriding the use of a highlighted region.")
        (interactive "*P\nP")
-       (skeleton-proxy-new ',skeleton str arg))))
+       (atomic-change-group
+         (skeleton-proxy-new ',skeleton str arg)))))
 
 ;;;###autoload
 (defun skeleton-proxy-new (skeleton &optional str arg)
-- 
2.20.1


--=-=-=--




Acknowledgement sent to "Philip K." <philip@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#42311; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 5 Aug 2020 14:15:02 UTC

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