oantolin / orderless

Emacs completion style that matches multiple regexps in any order

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FEATURE REQUEST: Consider making your personal configuration the default (doc does not help get to that solution)

rswgnu opened this issue · comments

First, orderless is wonderful but I find the out-of-the-box configuration too minimal for typical use cases. I read the doc quoted below but still could not get !term to act as a non-match. I think I also had trouble using $ in regexes but am not sure. I tried and tried and failed. Then I looked at your personal config for orderless, used that, and everything worked as I would have expected. Please consider making this config the default or put it in a prominent place in the doc so no one else has this problem.

From your doc:
Style dispatchers
For more fine-grained control on which matching styles to use for each component of the input string, you can customize the variable orderless-style-dispatchers. You can use this feature to define your own “query syntax”. For example, the default value of orderless-style-dispatchers lists a single dispatcher called orderless-affix-dispatch which enables a simple syntax based on special characters used as either a prefix or suffix:

! makes the rest of the component match using orderless-without-literal, that is, both !bad and bad! will match strings that do not contain the substring bad.
=,= uses orderless-initialism.
=== uses orderless-literal.
~ uses orderless-flex.
% makes the string match ignoring diacritics and similar inflections on characters (it uses the function char-fold-to-regexp to do this).

So you're saying the default does not behave as described in the documentation? And that in particular !term is not a negative match by default? That's definitely a bug, I'll look into it.

As for my personal configuration, I consider it far too idiosyncratic to be the default. But definitely !term should be working.

There is no bug.

That is a more definitive statement than I would make in the face of a bug report, but I am happy to say that I could not reproduce the problem either and the affix dispatcher works just fine on my machine both in emacs -Q and iif I run my personal configuration and reset the variables to their defaults.

@oantolin Yes, but this is a "feature request", not a "bug report". You started calling it a bug. ;)

Admittedly I use strict requirements to classify something as a bug. If you cannot demonstrate it in emacs -Q with some recipe it is not a bug. In this case, I am confident to make a definitive statement, since the feature request relates to the affix dispatcher, which I wrote and have used in my config for a long time. It is also pretty trivial code. But to take no chances, I even started emacs -Q and tried Orderless+Vertico only (I really did this, not just saying!). The dispatcher just works.

This is the part I'm calling a bug report:

I read the doc quoted below but still could not get !term to act as a non-match

And as I said, I couldn't reproduce the problem either.

Indeed, one can consider that a bug report. I suspect that the problem is that @rswgnu missed to evaluate some configuration, e.g., resetting completion-category-defaults and completion-category-overrides, such that another completion style is used instead of Orderless.

Also the point about $ is valid in the context of Consult. This is something I am not happy how it has been addressed so far. The information is not accessible and hard to find since it is buried in the wiki. I have not yet found the best place for it.

I think that with @minad's recent improvements the default configuration is pretty featureful, and I for one am now doing just minimal additional configuration on top the default. So I think this issue can be closed now. Of couse, if ! is still not working for @rswgnu we should figure out why.