branch: externals/auctex
commit 56b081e241971ab497a669524b04f89dd9e6d8c7
Author: Philip Kaludercic <phil...@posteo.net>
Commit: Tassilo Horn <t...@gnu.org>

    * 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 1497f2281c..350d9e9003 100644
--- a/tex.el
+++ b/tex.el
@@ -3338,8 +3338,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)))


Reply via email to