oantolin / orderless

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

Add orderless-kwd.el #169

Closed minad closed 8 months ago

minad commented 8 months ago

As discussed via mail and in the issues #30 and #162.

oantolin commented 8 months ago

You have several occurrences of (or (window-buffer (minibuffer-selected-window))). Are they missing a (current-buffer) branch of the or?

minad commented 8 months ago

You have several occurrences of (or (window-buffer (minibuffer-selected-window))). Are they missing a (current-buffer) branch of the or?

Good point. Fixed in https://github.com/oantolin/orderless/pull/169/commits/52b533329d39c1d4f520a47e477d7bc0242325b2.

oantolin commented 8 months ago

I was about to suggest the orig-buffer helper. :) I've added you as a collaborator to the repo, too, you should have received an invitation.

minad commented 8 months ago

I was about to suggest the orig-buffer helper. :) I've added you as a collaborator to the repo, too, you should have received an invitation.

Thanks! I've already accepted the invitation.

oantolin commented 8 months ago

Well, this looks great to me! I think on my list of suggestions the only thing left is maybe shortening some of the keywords. Feel free to do that or not as you prefer, and to merge when you are done (I have to go do some stuff and probably won't be back for several hours).

minad commented 8 months ago

Well, this looks great to me! I think on my list of suggestions the only thing left is maybe shortening some of the keywords. Feel free to do that or not as you prefer, and to merge when you are done (I have to go do some stuff and probably won't be back for several hours).

Thanks. I'd like shorter names, but I am a little torn on the shortening. I don't really like maj or chg (which bites the buffer-modified-p convention). As I wrote in my mail, I could also lookup the first or unique prefix. Alternatively I could match the keyword with orderless-flex and take the first matching one. That's maybe the nerdiest solution, since it reuses the internal Orderless flex facility. ;)

I will experiment a little bit and then merge. It doesn't hurt if we change the convention again later on, since the addition doesn't affect the stability of core orderless.el in any way.

oantolin commented 8 months ago

Another option: just don't shorten mode but keep the other shortenings I suggested.

minad commented 8 months ago

Okay, I tried the flex idea. It is ridiculously bad, since it matches too often. I cannot understand why anyone likes the flex style. I may like an anchored flex style, but not the one which just matches inside a word.

oantolin commented 8 months ago

Okay, I tried the flex idea. It is ridiculously bad, since it matches too often. I cannot understand why anyone likes the flex style. I may like an anchored flex style, but not the one which just matches inside a word.

I've never liked flex either! Maybe anchored flex is usable, I've never tried that.

oantolin commented 8 months ago

Thanks for contributing this and for handling the merging too!

minad commented 8 months ago

You're welcome. For now I went with the simplest solution of short three-letter keywords, similar to what you had suggested. We can adjust this if it turns out too limited at some point. I guess we are going to add more matchers in the future.