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

Highlights in URLs, but not in Titles #7

Closed
agzam opened this issue Dec 1, 2022 · 1 comment
Closed

Highlights in URLs, but not in Titles #7

agzam opened this issue Dec 1, 2022 · 1 comment

Comments

@agzam
Copy link
Owner

agzam commented Dec 1, 2022

Why doesn't it highlight the occurrence in titles? I would type "foo", it correctly finds all the URLs, and the titles as well, but it only highlights it in URLs. Is this a bug?

@agzam
Copy link
Owner Author

agzam commented Dec 1, 2022

This isn't exactly a bug (well, technically, it is), but let me try to explain.

completing-read feature of Emacs is never meant to be used "for searching things", but we use it for that anyway. And as it turns out, if you want to search, the data must be included in the collection. And as you may have noticed, the title is not part of the main string in every row (URL is). The title is an annotation. At some point, I even asked the question in /r/emacs and argued that there should be an idiomatic and "proper" way of searching for things that are not part of the main string.

So, if the title has to be part of the main string, but it isn't there, how does it work? It works because I tricked it; I appended the title to the URL but made it invisible (and the added annotation makes it looks nice). That forces it to apply search to both URL and Title, and it would work with orderless completions, etc., but sadly, it won't highlight the occurrences in titles. A minor inconvenience, nothing more.

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

1 participant