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 <[email protected]> writes:
> Justin Silverman <[email protected]> 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.