branch: master
commit a82eb1690a24316857262bac96209f9278c06125
Author: Arash Esbati <ar...@gnu.org>
Commit: Arash Esbati <ar...@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 a3e297a8..7bada422 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 1030ed85..5631916e 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