branch: elpa/isl
commit fa34d564628f297f3233a8c6cb7d0e2d70519f8f
Author: Thierry Volpiatto <[email protected]>
Commit: Thierry Volpiatto <[email protected]>
Return directly boundary with single pattern
---
isearch-light.el | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/isearch-light.el b/isearch-light.el
index ab183e90e22..a0d598ee91b 100644
--- a/isearch-light.el
+++ b/isearch-light.el
@@ -291,15 +291,17 @@ Optional argument PATTERN default to `isl-pattern'."
(cons 'not (substring s 1))
(cons 'identity s))))
(initial (or (assq 'identity pattern)
- '(identity . ""))))
+ '(identity . "")))
+ (next (cdr pattern)))
(cl-loop while (re-search-forward (cdr initial) nil t)
- for boundary = (if (cdr pattern)
+ for boundary = (if next
(bounds-of-thing-at-point 'symbol)
(cons (match-beginning 0) (match-end 0)))
- if (cl-loop for (pred . re) in (cdr pattern)
- always (funcall pred
- (progn (goto-char (car boundary))
- (re-search-forward re (cdr
boundary) t))))
+ if (or (not next)
+ (cl-loop for (pred . re) in next
+ always (funcall pred
+ (progn (goto-char (car boundary))
+ (re-search-forward re (cdr
boundary) t)))))
do (goto-char (cdr boundary)) and return boundary
else do (goto-char (cdr boundary))
finally return nil)))