meow
meow copied to clipboard
Add a new prompter for `meow-visit`.
These changes make type what is sought in meow-visit
more like Isearch and Anzu. It is still a work in progress, but it seems to be working.
The change adds a user option to configure a "prompter" which is used to read text from the minibuffer. It also adds a new prompter that highlights matches from point to the top or bottom of the window, depending on the argument to meow-visit
. If point is inside the secondary selection, then matches within the selection are also highlighted. I find this useful for running meow-visit
to place the beacons when meow-visit-sanitize-completions
is nil.
Are you interested in adding something like this? If so, what would you like to see changed?
Hey, I just gave it a try, and it looks cool. The buffer-highlight
style seems to be good and I'd like to have this change.
BTW, should the window view scroll to the occurrence which is not in current window view?
Very cool! I still prefer to use ivy over visit/anzu/isearch but this is a good improvement to vanilla meow.
I skimmed the code and it seems good. One thing I think would be nice is a more code reuse to make it easier to write new prompters.
- Putting useful functions like transform-text in the flet means reuse if you're making another prompter. I haven't looked too hard at the regexs in completion and buffer-highlight but surely there's some code reuse that can happen there.
- Your beginning/ending pos code could also be easily reused, can easily be moved into the parent let*
- Basically making the call to each prompter as simple as possible, and documenting what it receives and should return.
BTW, the regex's don't seem like they're doing the same thing, i'll take a closer look soon. I noticed that default doesn't seem to get words broken up by hyphens in lisp code. This could be a good chance to refactor the default prompter.
I'm now thinking about whether the new other way of doing it could just use Isearch, instead of me re-inventing a worse Isearch with less understanding.
Would something like a user option for a function that returns the beginning and end of the match be acceptable? I see that in https://github.com/meow-edit/meow/discussions/175 there is talk about how to integrate with other search packages. I can check what level of effort would be needed to work with the other packages.