emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/auctex a82eb1690a 10/30: Restore point in `LaTeX-verbat


From: Tassilo Horn
Subject: [elpa] externals/auctex a82eb1690a 10/30: Restore point in `LaTeX-verbatim-p'
Date: Thu, 7 Dec 2023 03:51:07 -0500 (EST)

branch: externals/auctex
commit a82eb1690a24316857262bac96209f9278c06125
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>

    Restore point in `LaTeX-verbatim-p'
    
    * latex.el (LaTeX-verbatim-p): Don't move point when the optional
    argument POS is non-nil.
    
    * texmathp.el (texmathp): Remove now unnecessary `save-excursion'.
---
 latex.el    | 31 ++++++++++++++++---------------
 texmathp.el |  2 +-
 2 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/latex.el b/latex.el
index a3e297a884..7bada4224c 100644
--- a/latex.el
+++ b/latex.el
@@ -3868,21 +3868,22 @@ of the macro argument as cons."
 The macro body (\"\\verb\") and its delimiters, including
 optional argument if any, aren't considered as component of a
 verbatim-like construct."
-  (when pos (goto-char pos))
-  (save-match-data
-    ;; TODO: Factor out syntax propertize facility from font-latex.el
-    ;; and re-implement as major mode feature.  Then we can drop the
-    ;; fallback code below.
-    (if (eq TeX-install-font-lock 'font-latex-setup)
-        (progn
-          (syntax-propertize (point))
-          (nth 3 (syntax-ppss)))
-      ;; Fallback for users who stay away from font-latex.
-      (or
-       (let ((region (LaTeX-verbatim-macro-boundaries t)))
-         (and region
-              (<= (car region) (point) (cdr region))))
-       (member (LaTeX-current-environment) (LaTeX-verbatim-environments))))))
+  (save-excursion
+    (when pos (goto-char pos))
+    (save-match-data
+      ;; TODO: Factor out syntax propertize facility from font-latex.el
+      ;; and re-implement as major mode feature.  Then we can drop the
+      ;; fallback code below.
+      (if (eq TeX-install-font-lock 'font-latex-setup)
+          (progn
+            (syntax-propertize (point))
+            (nth 3 (syntax-ppss)))
+        ;; Fallback for users who stay away from font-latex.
+        (or
+         (let ((region (LaTeX-verbatim-macro-boundaries t)))
+           (and region
+                (<= (car region) (point) (cdr region))))
+         (member (LaTeX-current-environment) 
(LaTeX-verbatim-environments)))))))
 
 
 ;;; Formatting
diff --git a/texmathp.el b/texmathp.el
index 1030ed858b..5631916ed0 100644
--- a/texmathp.el
+++ b/texmathp.el
@@ -327,7 +327,7 @@ See the variable `texmathp-tex-commands' about which 
commands are checked."
     ;; is used stand-alone without latex.el provided by AUCTeX
     ;; (bug#61410):
     (if (and (fboundp 'LaTeX-verbatim-p)
-             (save-excursion (LaTeX-verbatim-p (cdr match))))
+             (LaTeX-verbatim-p (cdr match)))
         (progn
           (setq texmathp-why `(nil . ,(cdr match)))
           (when (called-interactively-p 'any)



reply via email to

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