Open lrustand opened 1 month ago
There seem to be two separate freezes. First it freezes for roughly one second before loading the tooltip, then it freezes for roughly one second before removing it also.
And the freezes seem to be "queued up". So if I move my mouse pointer around and hover over several links in short succesion it queues up all the tooltips and will be unresponsive until it has shown all the tooltips that I have hovered over.
You can probably suppress the problem with (setq org-ref-activate-glossary-links nil)
. The freezing probably occurs from fontification which is scanning the org-buffer to see if it is valid. This code could use an overhaul, to address that, but I am not sure when I will have time to do that.
For future me: I should see if I can save a text-property once, and reuse that on subsequent fontification. The difficult is cache invalidation here, e.g. if you delete a char or add one, it should become invalid.
Thanks, I tried that, but unfortunately it didn't help. It certainly had an effect on something since the links changed color from orange to purple, but I'm not sure it did what was intended. The glossary references still act like links when clicked, they are highlighted and show the tooltip when hovered, and the freezes are still in full effect.
Edit: Btw, all my glossary entries are actually acronyms made with \newacronym if this makes any difference.
I guess you might be able to suppress this for now by redefining these function:
(defun or-acronym-tooltip (_window _object position)
"acronym")
(defun or-glossary-tooltip (_window _object position)
"glossary")
Could you send me the file causing this issue? I can't reproduce the freezing here, which makes it hard to tell what to change.
Also, could you say a little more about your system? operating system, windows/mac, etc...
Unfortunately I can't upload the actual file that I'm working on to the internet, so I will try to create a MWE that reproduces it, and will post that if I manage to isolate it.
Operating system is Guix, and Emacs is version 30.0.60
Edit: At least your new workaround worked perfectly. So now this is a non-problem for me personally, but I will try and see if I can reproduce it anyway just in case this is a bug that might affect other people as well.
After a bit more testing it seems like the length of the freeze is dependent on the lenght of the document. When I made a minimal example with just one acronym and a reference to it, it works fine and responds instantly. However, if I just add a few thousand lines of random text to the same file it becomes very sluggish, but it becomes already noticeable after just a few hundred lines, especially if you hover over multiple different/the same link in a row. And the more text I add the more sluggish it becomes.
The following minimal example is enough to reproduce it if you append a few thousand lines of random build logs or whatever to the end of the file:
#+title: Test
#+LATEX_HEADER_EXTRA: \newacronym{ABC}{ABC}{A B C}
gls:ABC
Using this approach I get several seconds of delay until Emacs becomes responsive again.
To see the delay after hovering just try to click anywhere in the text to move the cursor and see that it takes a long while for the cursor to move, or try to execute any other keybinding.
If you don't get a noticable delay, try moving your mouse over the link and away quickly several times in a row or add more random text to the end of the file.
I made an attempt to speed things up above. let me know if it seems better, or if I added any new bugs.
This seems to have worked very well, I'm not able to force a freeze even if I'm actively trying to cause as many hovers as possible. One side effect though is that the tooltip now says "nil: ." instead of the actual text.
Any gls: link in my org documents causes Emacs to become fully unresponsive and freeze for several seconds when my mouse pointer accidentally hover over it. This is extremely annoying when I have a document where there are many glossary references, for example scrolling through the document becomes very cumbersome, since the mouse pointer will hit many links while scrollling, which causes the scrolling (and any other action I try to do) to freeze.
All other types of org-ref links work fine and do not cause this problem. It only happens for glossary links.
I have tried every possible way of disabling these pointless popups, but the freeze happens anyways.