-
Notifications
You must be signed in to change notification settings - Fork 3
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
Reftex label candidates are not automatically refreshed #11
Comments
So long as it doesn't turn into a performance sink, I don't mind. |
Will experiment to check how it affects performance. If it is fine then I will submit a PR. |
This commit addresses issue #11 by calling `(reftex-parse-all)` before searching for label candidates. This ensures that reftex parses all new labels and loads them before searching using the input prefix
An example for a better solution would be to watch input files or compare their modification dates with those from the last scan. See: https://emacs.stackexchange.com/questions/73745/company-reftex-slow-when-searching-for-labels |
Hi @TobiasZawada. Sorry to hear that #12 caused a performance sink for the OP in Emacs-StackExchange. I would be happy to collaborate on a PR to fix this new issue.
This should be possible and fairly straight-forward to implement. As per here, there are two high-level functions for parsing either the current file or the (multifile) document. I could imagine this being part of the hook in our case and perhaps we could even remove the line containing
But before that, I would like to check if the performance sinks are mitigated by using the options specified here: https://www.gnu.org/software/auctex/manual/reftex/Optimizations.html? The descriptions of these options sound somewhat in the direction of your suggestion. It would also be great if the OP could share a MWE to reproduce the performance sink here. |
Hi @TobiasZawada. I created a PR (#13) to address the reported issue. Let me know if this and the aforementioned optimizations help with the performance sink. |
The easiest work-around for me is to perform rescan on save. In this way, we don't need to change company-reftex at all, so there won't be any performance issue. |
@zhenhua-wang indeed that seems like the best solution. Could you share a snippet of the hook you use for this? |
I didn't use hook for this. I simply rebind
If you want, you can add-advice around the function |
Hi @TheBB,
Quick question pertaining to a feature request. As of now, when I use
company-reftex
to search for label candidates, I notice that the selection of labels does not get updated after starting myemacs
session. To overcome this I normally have to executereftex-parse-all
to manually refresh the selection of labels. Do you or others also experience this issue or is there some easy workaround?I found this to be the relevant section of code:
company-reftex/company-reftex.el
Lines 224 to 232 in 291c283
I noticed that the following edit on line 229 fixes the issue for me, and would be happy to submit a PR. WDYT?
The text was updated successfully, but these errors were encountered: