orderless icon indicating copy to clipboard operation
orderless copied to clipboard

Dispatcher choices by default?

Open alphapapa opened this issue 4 years ago • 4 comments

Hi,

I'm finally giving Orderless a try, and I'm liking it a lot. @karthink over on #systemcrafters:libera.chat pointed out the dispatchers to me. I was a little surprised to see that there are no dispatcher functions included by default, provided as choices for the customization option. For example, karthink mentioned:

This works everywhere orderless does, so I've set it up to match "foo=", "foo,", "foo`" and "!foo" using the literal, initialism, flex and negation completion styles

It would be nice to be able to configure those just by selecting options for orderless-style-dispatchers rather than having to write the functions myself. :)

Thanks for your work on Orderless! Emacs's completion systems have gotten so much better so quickly thanks to packages like this.

alphapapa avatar Sep 16 '21 23:09 alphapapa

Cool! I'm glad you're trying orderless!

About the lack of built-in dispatchers: I decided not to provide any "syntax" choices (some are suggested in the documentation). I see syntax as being as personal as top-level key bindings, which I also would not include in any of my packages.

oantolin avatar Sep 17 '21 11:09 oantolin

I guess I was expecting a customization UI something like:

Dispatcher:
  Prefix string: "!"
  Suffix string: nil
  Function: negate-match
Dispatcher:
  Prefix string: nil
  Suffix string: "~"
  Function: flex-match

Where the strings could be input, and then the dispatcher function could be selected from a list. That would be helpful to users who don't know enough Elisp to write functions and add them to their config, but who are familiar with regexps, searching, negation, etc, so they could put the pieces together in the customization UI.

alphapapa avatar Sep 17 '21 12:09 alphapapa

That's not a bad idea. I think prefixes and suffixes cover most syntax people would want.

oantolin avatar Sep 17 '21 13:09 oantolin

Yes, that would be great. Even for someone like me, who could easily write those functions and add them to my config, that would take about 100x longer than clicking a few buttons in the UI. :)

alphapapa avatar Sep 17 '21 15:09 alphapapa

@alphapapa Please take a look at e00fbed14086b6b4bc6a604f407b2efb5721ccbf, which adds a nice default dispatcher that @minad wrote and makes it easy to configure via customize.

oantolin avatar Jan 29 '23 17:01 oantolin