Comments (20)
It happens because with those matching styles (with any list of matching styles that includes orderless-regexp
), the incomplete [0-9
gets compiled to a malformed regexp. Mmh.
from orderless.
I'm looking into the best way to do it. Maybe there is something better, but matching against anything (an empty string, for example) should work: if it returns it's valid, if it errors it's not.
from orderless.
I thought the (defalias 'orderless-regexp #'identity)
implementation was cute, I'm kind of sad to see it go.
from orderless.
You could introduce (defalias 'orderless-regexp-I-know-what-I-am-doing #'identity)
.
from orderless.
Sure, why not? The only thing that gives me pause is that you said elsewhere it didn't work for you. Let's figure out why not before doing anything.
from orderless.
Yes, sure. I wonder why it didn't work like this. Otherwise I don't see big downsides of doing this. And one could use style dispatchers to mark certain parts of the input as explicitly literal/regexp. However style dispatchers will also introduce problems regarding to the matching of exact inputs.
from orderless.
I set (setq orderless-matching-styles '(orderless-regexp orderless-literal orderless-initialism))
.
If I invoke consult-line
and enter [0-9
, then it does not match anything. As soon as I close [0-9]
it matches both 1329817321
and [0-9]
, assuming that [0-9]
occurs literally in the buffer. This is the bug.
from orderless.
Mmh. Does changing the order of orderless-regexp
and orderless-literal
make any difference (it shouldn't, but if it does that might be a clue)?
from orderless.
No difference.
from orderless.
I'll look into it. I thought my tests covered this case...
from orderless.
Hmm, I see. Is it hard to detect if a regexp is valid and only include it in that case?
from orderless.
It looks like re-builder
uses that strategy, so I will too.
from orderless.
I wonder why the current approach didn't lead to errors. Is this because the matching happens deep inside all-completions
in the c code?
from orderless.
The reason is that I already have a condition-case
to catch errors in matching and just report no matches.
from orderless.
I think I'll have the orderless-regexp
style match invalid regexps literally. This seems to be the least surprising behavior.
from orderless.
OK, done. a609004
Now I'll add orderless-literal
to the default matching styles.
from orderless.
Great, thanks! Nice that we also uncovered a bug through this discussion. cc @jaor
from orderless.
from orderless.
from orderless.
This why I always bind M-RET
to exit-minibuffer
, I get sick of any completion UI telling me what I can and cannot submit as input. All of them do it in different circumstances, I think.
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.