GNU bug report logs - #69681
14.0.3; texmathp misbehaves in Org mode

Previous Next

Package: auctex;

Reported by: Tony Zorman <soliditsallgood <at> mailbox.org>

Date: Sat, 9 Mar 2024 19:29:02 UTC

Severity: normal

Found in version 14.0.3

Done: Arash Esbati <arash <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 69681 in the body.
You can then email your comments to 69681 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-auctex <at> gnu.org:
bug#69681; Package auctex. (Sat, 09 Mar 2024 19:29:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tony Zorman <soliditsallgood <at> mailbox.org>:
New bug report received and forwarded. Copy sent to bug-auctex <at> gnu.org. (Sat, 09 Mar 2024 19:29:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tony Zorman <soliditsallgood <at> mailbox.org>
To: bug-auctex <at> gnu.org
Subject: 14.0.3; texmathp misbehaves in Org mode
Date: Sat, 09 Mar 2024 20:27:59 +0100
Hi,

this is mostly a follow-up on [#61410], in which texmathp.el was made
aware of verbatim constructs. The current check for this is

    (if (and (fboundp 'LaTeX-verbatim-p)
             (LaTeX-verbatim-p (cdr match)))
      …)

The comment above that code snippet mentions texmathp running as
standalone, but perhaps it was still intended to run in a TeX buffer.
The actual check in LaTeX-verbatim-p is just to see whether

    (nth 3 (syntax-ppss))

returns nil or not. However, Org mode seems to treat inline and display
maths as a string, which causes texmathp to misbehave. (I know that Org
has org--math-p as an around advice, but I disabled that for the
purposes of this test.)

Would it perhaps be possible to amend the above check to see whether the
current major mode is a TeX-derived one?

Thanks!
Tony

[#61410]: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=61410

Emacs  : GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, Motif Version 2.3.8, cairo version 1.18.0)
Package: 14.0.3

-- 
Tony Zorman | https://tony-zorman.com/




Information forwarded to bug-auctex <at> gnu.org:
bug#69681; Package auctex. (Sun, 10 Mar 2024 08:01:03 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: Tony Zorman via bug-auctex via Bug reporting list for AUCTeX
 <bug-auctex <at> gnu.org>
Cc: 69681 <at> debbugs.gnu.org, Tony Zorman <soliditsallgood <at> mailbox.org>
Subject: Re: bug#69681: 14.0.3; texmathp misbehaves in Org mode
Date: Sun, 10 Mar 2024 09:00:08 +0100
Hi Tony,

Tony Zorman via bug-auctex via Bug reporting list for AUCTeX <bug-auctex <at> gnu.org> writes:

> this is mostly a follow-up on [#61410], in which texmathp.el was made
> aware of verbatim constructs. The current check for this is
>
>     (if (and (fboundp 'LaTeX-verbatim-p)
>              (LaTeX-verbatim-p (cdr match)))
>       …)
>
> The comment above that code snippet mentions texmathp running as
> standalone, but perhaps it was still intended to run in a TeX buffer.
> The actual check in LaTeX-verbatim-p is just to see whether
>
>     (nth 3 (syntax-ppss))
>
> returns nil or not. However, Org mode seems to treat inline and display
> maths as a string, which causes texmathp to misbehave. (I know that Org
> has org--math-p as an around advice, but I disabled that for the
> purposes of this test.)
>
> Would it perhaps be possible to amend the above check to see whether the
> current major mode is a TeX-derived one?

I don't use Org so maybe I don't understand the above correctly, but
does this change meets your requirement?

--8<---------------cut here---------------start------------->8---
diff --git a/texmathp.el b/texmathp.el
index 3316c461..ec553a3a 100644
--- a/texmathp.el
+++ b/texmathp.el
@@ -326,7 +326,8 @@ See the variable `texmathp-tex-commands' about which commands are checked."
     ;; `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)
+    (if (and (derived-mode-p 'TeX-mode)
+             (fboundp 'LaTeX-verbatim-p)
              (LaTeX-verbatim-p (cdr match)))
         (progn
           (setq texmathp-why `(nil . ,(cdr match)))
--8<---------------cut here---------------end--------------->8---

Best, Arash




Information forwarded to bug-auctex <at> gnu.org:
bug#69681; Package auctex. (Sun, 10 Mar 2024 08:01:05 GMT) Full text and rfc822 format available.

Information forwarded to bug-auctex <at> gnu.org:
bug#69681; Package auctex. (Sun, 10 Mar 2024 12:14:02 GMT) Full text and rfc822 format available.

Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tony Zorman <soliditsallgood <at> mailbox.org>
To: Arash Esbati <arash <at> gnu.org>, Tony Zorman via bug-auctex via Bug
 reporting list for AUCTeX <bug-auctex <at> gnu.org>
Cc: 69681 <at> debbugs.gnu.org
Subject: Re: bug#69681: 14.0.3; texmathp misbehaves in Org mode
Date: Sun, 10 Mar 2024 13:13:10 +0100
Hi Arash,

On Sun, Mar 10 2024 09:00, Arash Esbati wrote:
> I don't use Org so maybe I don't understand the above correctly, but
> does this change meets your requirement?
>
> [… 16 lines elided …]

indeed, this is along the lines that I was thinking about.

I should probably have rather sent a patch instead of opening a bug
report (sorry! :)), but I wasn't exactly sure what people would want to
do about this (if anything).

Thanks!
  Tony

-- 
Tony Zorman | https://tony-zorman.com/




Information forwarded to bug-auctex <at> gnu.org:
bug#69681; Package auctex. (Sun, 10 Mar 2024 12:15:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-auctex <at> gnu.org:
bug#69681; Package auctex. (Mon, 11 Mar 2024 10:40:01 GMT) Full text and rfc822 format available.

Message #20 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: Tony Zorman <soliditsallgood <at> mailbox.org>
Cc: Tony Zorman via bug-auctex via Bug reporting list for AUCTeX
 <bug-auctex <at> gnu.org>, 69681-done <at> debbugs.gnu.org
Subject: Re: bug#69681: 14.0.3; texmathp misbehaves in Org mode
Date: Mon, 11 Mar 2024 11:38:28 +0100
Tony Zorman <soliditsallgood <at> mailbox.org> writes:

> On Sun, Mar 10 2024 09:00, Arash Esbati wrote:
>> I don't use Org so maybe I don't understand the above correctly, but
>> does this change meets your requirement?
>>
>> [… 16 lines elided …]
>
> indeed, this is along the lines that I was thinking about.

Great, I installed that change now (806bdb01ca).

> I should probably have rather sent a patch instead of opening a bug
> report (sorry! :)), but I wasn't exactly sure what people would want to
> do about this (if anything).

Sending a patch as a bug report is the best option, actually.  It can't
go lost and we can track it more easily.

I'm closing this report.

Best, Arash




Reply sent to Arash Esbati <arash <at> gnu.org>:
You have taken responsibility. (Mon, 11 Mar 2024 10:40:02 GMT) Full text and rfc822 format available.

Notification sent to Tony Zorman <soliditsallgood <at> mailbox.org>:
bug acknowledged by developer. (Mon, 11 Mar 2024 10:40:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 08 Apr 2024 11:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 68 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.