Closed deb75 closed 1 year ago
Or perhaps is it better to prevent emacs from changing of major mode from org
to latex/MPS
whenever you enter in a math environment. Do you know how to perform this ?
What do you mean by "recent packages update"? An update of Emacs and/or Org-mode? Does the major mode change occur if you start Emacs with emacs -Q
?
It would be great if you could share a minimal reproducible example with Emacs and Org mode version (preferable their git hash). I cannot reproduce it on Emacs 30 at 75f0484 and Org-mode f7aa8c19f.
By recent update, I mean orgmode 9.6.3
and emacs at 30.0.50-cd9e65e1
. Update operated with package-list-packages
two days ago.
The major mode change is (I think) due to poly-org-latex-inner-mode
, I opened an issue https://github.com/polymode/poly-org/issues/46 because it breaks several things.
There are no particular settings except that of loading poly-org
. Unloading it solves the issue.
What I do not understand is why org-latex-impatient-mode
does not work even when I add :
(LaTeX-math-mode . org-latex-impatient-mode)
(LaTeX-mode . org-latex-impatient-mode)
to its configuration. In your README, it is said that org-latex-impatient-mode
is experimental for latex file.
I see 3 options:
(oset poly-org-latex-innermode :keep-in-mode 'host)
(delq 'poly-org-latex-innermode (oref poly-org-polymode :innermodes))
post-command-hook
. You can advice that function to always execute in the host buffer (in org mode). Like in these examples.Regarding the font-lock in indirect buffer error I have no idea to be frank. Font lock should not be directly activated in those buffers.
Thanks for your sound answer, I chose the first option. Regards
Currently, org-latex-impatient
first checks if the major mode is a derived mode of either org-mode, latex-mode (LaTeX-mode is derived from it), or markdown-mode. If not, it hides the preview posframe and suspend action. Math fragment detection is by looking at the face of letters.
Since I am not familiar with poly-org
, I would suggest the following starting steps if you want to hack for yourself:
some-special-latex-mode
(derived-mode-p 'latex-mode)
in the file, and replace all of them with (or (derived-mode-p 'latex-mode) (derived-mode-p 'some-special-latex-mode))
M-x describe-char
when your cursor is in the region, and modify org-latex-impatient--tex-in-latex-p
accordingly.Note: this is only a starting point. Unfortunately, I didn't consider supporting major-mode other than org-mode when I started the project, making it non-trivial to add support for additional modes.
With recent packages update, I noticed that whenever the cursor enters in a math environment, the major mode changes from orgmode to latex/MPS. This seems to break the
org-latex-impatient
previews.I tried to add this :
to the
org-latex-impatient
config, but this does nothing.How could I reenable the previews as you type within math environments ?
Regards