branch: externals/auctex
commit 16f0eed97eacb80297fe784e6c2aaf6b6122b7da
Author: Paul Nelson <ultr...@gmail.com>
Commit: Paul Nelson <ultr...@gmail.com>

    Guard expand-abbrev calls with abbrev-mode check
    
    * tex.el (TeX-insert-quote, TeX-insert-punctuation): Check if
    abbrev-mode is enabled before calling expand-abbrev.  Follow-up
    to bug#78653.
---
 tex.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tex.el b/tex.el
index 6f8267acbe..18438a813d 100644
--- a/tex.el
+++ b/tex.el
@@ -6449,7 +6449,8 @@ With prefix argument FORCE, always inserts \" characters."
           (texmathp)
           (and (TeX-in-comment) (not (eq major-mode 'docTeX-mode))))
       (self-insert-command (prefix-numeric-value force))
-    (expand-abbrev)
+    (when abbrev-mode
+      (expand-abbrev))
     (TeX-update-style)
     (pcase-let ((`(,open-quote ,close-quote ,q-after-q)
                  (TeX-get-quote-characters)))
@@ -6529,7 +6530,8 @@ With prefix argument FORCE, always inserts \" characters."
 (defun TeX-insert-punctuation ()
   "Insert point or comma, cleaning up preceding space."
   (interactive)
-  (expand-abbrev)
+  (when abbrev-mode
+    (expand-abbrev))
   (if (TeX-looking-at-backward "\\\\/\\(}+\\)" 50)
       (replace-match "\\1" t))
   (call-interactively #'self-insert-command))

Reply via email to