astoff / devdocs.el

Emacs viewer for DevDocs
279 stars 16 forks source link

Jump to a subsequent page when isearch wraps #14

Closed astoff closed 2 years ago

astoff commented 2 years ago

It would be nice if, as in Info, isearch would continue searching subsequent document pages after hitting the last match of a given page.

This is implemented, as best as possible, in this branch. However, rendering document pages is quite slow, so isearch can freeze for several seconds in the process. A progress report is shown, and interrupting the search with C-g seems to work fine.

It's not clear whether this feature is better or worse than nothing. Perhaps @minad has an opinion?

minad commented 2 years ago

So this allows you to search through the entire devdocs starting at the beginning? I am not sure if I like Isearch to be used for this, in particular if it leads to slowdown. Did you consider adding another search functionality, based on grep, or even possibly with the ability to plug-in consult-grep?

astoff commented 2 years ago

I'm working on a grep-like function right now. When it's ready we can decide if the isearch thing is still interesting.

We'd have to see about integrating the grep with Consult. I need to convert HTML to text before grepping, and I'm just using shr for that (mainly because it doesn't require external programs, and already reports the correct line numbers). As a downside, I believe this approach makes it harder to make things asynchronous in a way that's friendly to Consult.

minad commented 2 years ago

What about converting the html at installation time? If you don't want that there is no other alternative to convert in an external process if you want to preserve the asynchronicity. Having an asynchronous would be particularly nice. Also note that shr is slow.

astoff commented 2 years ago

Even though Info-mode has this feature, it is probably not a good idea to implement here. A better UI would be a grep-like command as in #15, assuming we can polish it to be fast enough.