[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master eed8f6f 15/36: avy.el (avy--regex-candidates): Add optiona
From: |
Oleh Krehel |
Subject: |
[elpa] master eed8f6f 15/36: avy.el (avy--regex-candidates): Add optional group arg |
Date: |
Tue, 19 May 2015 12:38:12 +0000 |
branch: master
commit eed8f6fa8b52b1e6d194de8cb1bb44fedfea08e0
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
avy.el (avy--regex-candidates): Add optional group arg
---
avy.el | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/avy.el b/avy.el
index 8fa80f6..c3099eb 100644
--- a/avy.el
+++ b/avy.el
@@ -313,10 +313,12 @@ Use OVERLAY-FN to visualize the decision overlay."
(setq avy--overlays-back nil)
(avy--remove-leading-chars))
-(defun avy--regex-candidates (regex &optional beg end pred)
+(defun avy--regex-candidates (regex &optional beg end pred group)
"Return all elements that match REGEX.
Each element of the list is ((BEG . END) . WND)
-When PRED is non-nil, it's a filter for matching point positions."
+When PRED is non-nil, it's a filter for matching point positions.
+When GROUP is non-nil, (BEG . END) should delimit that regex group."
+ (setq group (or group 0))
(let ((case-fold-search avy-case-fold-search)
candidates)
(avy-dowindows nil
@@ -327,8 +329,8 @@ When PRED is non-nil, it's a filter for matching point
positions."
(unless (get-char-property (point) 'invisible)
(when (or (null pred)
(funcall pred))
- (push (cons (cons (match-beginning 0)
- (match-end 0))
+ (push (cons (cons (match-beginning group)
+ (match-end group))
wnd) candidates)))))))
(nreverse candidates)))
- [elpa] master updated (b525e2d -> e559638), Oleh Krehel, 2015/05/19
- [elpa] master c2e7de3 01/36: avy-jump.el (avy-goto-subword-0): Add nreverse, Oleh Krehel, 2015/05/19
- [elpa] master 05e5c4d 06/36: README.md: mention avy-goto-line -> goto-line, Oleh Krehel, 2015/05/19
- [elpa] master 755c25a 09/36: Add a new face for 'at-full style, Oleh Krehel, 2015/05/19
- [elpa] master cd8e626 02/36: avy-jump.el (avy-dowindows): Simplify, Oleh Krehel, 2015/05/19
- [elpa] master 3716cd0 03/36: avy-jump.el (avy-goto-subword-0): Update candidate order, Oleh Krehel, 2015/05/19
- [elpa] master dfbf0e2 13/36: targets/avy-init.el: Update, Oleh Krehel, 2015/05/19
- [elpa] master 60dd24b 12/36: Update avy-jump mentions in the README, Oleh Krehel, 2015/05/19
- [elpa] master a08b049 04/36: Fix jumping to newlines with at-full style, Oleh Krehel, 2015/05/19
- [elpa] master eed8f6f 15/36: avy.el (avy--regex-candidates): Add optional group arg,
Oleh Krehel <=
- [elpa] master 0d83599 16/36: Update group name, Oleh Krehel, 2015/05/19
- [elpa] master ca69b1f 14/36: Add debug declarations, Oleh Krehel, 2015/05/19
- [elpa] master a53ffb7 05/36: Allow to break from `avy-goto-line' into `goto-line', Oleh Krehel, 2015/05/19
- [elpa] master ca302b4 08/36: targets/avy-init.el: Move, Oleh Krehel, 2015/05/19
- [elpa] master b0512fc 21/36: avy.el (avy--overlay-at): Use `avy--overlay-offset', Oleh Krehel, 2015/05/19
- [elpa] master 04d26c4 07/36: avy-jump.el (avy-case-fold-search): New defcustom, Oleh Krehel, 2015/05/19
- [elpa] master b602a56 17/36: Stop 'at-full from shifting text, Oleh Krehel, 2015/05/19
- [elpa] master ea6f5c5 25/36: Customize how `avy-lead-face-0' is applied, Oleh Krehel, 2015/05/19
- [elpa] master 8efed40 20/36: Add `avy-lead-face-1' for dimmed matched chars, Oleh Krehel, 2015/05/19
- [elpa] master 410c4ac 11/36: Merge avy-jump.el into avy.el, Oleh Krehel, 2015/05/19