>From 4e25d3ba7ee1b6399d544cc32d9e10a63ab6a1d7 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Sun, 28 Aug 2022 14:14:04 +0200 Subject: [PATCH] * tex.el (TeX-insert-macro): Use 'atomic-change-group' If the user aborts the command, we avoid keeping behind a partial state by reverting all changes that might have made. --- tex.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tex.el b/tex.el index e7a1fd0f..3a8cd140 100644 --- a/tex.el +++ b/tex.el @@ -3337,8 +3337,9 @@ is called with \\[universal-argument]." 'TeX-macro-history TeX-default-macro)))) (when (called-interactively-p 'any) (setq TeX-default-macro symbol)) - (TeX-parse-macro symbol (cdr-safe (assoc symbol (TeX-symbol-list)))) - (run-hooks 'TeX-after-insert-macro-hook)) + (atomic-change-group + (TeX-parse-macro symbol (cdr-safe (assoc symbol (TeX-symbol-list)))) + (run-hooks 'TeX-after-insert-macro-hook))) (defvar TeX-electric-macro-map (let ((map (make-sparse-keymap))) -- 2.37.2