-
-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Glossary links cause Emacs to freeze for several seconds on mouseover #1120
Comments
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 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:
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:
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 have tried to make it only parse the document once, and then use a cache on subsequent lookups. I found an error in the cache where it wasn't using the right test for equal that is fixed now. I also store data on text properties now, so it should be much faster to compute faces and tooltips. Some things are not quite as good as I want, like following links is not as precise as I would like, and may still need some fine tuning. hopefully this is more performant in large files.
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. |
1. tooltip error when point is in another buffer 2. tooltips are not nil when using an acronym with glossary link
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.
The text was updated successfully, but these errors were encountered: