Skip to content
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

Failing I-search/Wrapped I-search message #7

Closed
minad opened this issue May 14, 2021 · 6 comments
Closed

Failing I-search/Wrapped I-search message #7

minad opened this issue May 14, 2021 · 6 comments

Comments

@minad
Copy link
Contributor

minad commented May 14, 2021

The prompt is replaced by these messages in normal isearch mode. This functionality is lost if isearch-mb-mode is active.

@astoff
Copy link
Owner

astoff commented May 14, 2021

Okay, so do you actually miss these messages? I like the cleaner look of the current version.

The failing is already indicated in the search string by the isearch-fail face.

The (over)wrapped information, isn't is kind of superseded by the lazy count? I also get the impression the wrap status is nonsense in Info nodes, which have a fancy wrap function to go to the next page.

PS: Thanks for the little review of the package!

@minad
Copy link
Contributor Author

minad commented May 14, 2021

When I tested the isearch-mb-mode, I somehow missed the message. I prefer to have the message for the simple reason that it is more aligned with the default isearch. In contrast to other verbose Emacs messages I never perceived the isearch wrap around messages as annoying. I like to be notified explicitly that a wrap around happened. Maybe I could get accustomed to only seeing the fail face?

@astoff
Copy link
Owner

astoff commented May 14, 2021

The amount of information that isearch-message-prefix can (potentially) show you is staggering, and at the same doesn't strike me a super useful. Let's go through it:

  • Failing: there's already the isearch-fail overlay and the 0 match count. One could also show FAIL instead of the lazy count, but would it add anything?
  • Pending: I don't even know what this means, thank you.
  • (Over)wrapped: Maybe wrapped could be indicated by some embellishment of the match count. Now, what does overwrapped even mean? It means that wrap already happened and the search is going away from the starting point. Too complicated to my taste.
  • Narrowed: This doesn't even concern the search state per se.
  • Case-sensitve: This concerns the search mode, not state, so probably shouldn't be mixed.
  • Multi file/buffer: Same, and is already shown in the modeline indicator.
  • Direction: I usually remember if I last pressed C-s or C-r, and in any case this is also indicated by the cursor position in relation to the match.

So, in the end, the wrap information is the only one I care about. And actually I would rather know if I'm above or below the search starting point right now, as opposed to whether I've crossed across the bottom of the buffer.

@minad
Copy link
Contributor Author

minad commented May 14, 2021

And actually I would rather know if I'm above or below the search starting point right now, as opposed to whether I've crossed across the bottom of the buffer.

If that information would be shown somewhere, that would indeed be useful. Regarding the other things I don't feel as strongly, my main argument is that it may be better to stay closer to the defaults as long as they are not totally off. As I mentioned, I am fine with the wrap around message.

One could also show FAIL instead of the lazy count, but would it add anything?

The lazy count is a bit problematic as an indicator since it has a delay. FAIL could be shown directly?

@astoff
Copy link
Owner

astoff commented May 19, 2021

How about some colors to indicate the wrap/fail status? Something like this:

(advice-add
 'isearch-lazy-count-format
 :filter-return
 (lambda (s)
   (propertize s 'face (cond
                        ((or isearch-error (not isearch-success)) 'error)
                        (isearch-wrapped 'warning)
                        (t 'success)))))

The lazy count is a bit problematic as an indicator since it has a delay.

This improves in Emacs 28.

@astoff
Copy link
Owner

astoff commented Feb 26, 2022

I've been using the above snippet for a while, which adds different colors to the match count when the search wrapped or failed. I'm very much convinced it's the best UI for the purposes described here. However, I don't want to include this in isearch-mb because it's a general isearch matter (the advice above works on regular isearch as well).

Therefore, I added it to the wiki and will close this issue.

@astoff astoff closed this as completed Feb 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants