all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Philip K." <philip@warpmail.net>
To: 42311@debbugs.gnu.org
Subject: bug#42311: [PATCH] Wrap skeleton logic in atomic-change-group
Date: Fri, 10 Jul 2020 17:43:07 +0200	[thread overview]
Message-ID: <87v9ivfkac.fsf@warpmail.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 571 bytes --]


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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Wrap-skeleton-logic-in-atomic-change-group.patch --]
[-- Type: text/x-diff, Size: 845 bytes --]

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	other threads:[~2020-07-10 15:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-10 15:43 Philip K. [this message]
2020-08-05 14:08 ` bug#42311: [PATCH] Wrap skeleton logic in atomic-change-group Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v9ivfkac.fsf@warpmail.net \
    --to=philip@warpmail.net \
    --cc=42311@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.