branch: elpa/isl
commit 8a659558c863c7d499b2b029b94df4d4ebb2509c
Author: Thierry Volpiatto <[email protected]>
Commit: Thierry Volpiatto <[email protected]>
Add a function to get patterns
---
isearch-light.el | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/isearch-light.el b/isearch-light.el
index 9ee1413caa2..b26b240d628 100644
--- a/isearch-light.el
+++ b/isearch-light.el
@@ -285,11 +285,14 @@ Optional argument PATTERN default to `isl-pattern'."
(if (string-match "[[:upper:]]" pattern) nil t)))
(t isl-case-fold-search)))
+(defun isl-patterns (str)
+ (cl-loop for s in (split-string str)
+ collect (if (char-equal ?! (aref s 0))
+ (cons 'not (substring s 1))
+ (cons 'identity s))))
+
(defun isl-multi-search-fwd (str &optional _bound _noerror)
- (let* ((pattern (cl-loop for s in (split-string str)
- collect (if (char-equal ?! (aref s 0))
- (cons 'not (substring s 1))
- (cons 'identity s))))
+ (let* ((pattern (isl-patterns str))
(initial (or (assq 'identity pattern)
'(identity . "")))
(next (cdr pattern)))