-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Consider orderless-annotation-ignore-case #184
Comments
By not only checking the compiled regexp, smart case is also toggled when matching on annotations, e.g., &Lv as in #184.
I believe this problem is better fixed by improving |
That seems in harmony with other Emacs behavior that defaults to folding with all lower case specified and mixed case when search criteria are mixed. However, if I really want to force it to find only lower case as in "lv" vs. "Lv" in marginalia-adorned symbol metadata, how would this work? Perhaps another "flag" in orderless-affix-dispatch-alist to indicate case sensitivity is requested? I'm not an expert with orderless or completion frameworks (I'm impressed by the level of complexity you've had to take on board to do your completion work), so this suggestion could be off base. |
Yes, orderless-smart-case is exactly for this purpose, but it hasn't been respected before for the annotation matcher. This is at least fixed by c7cb044.
Yes, an affix flag would be a possible solution to specify case sensitivity. But note that affix flags interfere with normal usage, so I am against adding more of them by default. For example when we introduced the annotation dispatcher we first used @ (which I still like), but this made matching literal @ more difficult, so we went with the an(d)notation instead for annotations, which seems to cause less interference. Maybe we could reuse = to mean literal and exact case. However I am not sure how to implement this given that case sensitivity is a global property and not an individual property per filter word. Maybe one can construct the regexps somehow to match lower/upper case only. |
I'd first assumed that = would be as literal as its description but it doesn't work in combination with & as in =& to engage literal metadata completion. If that can be made to work, that seems simpler then adding another affixation code. Or could be &= if order matters and if that can be made to work. |
Yes, the dispatchers compose, e.g., &=literal or &~flex, but the problem here is that I am not sure if it is possible to construct regexps which are case sensitive, even if case-fold-search=t or completion-ignore-case=t. |
I think case-fold-search nil is the only way to guarantee case-sensitive matching. Perhaps a lambda could be used to wrap regexps and the default would respect user settings and when = is specified, it would bind to case-fold-search nil. |
Yes, the matcher could compile to a predicate function which matches exactly, which Orderless already does for certain special matchers like the not or annotation matcher. But that's pretty bad tbh for something as simple as the literal matcher. |
It would be an interesting proposal to add regexp syntax to force case sensitivity as almost all other regexp engines support. I have a feeling that's been debated many times in the past. |
Thank you for the implementation of orderless-annotation.
I'm trying to use the marginalia--symbol-class enhanced list of symbols via helpful-variable and narrow the list to those that are buffer local, i.e., marked as "Lv" or "lv" with case sensitive matches, so I'm inputting &Lv in the vertico-managed minibuffer.
To get case-sensitive annotation searches, I've resorted to trying this
But it doesn't seem to work. I have to dig more.
It would be convenient for orderless to have a few more settings; e.g.,
And I suppose other controls but I haven't looked into others.
-Stephane
The text was updated successfully, but these errors were encountered: