branch: externals/auctex
commit 806bdb01ca76c96e1d152b2c2cdfeee19ca32fe8
Author: Arash Esbati <ar...@gnu.org>
Commit: Arash Esbati <ar...@gnu.org>

    Improve usage of texmathp.el outside AUCTeX
    
    * texmathp.el (texmathp): Add a check if the current major mode
    derives from `TeX-mode'.  (bug#69681)
---
 texmathp.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/texmathp.el b/texmathp.el
index 3316c461e9..b4ccf7ce4a 100644
--- a/texmathp.el
+++ b/texmathp.el
@@ -1,6 +1,6 @@
 ;;; texmathp.el -- Code to check if point is inside LaTeX math environment  
-*- lexical-binding: t; -*-
 
-;; Copyright (C) 1998-2022  Free Software Foundation, Inc.
+;; Copyright (C) 1998-2024  Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <domi...@strw.leidenuniv.nl>
 ;; Maintainer: auctex-devel@gnu.org
@@ -325,8 +325,10 @@ See the variable `texmathp-tex-commands' about which 
commands are checked."
     ;; return immediately nil.  This relies on the function
     ;; `LaTeX-verbatim-p'.  We add a check here in case this library
     ;; is used stand-alone without latex.el provided by AUCTeX
-    ;; (bug#61410):
-    (if (and (fboundp 'LaTeX-verbatim-p)
+    ;; (bug#61410) and the `major-mode' doesn't derive from `TeX-mode'
+    ;; (bug#69681):
+    (if (and (derived-mode-p 'TeX-mode)
+             (fboundp 'LaTeX-verbatim-p)
              (LaTeX-verbatim-p (cdr match)))
         (progn
           (setq texmathp-why `(nil . ,(cdr match)))


Reply via email to