jkitchin / org-ref

org-mode modules for citations, cross-references, bibliographies in org-mode and useful bibtex tools to go with it.
GNU General Public License v3.0
1.36k stars 243 forks source link

Slow editing of sentences with acronym links #1106

Closed weidtn closed 8 months ago

weidtn commented 8 months ago

Hello,

im currently writing my thesis in org-mode with org-ref. I added some acronyms and a table on top containing these acronyms. Whenever I try to edit something in a sentence already containing an acronym link, I first have to wait a few seconds until emacs reacts. It is reading something in the background and blocks the whole process. Writing a new sentence or editing something without an acronym link works fine.

I use doom emacs and evil mode. With editing, I mean specifically adding or removing letters inside of insert mode for example.

jkitchin commented 8 months ago

It is probably font lock that is slow. Try (setq org-ref-activate-glossary-links nil). This will turn off activation of the links and speed it up a lot probably.

weidtn commented 8 months ago

That works. What exactly is it deactivating? I still see the acronyms as links in the text?

jkitchin commented 8 months ago

There is a function that is used to find the face for syntax highlighting the links. If org-ref-activate-glossary-links is nil it just returns the link face. If it is true though, it re-parses the document (which is slow) and if the link doesn't point to something valid it makes the link red so it is obvious it is wrong.

weidtn commented 8 months ago

Thank you for the quick help and the explanation!