[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 1273871 2/6: avy-jump.el (avi--regex-candidates): Allow fo
From: |
Oleh Krehel |
Subject: |
[elpa] master 1273871 2/6: avy-jump.el (avi--regex-candidates): Allow for a predicate |
Date: |
Thu, 16 Apr 2015 12:13:05 +0000 |
branch: master
commit 1273871f444afe6db7f5e4881abd3d3b82653149
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
avy-jump.el (avi--regex-candidates): Allow for a predicate
---
avy-jump.el | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/avy-jump.el b/avy-jump.el
index b83f7a8..7419319 100644
--- a/avy-jump.el
+++ b/avy-jump.el
@@ -75,9 +75,10 @@ POS is either a position or (BEG . END)."
#'aw--remove-leading-chars))))
(aw--done)))
-(defun avi--regex-candidates (regex &optional wnd beg end)
+(defun avi--regex-candidates (regex &optional wnd beg end pred)
"Return all elements that match REGEX in WND.
-Each element of the list is ((BEG . END) . WND)."
+Each element of the list is ((BEG . END) . WND)
+When PRED is non-nil, it's a filter for matching point positions."
(setq wnd (or wnd (selected-window)))
(let ((we (or end (window-end (selected-window) t)))
candidates)
@@ -86,9 +87,11 @@ Each element of the list is ((BEG . END) . WND)."
(save-excursion
(goto-char (or beg (window-start)))
(while (re-search-forward regex we t)
- (push (cons (cons (match-beginning 0)
- (match-end 0))
- wnd) candidates)))
+ (when (or (null pred)
+ (funcall pred))
+ (push (cons (cons (match-beginning 0)
+ (match-end 0))
+ wnd) candidates))))
(nreverse candidates))))
(defun avi--overlay (str pt wnd)
- [elpa] master updated (f0c4778 -> cf04c93), Oleh Krehel, 2015/04/16
- [elpa] master 64759ec 4/6: avy-jump.el (avi--overlay-offset): Add, Oleh Krehel, 2015/04/16
- [elpa] master 1273871 2/6: avy-jump.el (avi--regex-candidates): Allow for a predicate,
Oleh Krehel <=
- [elpa] master d592e36 5/6: ace-window.el (aw--lead-overlay): Work around args-out-of-range, Oleh Krehel, 2015/04/16
- [elpa] master e7e8ee2 1/6: ace-window.el: Update comments, Oleh Krehel, 2015/04/16
- [elpa] master cf04c93 6/6: Merge commit 'd592e36f33ac7e1fece462c5b7157f330c732630' from ace-window, Oleh Krehel, 2015/04/16
- [elpa] master c581478 3/6: avy-jump.el (avi--overlay-at): New overlay style, Oleh Krehel, 2015/04/16