Comments (9)
I think there was a third style which in addition to being strict anchored the match at the beginning!
Since initialisms already only match characters at word boundaries I don't find this non-strict matching really causes many false positives, at least not for command names which is really the only thing I use initialism matching for.
from orderless.
One could even use a variant of flex which is more strict and doesn't skip the same letter. abc -> a[^b]*b[^c]*c
. These regexps perform better.
from orderless.
My implementation, inspired by @minad 's comment:
(defun my-orderless-non-greedy-flex (component)
(rx-to-string
`(seq ,@(cl-loop
for (head . tail) on (string-to-list component)
collect `(group ,head)
when tail
collect `(* (not ,(car tail)))))))
(my-orderless-non-greedy-flex "abc")
=> "\\(?:\\(a\\)[^b]*\\(b\\)[^c]*\\(c\\)\\)"
from orderless.
Thanks for the suggestion, @daanturo. I went with @minad's suggested compilation.
from orderless.
@oantolin Are there more matching styles which could be made more strict such that we get better complexity? Initialism?
I think it is worth the trade off since regexps like the ones generated by the old flex compiler behaved really badly for long candidates. We discussed this a while ago in another issue.
from orderless.
I don't think initialism would benefit from a similar compilation since it already only matches characters at word boundaries. But it does make sense to think about each style to make sure we aren't missing any obvious compiler optimizations.
from orderless.
For initialism does ac match axxx-bxxx-cxxx or only axxx-cxxx? I mean such an optimization, maybe there are others for other styles?
I think I prefer matching less with better performance instead of more flexible matching. I also like literal more than flex. But one should keep in mind that restricting the style may be undesired for other users who prefer more typo tolerance.
from orderless.
For initialism does ac match axxx-bxxx-cxxx or only axxx-cxxx?
It does match axxx-bxxx-cxxx. There used to be a related matching style called "strict initialism" that would only match "axxx-cxxx".
from orderless.
Yes, but didn't the strict style also have anchoring? I thought we could maybe use an unanchored strict style.
from orderless.
Related Issues (20)
- Orderless breaks ESS completion in region HOT 1
- orderless doesn't work with fido HOT 5
- Document `(orderless basic)` as recommended configuration HOT 18
- Different completion candidates in Corfu and Company HOT 2
- Failed to install orderless HOT 2
- 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
- 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
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.