reddit / emacs

ido and project-find-file sometimes don't work

pimiddy · 2022-07-27 07:15
`project-find-file` in emacs seems to *sometimes* work for me, displaying a list of candidates, and right away. Sometimes, however, it doesn't. It might have something to do with the size of the repository, I haven't checked. For example, when I invoke `projectile-find-file` in the nixpkgs repository (which is huge), nothing is shown, and I cannot even enter a filename to open it. In my own, smaller repositories, it's working fine. I'm using `ido-mode`, `ido-everywhere` and `ido-ubiquitous-mode` as well as `ido-vertical-mode`. Anyone else have this problem? It doesn't occur with projectile, just project.el. But I'd like to stick to emacs built-in stuff.
hvis · 2022-07-27 10:00
Does it freeze? Or does it really show an empty list? And that happens in a particular repository? Could be that its configuration is unusual, and the listing command doesn't work for it, I'd have to see an example. Please show your value of `project-find-functions` first, though.
pimiddy · 2022-07-27 10:45
I have waited for 2 minutes for it to complete, nothing changes. Can I somehow determine if it froze? It happens in the nixpkgs repository (see https://github.com/nixos/nixpkgs) currently. Other repositories seem to work. `project-find-functions` is `(project-try-vc)` currently.
hvis · 2022-07-27 11:46
Freezing is when the whole Emacs UI freezes, and you have to press `C-g` (maybe even multiple times) to see it respond to commands again.
hvis · 2022-07-27 13:33
I just did `git clone https://github.com/nixos/nixpkgs --depth 1`, and file listing seems to work ok there. Perhaps there is something else required to reproduce the problem?
hvis · 2022-07-27 13:34
Does it work without Ido?
paretoOptimalDev · 2022-07-27 16:57
Do note that nixpkgs is likely the largest git repo one is likely to ever encounter. What are your pc specs?
hvis · 2022-07-28 14:15
It's not so big, actually. `git ls-files | wc -l` reports ~30K files. That's a fair amount, but e.g. Linux kernel is more than twice as big. And Mozilla Firefox is, in turn, 4x bigger than that. And people working in large organizations are likely to encounter projects even bigger than that. When invoked in nixpkgs `(benchmark 1 '(project-files (project-current)))` reports 270ms over here. That's above the limit of what's perceived as "instant", but still seems usable.
paretoOptimalDev · 2022-07-28 14:57
Huh, yeah you're right. I guess it just always felt huge... that's why we go by data ; )