jgru/consult-org-roam

major-mode not applied in previews for consult-org-roam-node-read

Closed this issue · 2 comments

deb75 commented

Hi,

When consult-org-roam-node-read displays node previews, I noticed that sometimes org-mode
is not applied : no text highlighting at all. If I switch to such a node, orgmode is applied correctly.

It appears that whenever there is a latex src block within the node (or the file I do not know), the latex/MPS
major mode takes precedence over orgmode because of poly-org which changes the major mode from orgmode
to latex/MPS whenever the cursor is over a latex src block or fragment.

I tried to prevent this change following the piece of advice here.

It does work for files but not for previews. Is there a way to enforce the major-mode for previews ?

EDIT : previews also try to switch to python-mode when there is a python src block.

Regards

jgru commented

Hi @deb75,

thanks for opening this issue.

consult-org-roam solely relies on consult's functionality in that regard. It does not interfere with mode activation or whatsoever. Hence, I assume that it is either an issue with consult itself or your config.
Can you please check whether this is related to consult-org-roam or consult in general?
To do so, I would suggest that you disable consult-org-roam and open the problematic files in question.
Afterward run M-x consult-buffer to switch between those buffers and observe how the previews look like.

Best regards,
jgru

jgru commented

Closing because the question has not been answered for weeks.