bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#42311: [PATCH] Wrap skeleton logic in atomic-change-group


From: Philip K.
Subject: bug#42311: [PATCH] Wrap skeleton logic in atomic-change-group
Date: Fri, 10 Jul 2020 17:43:07 +0200

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.

>From c6dfdffa25e3d64f78f261b4b536dfae4f02a040 Mon Sep 17 00:00:00 2001
From: Philip K <philip@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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]