[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [BUG] issue with texmathp [9.6 (release_9.6-22-g78d283 @ /home/jds66
From: |
Justin Silverman |
Subject: |
Re: [BUG] issue with texmathp [9.6 (release_9.6-22-g78d283 @ /home/jds6696/.emacs.d/straight/build/org-mode/)] |
Date: |
Sun, 18 Dec 2022 10:17:25 -0500 |
User-agent: |
mu4e 1.8.13; emacs 28.2 |
That makes sense. Yes it breaks some of my snippets which have a condition
texmathp (I don't write latex without enclosing in latex math environment in
org).
Its an easy enough fix for me though:
(add-hook 'org-cdlatex-mode-hook
(lambda () (advice-remove 'texmathp 'org--math-always-on)))
does the trick.
Justin
Ihor Radchenko <yantar92@posteo.net> writes:
> Justin Silverman <jsilve24@gmail.com> writes:
>
>> Thanks for the quick response. I just had a chance to check it out.
>> Unfortunately (unless I am mistaken), with the change, `texmathp' is now
>> always returning t... which is not very helpful.
>
> Not exactly. I just tried to follow the docstring
>
> (defun org--math-always-on (orig-fun &rest args)
> "Always return t in Org buffers.
> This is because we want to insert math symbols without dollars even outside
> the LaTeX math segments. If Org mode thinks that point is actually inside
> an embedded LaTeX fragment, let `texmathp' do its job.
> `\\[org-cdlatex-mode-map]'"
>
> So, `texmathp' will return t outside latex, inside inline latex, and
> _maybe_ inside latex environments. Only inside latex environments, Org
> delegates the job to `textmathp'.
>
> Let me know if this change broke any real workflows.