[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master cd6583b 04/17: avy-jump.el (avi-all-windows): New defcusto
From: |
Oleh Krehel |
Subject: |
[elpa] master cd6583b 04/17: avy-jump.el (avi-all-windows): New defcustom |
Date: |
Fri, 08 May 2015 13:43:39 +0000 |
branch: master
commit cd6583be1113fca16e77e1308b3503ab409885cc
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
avy-jump.el (avi-all-windows): New defcustom
* avy-jump.el (avi--regex-candidates): When `avi-all-windows' is
non-nil, use all windows instead of just the current.
---
avy-jump.el | 35 ++++++++++++++++++++---------------
1 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/avy-jump.el b/avy-jump.el
index 60f4f25..3d45065 100644
--- a/avy-jump.el
+++ b/avy-jump.el
@@ -75,25 +75,30 @@ POS is either a position or (BEG . END)."
#'aw--remove-leading-chars))))
(aw--done)))
+(defcustom avi-all-windows t
+ "When non-nil, loop though all windows for candidates."
+ :type 'boolean)
+
(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)
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)
- (save-window-excursion
- (select-window wnd)
- (save-excursion
- (goto-char (or beg (window-start)))
- (while (re-search-forward regex we t)
- (unless (get-char-property (point) 'invisible)
- (when (or (null pred)
- (funcall pred))
- (push (cons (cons (match-beginning 0)
- (match-end 0))
- wnd) candidates)))))
- (nreverse candidates))))
+ (let (candidates)
+ (dolist (wnd (if avi-all-windows
+ (window-list)
+ (list (selected-window))))
+ (with-selected-window wnd
+ (let ((we (or end (window-end (selected-window) t))))
+ (save-excursion
+ (goto-char (or beg (window-start)))
+ (while (re-search-forward regex we t)
+ (unless (get-char-property (point) 'invisible)
+ (when (or (null pred)
+ (funcall pred))
+ (push (cons (cons (match-beginning 0)
+ (match-end 0))
+ wnd) candidates))))))))
+ (nreverse candidates)))
(defvar avi--overlay-offset 0
"The offset to apply in `avi--overlay'.")
- [elpa] master updated (876d210 -> 269e61a), Oleh Krehel, 2015/05/08
- [elpa] master 7b44c1f 01/17: avy-jump.el (avi-goto-subword-0): New command, Oleh Krehel, 2015/05/08
- [elpa] master b61131c 03/17: avy-jump.el (avi--overlay-pre): Handle plain numbers, Oleh Krehel, 2015/05/08
- [elpa] master ff4ce51 02/17: Don't collect candidates hidden by outlines, Oleh Krehel, 2015/05/08
- [elpa] master cd6583b 04/17: avy-jump.el (avi-all-windows): New defcustom,
Oleh Krehel <=
- [elpa] master f92689a 06/17: avy-jump.el (avi--line): Fixup the issue with org outlines, Oleh Krehel, 2015/05/08
- [elpa] master 17b44a8 05/17: Update a few commands to jump in one or more windows, Oleh Krehel, 2015/05/08
- [elpa] master 3bbd404 08/17: Make sure avi-move-line and avi-copy-line behave consistently., Oleh Krehel, 2015/05/08
- [elpa] master ca92a08 09/17: avy-jump.el (avi-goto-word-1): Count some syms as words, Oleh Krehel, 2015/05/08
- [elpa] master dfe24f3 11/17: Add `avi-word-punc-regexp` defcustom, Oleh Krehel, 2015/05/08
- [elpa] master 6a0acfc 10/17: Add "make compile" and "make run", Oleh Krehel, 2015/05/08
- [elpa] master ee76efd 12/17: Fix rounding error, Oleh Krehel, 2015/05/08
- [elpa] master d1780dd 07/17: avy-jump.el (avi-goto-line): Work with one or more windows, Oleh Krehel, 2015/05/08
- [elpa] master 1e94459 13/17: avy-jump.el (avi--goto): Push mark before moving, Oleh Krehel, 2015/05/08
- [elpa] master c53b0d2 14/17: Start the decoupling of ace-window and avy-jump, Oleh Krehel, 2015/05/08