[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 17b44a8 05/17: Update a few commands to jump in one or mor
From: |
Oleh Krehel |
Subject: |
[elpa] master 17b44a8 05/17: Update a few commands to jump in one or more windows |
Date: |
Fri, 08 May 2015 13:43:40 +0000 |
branch: master
commit 17b44a8b850e6c06b2bbfbd668c10295bc96c4d8
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Update a few commands to jump in one or more windows
* avy-jump.el (avi--generic-jump): New defun.
(avi-goto-char): Update.
(avi-goto-char-2): Update.
(avi-goto-word-0): Update.
(avi-goto-subword-0): Update.
---
avy-jump.el | 73 ++++++++++++++++++++++++++++++++++-------------------------
1 files changed, 42 insertions(+), 31 deletions(-)
diff --git a/avy-jump.el b/avy-jump.el
index 3d45065..0711280 100644
--- a/avy-jump.el
+++ b/avy-jump.el
@@ -172,30 +172,39 @@ LEAF is ((BEG . END) . WND)."
(cdr leaf)
(selected-window))))
+(defun avi--generic-jump (regex flip)
+ "Jump to REGEX.
+When FLIP is non-nil, flip `avi-all-windows'."
+ (let ((avi-all-windows
+ (if flip
+ (not avi-all-windows)
+ avi-all-windows)))
+ (avi--goto
+ (avi--process
+ (avi--regex-candidates
+ regex)
+ #'avi--overlay-post))))
+
;;* Commands
;;;###autoload
-(defun avi-goto-char ()
- "Read one char and jump to it in current window."
- (interactive)
- (avi--goto
- (avi--process
- (avi--regex-candidates
- (string (read-char "char: "))
- (selected-window))
- #'avi--overlay-post)))
+(defun avi-goto-char (&optional arg)
+ "Read one char and jump to it.
+The window scope is determined by `avi-all-windows'.
+When ARG is non-nil, flip the window scope."
+ (interactive "P")
+ (avi--generic-jump
+ (string (read-char "char: ")) arg))
;;;###autoload
-(defun avi-goto-char-2 ()
- "Read two chars and jump to them in current window."
- (interactive)
- (avi--goto
- (avi--process
- (avi--regex-candidates
- (string
- (read-char "char 1: ")
- (read-char "char 2: "))
- (selected-window))
- #'avi--overlay-post)))
+(defun avi-goto-char-2 (&optional arg)
+ "Read two chars and jump to them in current window.
+When ARG is non-nil, flip the window scope."
+ (interactive "P")
+ (avi--generic-jump
+ (string
+ (read-char "char 1: ")
+ (read-char "char 2: "))
+ arg))
;;;###autoload
(defun avi-isearch ()
@@ -210,19 +219,21 @@ LEAF is ((BEG . END) . WND)."
(avi--goto candidate)))
;;;###autoload
-(defun avi-goto-word-0 ()
- "Jump to a word start in current window."
- (interactive)
- (let* ((avi-keys (number-sequence ?a ?z))
- (candidates (avi--regex-candidates "\\b\\sw")))
- (avi--goto
- (avi--process candidates #'avi--overlay-pre))))
+(defun avi-goto-word-0 (arg)
+ "Jump to a word start."
+ (interactive "P")
+ (let ((avi-keys (number-sequence ?a ?z)))
+ (avi--generic-jump "\\b\\sw" arg)))
;;;###autoload
-(defun avi-goto-subword-0 ()
- "Jump to a word or subword start in current window."
- (interactive)
- (let* ((avi-keys (number-sequence ?a ?z))
+(defun avi-goto-subword-0 (&optional arg)
+ "Jump to a word or subword start."
+ (interactive "P")
+ (let* ((avi-all-windows
+ (if arg
+ (not avi-all-windows)
+ avi-all-windows))
+ (avi-keys (number-sequence ?a ?z))
(candidates (avi--regex-candidates
"\\(\\b\\sw\\)\\|\\(?:[^A-Z]\\([A-Z]\\)\\)")))
(dolist (x candidates)
- [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, 2015/05/08
- [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 <=
- [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
- [elpa] master cc38c04 16/17: Bump version, Oleh Krehel, 2015/05/08
- [elpa] master 269e61a 17/17: Merge commit 'cc38c044a13e6df822431d6c706cf4b9255900bd' from ace-window, Oleh Krehel, 2015/05/08