emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/orderless 237ee002ac 158/204: Make orderless-regexp mat


From: ELPA Syncer
Subject: [elpa] externals/orderless 237ee002ac 158/204: Make orderless-regexp match invalid regexps literally
Date: Tue, 11 Jan 2022 12:58:27 -0500 (EST)

branch: externals/orderless
commit 237ee002acb3d1211d621a38eed42a4d200e0cef
Author: Omar Antolín <omar.antolin@gmail.com>
Commit: Omar Antolín <omar.antolin@gmail.com>

    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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]