Comments (24)
Yeah, it does not add much but as it doesn't harm and some will probably like it, I think that would be nice..
from orderless.
Sure, I'd make it configurable.
from orderless.
I think maybe a single !
is a better default, since the negation of the empty string can't match anything so you're not likely to want a lone !
somewhere.
from orderless.
I think the only sensible way to make the change is what I outlined above, because orderless-filter is the function that would need to implement the complement-taking and it knows nothing about the default configuration, it just calls the pattern compiler to get a list of regexps. So the pattern compiler needs to be able to signal to orderless-filter that the complement is required.
from orderless.
I guess for a negated query nothing should be highlighted...
from orderless.
You mean negating entire queries here, right? Because afterwards you say:
Yes, sorry.
I know how I'd implement it and it's not too much work, I just don't think it really justifies the effort.
That's perfectly fine. I like that more than adding unnecessary features!
from orderless.
I recently thought about opening an related issue so I will mention it here: It would be nice to include some component dispatcher styles by default.
from orderless.
@clemera What do you mean? I am using this very simple dispatcher right now.
(defun my-orderless-dispatch (pattern _index _total)
(cond
((string-prefix-p "!" pattern) `(orderless-without-literal . ,(substring pattern 1)))
((string-suffix-p "=" pattern) `(orderless-literal . ,(substring pattern 0 -1)))
((string-suffix-p "~" pattern) `(orderless-flex . ,(substring pattern 0 -1)))))
from orderless.
Yeah, I mean something like that would be good to include. I think most users would appreciate it and those which don't like it or use their own dispatchers anyway aren't affected.
from orderless.
Yeah, I mean something like that would be good to include. I think most users would appreciate it and those which don't like it or use their own dispatchers anyway aren't affected.
I am not sure. For now I would keep it as is and rather defer this to some hypothetical demo configuration/gluing package which sets up all the things. I prefer if orderless only provides essential building blocks.
from orderless.
I prefer if orderless only provides essential building blocks.
I was going to say exactly that.
As for this !!!
idea, I think I like it.
from orderless.
I prefer if orderless only provides essential building blocks.
In my opinion it would still do that, how does a better default harm?
from orderless.
Well, none of your proposed dispatchers would be on by default, right? Probably a style dispatcher for negative literals would be a good idea and I doubt many people would object to the !literal
syntax.
Are there any other syntaxes that are not controversial besides !literal
? Maybe literal=
(though in my config I use both =literal
and literal=
for literal matching).
from orderless.
Maybe !literal
could be included by default, that is what people coming from ivy would probably miss most. I have stolen literal=
a long while ago from you and really like it but I agree having it included by default may be controversial. On the other hand I would see nothing wrong with it, when you install orderless you assume you get some orderless filter style (whatever that might be), then if you don't like it one can investigate.
from orderless.
BTW I was only talking about giving orderless-style-dispatchers
a nice non-nil default value it just occurred to me that you may have assumed that I want to bake these sort of things in which I agree would be a really bad idea.
from orderless.
Don't worry, I understood what you meant. I guess I should keep the orderless-without-literal matching style, add an orderless-bang-dispatcher or something like that and add it to orderless-style-dispatcher by default, right?
from orderless.
If you add a dispatcher similar to the one I am using I would probably not install my own dispatcher
from orderless.
I think I'd just add a dispatcher for !literal
. The orderless-without-literal
matching style really is special in that you'd probably never want to use without a dispatcher.
from orderless.
Ideally the !!! token should also be configurable such that one can dispatch to the complement-style if that is possible.
from orderless.
So I guess the type of pattern compilers should change. Now they have to return a list of regexps, I guess they could be allowed to return either a list of regexps or a list of the form (cons 'not list-of-regexps)
. And the default pattern compiler can check for these negation tokens to decide whether to include the not
.
from orderless.
Instead of changing everything I would probably hard-code this single special case with a separate configuration variable for the token. Or just fix it to "!". You could still generalize things regarding your pattern compiler later if it turns out to be useful. But note that I have no real insight regarding the orderless codebase, I only skimmed it quickly a few times and it looked good
So maybe what you are proposing is not a big change?
EDIT: Btw I changed the prefix token of consult-keep/hide-lines now to "! " such that we have compatibility.
from orderless.
I'm suddenly not so sure about this feature. Other than unifying keep and flush lines what do we really want it for? I think having negative literals is superuseful, but negating an entire query what is that useful for? If making keep lines act as flush lines is the only place this would be used, I'd rather just have this handled in consult, or even go back to separate keep and flush commands. What are some other use cases for negating an entire multi-component query?
from orderless.
@oantolin I am also fine with having the prefix "! SPC" only in consult. When I made this proposal I had not considered that possibility yet and thought that the negated literal could be useful for other things. But I do not have another need for it as of now. I agree with negative literals and their usefulness.
Regarding separate keep/flush commands - I prefer to keep the "! SPC" in band notation because of its explicitness.
I close this! Thank you for rethinking it again!
from orderless.
[...] thought that the negated literal could be useful for other things. But I do not have another need for it as of now.
You mean negating entire queries here, right? Because afterwards you say:
I agree with negative literals and their usefulness.
Which I think we all agree on.
Regarding separate keep/flush commands - I prefer to keep the "! SPC" in band notation because of its explicitness.
Fine by me!
I close this! Thank you for rethinking it again!
I know how I'd implement it and it's not too much work, I just don't think it really justifies the effort.
from orderless.
Related Issues (20)
- Release new version 0.8 on GNU ELPA HOT 7
- Completion variables recommended configuration HOT 3
- Orderless never returns a sole match for `switch-to-buffer` HOT 2
- Non-greedy match for orderless-flex? HOT 9
- Prescient defines a completion style
- How do I dispatch filtering on a suffix? HOT 3
- Ido or icomplete HOT 2
- Multiple matches, and/or over specifying candidates HOT 2
- I can't get the suggsted configuration for integration with Company to work. HOT 3
- Confusing highlighting when using `orderless-flex` style HOT 3
- Orderless with a single component HOT 3
- possible bug in completion style for repeated pattern HOT 12
- It doesn't seem to affect `C-x b` the same way as, e.g., `M-x` HOT 2
- Add simple affix dispatcher HOT 11
- I've been thinking about using it for Embark and maybe removing the `embark-define-keymap` macro in favor of `defvar-keymap`. HOT 1
- FEATURE REQUEST: Consider making your personal configuration the default (doc does not help get to that solution) HOT 8
- How to disable orderless for company or corfu HOT 8
- Get file basename? HOT 19
- Use company, orderless, company-fuzzy, auctex, and ispell all together. HOT 6
- Orderless doesn't work as desired. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from orderless.