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

Previous Next

Package: emacs;

Reported by: "Philip K." <philip <at> warpmail.net>

Date: Fri, 10 Jul 2020 15:44:02 UTC

Severity: normal

Tags: fixed, patch

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "Philip K." <philip <at> warpmail.net>
To: 42311 <at> debbugs.gnu.org
Subject: bug#42311: [PATCH] Wrap skeleton logic in atomic-change-group
Date: Fri, 10 Jul 2020 17:43:07 +0200
[Message part 1 (text/plain, inline)]
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.

[0001-Wrap-skeleton-logic-in-atomic-change-group.patch (text/x-diff, inline)]
From c6dfdffa25e3d64f78f261b4b536dfae4f02a040 Mon Sep 17 00:00:00 2001
From: Philip K <philip <at> warpmail.net>
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


This bug report was last modified 4 years and 292 days ago.

Previous Next


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