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
"Automatic" swiper-multi by supporting multi-isearch-next-buffer-function #2473
Comments
I think adding this to However, we could add it to
But I've never used |
Thanks for your answer! Yes, that's what I would expect too. But the alternative, generating the list of buffers beforehand, would make the function too heavy to be used as a replacement for swiper. Definitely better than nothing though. It is used in The variable itself is set to Looking at the code for swiper and ivy, I see why you think it would be hard to implement the exact behavior of isearch: apparently there is no predefined way of setting up different actions when reaching the last or first candidate. It might be possible to do something with In any case, it might be a valuable addition in the future, also for other situations, for example generating a large list of files on the go. |
After testing with reftex, this naive code should create an ordered list of buffers:
|
Could you PR with your change to |
Sorry for the delay. I have written a prototype (https://github.com/ThibautVerron/swiper/tree/Multi-isearch), I will do a bit more testing to make sure it works fine and then make a PR. As expected there is an "opening files" phase at the beginning, but so far it doesn't take exceedingly long. I also want to test it on a slower computer.
On the other hand, I don't think anymore that it would be so complicated to add the feature of passing a function "generate more candidates" to Anyway, as far as multi-buffer search is concerned, I agree that it's not really a worthwhile effort given that |
Hi,
I'm aware of the existence of
swiper-multi
, but it seems that it requires manually selecting the buffers to process.For
isearch
, it is possible to set the variablemulti-isearch-next-buffer-function
to an appropriate function and get this behavior automatically. Some modes make use of that, for examplereftex-isearch-minor-mode
makes isearch perform document-wide searches in multi-file LaTeX projects.Could swiper support this variable? My impression is that it should be possible to use
multi-isearch-next-buffer-function
to make a list of buffers and then use it withswiper-multi
?It might not be practical though: on big projects, if the function has to create buffers visiting project files, even a short search would require opening a lot of files (and performing hooks, etc.).
Instead, isearch does it on the fly, and requires pressing
C-s
orC-r
twice to jump to the next buffer. I guess that adapting that behavior toswiper
would be a lot more work?The text was updated successfully, but these errors were encountered: