Lele Gaifax <l...@metapensiero.it> writes: > Digging down, I found that it was due to the persistent cache, that contained > several entries about remote (Tramp) documents: upon closing Emacs, the > org-persist-gc function is triggered, and the index is traversed to remove > dangling entries, performing a file-exist-p on each filename. For remote > files, that obviously mean prompting for the remote password (when the > ssh-agent does not carry it) or spending a considerable time in the network > round trip.
Thanks for reporting! I am not using tramp regularly and I did not think about this use case. > I wonder if there is some mechanism I could use to either prevent caching of > non-local documents or to avoid the check on existence in the org-persist-gc. I can easily make a change that always garbage-collect non-local documents without trying to connect to remote server. This can be one solution of your problem. However, I am not sure if it is the best solution. May I know more about your use cases? Do you frequently open large remote Org files? If you do, trashing their cache may not be optimal. Maybe we should better make this a user option? Or we can go a different route and just not garbage collect remote files until cache gets too large. WDYT? Best, Ihor