[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 15d0679 75/78: copy/move line to an initial window
From: |
Oleh Krehel |
Subject: |
[elpa] master 15d0679 75/78: copy/move line to an initial window |
Date: |
Sat, 23 Jan 2016 14:00:28 +0000 |
branch: master
commit 15d0679385fdf3f1d20904ff68ebcb522c4a87d4
Author: denin <address@hidden>
Commit: denin <address@hidden>
copy/move line to an initial window
---
avy.el | 74 +++++++++++++++++++++++++++++++++------------------------------
1 files changed, 39 insertions(+), 35 deletions(-)
diff --git a/avy.el b/avy.el
index 7af1de8..5205145 100644
--- a/avy.el
+++ b/avy.el
@@ -1117,47 +1117,51 @@ Otherwise, forward to `goto-line' with ARG."
"Copy a selected line above the current line.
ARG lines can be used."
(interactive "p")
- (avy-with avy-copy-line
- (let* ((start (avy--line))
- (str (buffer-substring-no-properties
- start
- (save-excursion
- (goto-char start)
- (move-end-of-line arg)
- (point)))))
- (cond ((eq avy-line-insert-style 'above)
- (beginning-of-line)
- (save-excursion
- (insert str "\n")))
- ((eq avy-line-insert-style 'below)
- (end-of-line)
- (insert "\n" str)
- (beginning-of-line))
- (t
- (user-error "Unexpected `avy-line-insert-style'"))))))
+ (let ((initial-window (selected-window)))
+ (avy-with avy-copy-line
+ (let* ((start (avy--line))
+ (str (buffer-substring-no-properties
+ start
+ (save-excursion
+ (goto-char start)
+ (move-end-of-line arg)
+ (point)))))
+ (select-window initial-window)
+ (cond ((eq avy-line-insert-style 'above)
+ (beginning-of-line)
+ (save-excursion
+ (insert str "\n")))
+ ((eq avy-line-insert-style 'below)
+ (end-of-line)
+ (insert "\n" str)
+ (beginning-of-line))
+ (t
+ (user-error "Unexpected `avy-line-insert-style'")))))))
;;;###autoload
(defun avy-move-line (arg)
"Move a selected line above the current line.
ARG lines can be used."
(interactive "p")
- (avy-with avy-move-line
- (let ((start (avy--line)))
- (save-excursion
- (goto-char start)
- (kill-whole-line arg))
- (cond ((eq avy-line-insert-style 'above)
- (beginning-of-line)
- (save-excursion
- (insert
- (current-kill 0))))
- ((eq avy-line-insert-style 'below)
- (end-of-line)
- (newline)
- (save-excursion
- (insert (substring (current-kill 0) 0 -1))))
- (t
- (user-error "Unexpected `avy-line-insert-style'"))))))
+ (let ((initial-window (selected-window)))
+ (avy-with avy-move-line
+ (let ((start (avy--line)))
+ (save-excursion
+ (goto-char start)
+ (kill-whole-line arg))
+ (select-window initial-window)
+ (cond ((eq avy-line-insert-style 'above)
+ (beginning-of-line)
+ (save-excursion
+ (insert
+ (current-kill 0))))
+ ((eq avy-line-insert-style 'below)
+ (end-of-line)
+ (newline)
+ (save-excursion
+ (insert (substring (current-kill 0) 0 -1))))
+ (t
+ (user-error "Unexpected `avy-line-insert-style'")))))))
;;;###autoload
(defun avy-copy-region (arg)
- [elpa] master a45159a 64/78: avy.el (avy-goto-line-above): Exclude the current line, (continued)
- [elpa] master a45159a 64/78: avy.el (avy-goto-line-above): Exclude the current line, Oleh Krehel, 2016/01/23
- [elpa] master fa6d1e1 66/78: avy.el (avy-copy-region): Fix for multi-buffer use, Oleh Krehel, 2016/01/23
- [elpa] master b1a1953 67/78: Customize extra chars for avy-goto-subword-1, Oleh Krehel, 2016/01/23
- [elpa] master bae6fb1 71/78: avy.el (avy-copy-region): Keep same selectors for the second pass, Oleh Krehel, 2016/01/23
- [elpa] master 72ecbfa 68/78: avy.el (avy-goto-line): fix for narrowed regions, Oleh Krehel, 2016/01/23
- [elpa] master 9d18bf9 70/78: avy.el (avy--overlay): Fix overlays at point-max, Oleh Krehel, 2016/01/23
- [elpa] master 47035cf 69/78: avy.el (avy--line): Don't modify avy-action, Oleh Krehel, 2016/01/23
- [elpa] master 808bb80 72/78: avy.el (avy--regex-candidates): Modify case-fold-search condition, Oleh Krehel, 2016/01/23
- [elpa] master 212a132 74/78: Don't shorten selector string for visual-line-mode and bolp, Oleh Krehel, 2016/01/23
- [elpa] master dd80749 73/78: Add case fold search to avy-goto-char-timer, Oleh Krehel, 2016/01/23
- [elpa] master 15d0679 75/78: copy/move line to an initial window,
Oleh Krehel <=
- [elpa] master 369af59 76/78: avy.el (avy--overlay): Fix interaction with goto-address-mode, Oleh Krehel, 2016/01/23
- [elpa] master 11fbd70 77/78: Bump version, Oleh Krehel, 2016/01/23
- [elpa] master a6b7502 78/78: Merge commit '11fbd70347a8cc62817c6d4ebf2291471ebdd607' from avy, Oleh Krehel, 2016/01/23