[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master c879498 38/78: New commands avy-goto-line-above and avy-go
From: |
Oleh Krehel |
Subject: |
[elpa] master c879498 38/78: New commands avy-goto-line-above and avy-goto-line-below |
Date: |
Sat, 23 Jan 2016 13:59:57 +0000 |
branch: master
commit c87949847d045d22da8ebb782c082212af975fe8
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
New commands avy-goto-line-above and avy-goto-line-below
* avy.el (avy--line): Add BEG, END optional args.
(avy-goto-line-above): New command.
(avy-goto-line-below): New command.
Fixes #106
---
avy.el | 27 +++++++++++++++++++++++----
1 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/avy.el b/avy.el
index 756a62e..28a07f4 100644
--- a/avy.el
+++ b/avy.el
@@ -951,15 +951,16 @@ Which one depends on variable `subword-mode'."
(defvar visual-line-mode)
-(defun avy--line (&optional arg)
+(defun avy--line (&optional arg beg end)
"Select a line.
-The window scope is determined by `avy-all-windows' (ARG negates it)."
+The window scope is determined by `avy-all-windows' (ARG negates it).
+Narrow the scope to BEG END."
(let (candidates)
(avy-dowindows arg
- (let ((ws (window-start)))
+ (let ((ws (or beg (window-start))))
(save-excursion
(save-restriction
- (narrow-to-region ws (window-end (selected-window) t))
+ (narrow-to-region ws (or end (window-end (selected-window) t)))
(goto-char (point-min))
(while (< (point) (point-max))
(unless (get-char-property
@@ -1010,6 +1011,24 @@ Otherwise, forward to `goto-line' with ARG."
(avy-action-goto r))))))
;;;###autoload
+(defun avy-goto-line-above ()
+ "Goto visible line above the cursor."
+ (interactive)
+ (let ((r (avy--line nil (window-start) (point))))
+ (unless (eq r t)
+ (avy-action-goto r))))
+
+;;;###autoload
+(defun avy-goto-line-below ()
+ "Goto visible line below the cursor."
+ (interactive)
+ (let ((r (avy--line
+ nil (point)
+ (window-end (selected-window) t))))
+ (unless (eq r t)
+ (avy-action-goto r))))
+
+;;;###autoload
(defun avy-copy-line (arg)
"Copy a selected line above the current line.
ARG lines can be used."
- [elpa] master 72afecb 25/78: avy.el (avy-push-mark): Bring back push-mark, (continued)
- [elpa] master 72afecb 25/78: avy.el (avy-push-mark): Bring back push-mark, Oleh Krehel, 2016/01/23
- [elpa] master b1ef1f8 26/78: avy.el (avy--line): Obey avy-background, Oleh Krehel, 2016/01/23
- [elpa] master 48aa2cd 28/78: Improve avy-goto-char-timer so that it may read 1 or many chars, Oleh Krehel, 2016/01/23
- [elpa] master ac16227 27/78: Add padding for wide-width character, Oleh Krehel, 2016/01/23
- [elpa] master 67662ef 29/78: Fix indentation of defface, Oleh Krehel, 2016/01/23
- [elpa] master f9d7a76 31/78: Improve avy-goto-char-timer., Oleh Krehel, 2016/01/23
- [elpa] master 3f53a2a 30/78: avy.el (avy-goto-line): Fix off-by-one, Oleh Krehel, 2016/01/23
- [elpa] master acdd9e8 33/78: Modify avy--read-string-timer, Oleh Krehel, 2016/01/23
- [elpa] master 22b4ff0 32/78: Define new face avy-goto-char-timer-face for the highlights, Oleh Krehel, 2016/01/23
- [elpa] master bda04b2 35/78: Properly highlight depending on avy-all-windows, Oleh Krehel, 2016/01/23
- [elpa] master c879498 38/78: New commands avy-goto-line-above and avy-goto-line-below,
Oleh Krehel <=
- [elpa] master 248bff0 37/78: avy.el (avy--regex-candidates): Simplify, Oleh Krehel, 2016/01/23
- [elpa] master d439b9d 34/78: avy.el (avy--overlay-at-full): Avoid negative length, Oleh Krehel, 2016/01/23
- [elpa] master 70bd6ce 36/78: Search only in the visible region, Oleh Krehel, 2016/01/23
- [elpa] master f7ddd4b 39/78: Fix jumping to the last char of a folded Org outline, Oleh Krehel, 2016/01/23
- [elpa] master 528125e 40/78: avy.el (avy--process): Add window to candidates if not present, Oleh Krehel, 2016/01/23
- [elpa] master df181f1 44/78: avy.el (avy--read-candidates): Use avy-window-list, Oleh Krehel, 2016/01/23
- [elpa] master 964664c 45/78: Fix jumping to the last char of a folded Org outline, Oleh Krehel, 2016/01/23
- [elpa] master 0a18a45 43/78: avy.el (avy--read-candidates): Fix reverse order, Oleh Krehel, 2016/01/23
- [elpa] master 513c429 41/78: Make avy-goto-char-timer faster for org-mode, Oleh Krehel, 2016/01/23
- [elpa] master f28d238 46/78: Fix for combined org-indent-mode and visual-line-mode, Oleh Krehel, 2016/01/23