branch: externals/orderless
commit 237ee002acb3d1211d621a38eed42a4d200e0cef
Author: Omar Antolín <[email protected]>
Commit: Omar Antolín <[email protected]>
Make orderless-regexp match invalid regexps literally
---
orderless.el | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/orderless.el b/orderless.el
index f2b9d70527..9b2b3183c0 100644
--- a/orderless.el
+++ b/orderless.el
@@ -186,9 +186,11 @@ is determined by the values of `completion-ignore-case',
;;; Matching styles
-(defalias 'orderless-regexp #'identity
- "Match a component as a regexp.
-This is simply the identity function.")
+(defun orderless-regexp (component)
+ "Match a component as a regexp."
+ (condition-case nil
+ (progn (string-match-p component "") component)
+ (invalid-regexp (regexp-quote component))))
(defalias 'orderless-literal #'regexp-quote
"Match a component as a literal string.