oantolin / orderless

Emacs completion style that matches multiple regexps in any order
GNU General Public License v3.0
745 stars 27 forks source link

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

Closed rswgnu closed 6 months ago

rswgnu commented 1 year ago

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).

oantolin commented 1 year ago

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.

minad commented 1 year ago

On 2/22/23 05:58, Omar Antolín Camarena wrote:

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.

There is no bug. The affix dispatcher work in emacs -Q as expected. It also works in my personal config of course.

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

I am happy with the affix dispatcher default, but we had at least this one report where someone was confused. The question was if we should revert to no dispatcher by default?

minad commented 1 year ago

On 2/22/23 05:22, Robert Weiner wrote:

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.

This works for me in my config and in emacs -Q. Not sure what is wrong, but maybe something in your configuration interferes. Maybe completion-category-defaults and completion-category-overrides?

I think I also had trouble using $ in regexes but am not sure. I tried and tried and failed.

This could be a problem, which only occurs for Consult commands, since Consult uses a trick with invisible trailing characters to disambiguate candidates. See the Consult wiki for some additional configuration:

https://github.com/minad/consult/wiki#minads-orderless-configuration

Maybe this information should be placed somewhere more prominently. I had linked from it from the Vertico and Corfu example configuration, but these links seem to be outdated by now.

oantolin commented 1 year ago

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.

minad commented 1 year ago

@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.

oantolin commented 1 year ago

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.

minad commented 1 year ago

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.

rswgnu commented 1 year ago

When I have time, I will test some more without any orderless config. I know orderless was active but maybe I had basic completion enabled as well. Thanks for all the feedback.

On Wed, Feb 22, 2023 at 1:26 AM Daniel Mendler @.***> wrote:

Indeed, one can consider that a bug report. I suspect that the problem is that @rswgnu https://github.com/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.

— Reply to this email directly, view it on GitHub https://github.com/oantolin/orderless/issues/135#issuecomment-1439501960, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE5WPDY3WHRKRAGM7HH5Y23WYWWRPANCNFSM6AAAAAAVD2Q5BE . You are receiving this because you were mentioned.Message ID: @.***>

oantolin commented 6 months ago

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.