branch: elpa/isl
commit 07f9ec6c6f4ebe65514af327dd924f88ed9f309d
Author: Thierry Volpiatto <[email protected]>
Commit: Thierry Volpiatto <[email protected]>
Handle negation in first pattern
---
isearch-light.el | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/isearch-light.el b/isearch-light.el
index a823946f792..ab183e90e22 100644
--- a/isearch-light.el
+++ b/isearch-light.el
@@ -286,11 +286,13 @@ Optional argument PATTERN default to `isl-pattern'."
(t isl-case-fold-search)))
(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)))))
- (cl-loop while (re-search-forward (cdar pattern) nil t)
+ (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))))
+ (initial (or (assq 'identity pattern)
+ '(identity . ""))))
+ (cl-loop while (re-search-forward (cdr initial) nil t)
for boundary = (if (cdr pattern)
(bounds-of-thing-at-point 'symbol)
(cons (match-beginning 0) (match-end 0)))