[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 105efc8 037/110: avy.el (avy-action-copy): Copy line for a
From: |
Oleh Krehel |
Subject: |
[elpa] master 105efc8 037/110: avy.el (avy-action-copy): Copy line for avy-goto-line |
Date: |
Sat, 11 May 2019 10:15:39 -0400 (EDT) |
branch: master
commit 105efc84827cb764cac1e1e3a793abf106837021
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
avy.el (avy-action-copy): Copy line for avy-goto-line
* avy.el (avy-command): New defvar.
(avy-with): Actions can now access the symbol from `avy-with' using
`avy-command'.
(avy-action-copy): Copy line for `avy-goto-line'. Copy sexp for all
other commands.
Fixes #191
---
avy.el | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/avy.el b/avy.el
index 00720fa..af4fe80 100644
--- a/avy.el
+++ b/avy.el
@@ -489,6 +489,10 @@ multiple DISPLAY-FN invokations."
Commands using `avy-with' macro can be resumed."
(interactive))
+(defvar avy-command nil
+ "Store the current command symbol.
+E.g. 'avy-goto-line or 'avy-goto-char.")
+
(defmacro avy-with (command &rest body)
"Set `avy-keys' according to COMMAND and execute BODY.
Set `avy-style' according to COMMMAND as well."
@@ -497,7 +501,8 @@ Set `avy-style' according to COMMMAND as well."
`(let ((avy-keys (or (cdr (assq ',command avy-keys-alist))
avy-keys))
(avy-style (or (cdr (assq ',command avy-styles-alist))
- avy-style)))
+ avy-style))
+ (avy-command ',command))
(setq avy-action nil)
(setf (symbol-function 'avy-resume)
(lambda ()
@@ -523,7 +528,9 @@ Set `avy-style' according to COMMMAND as well."
(save-excursion
(let (str)
(goto-char pt)
- (forward-sexp)
+ (if (eq avy-command 'avy-goto-line)
+ (end-of-line)
+ (forward-sexp))
(setq str (buffer-substring pt (point)))
(kill-new str)
(message "Copied: %s" str)))
- [elpa] master 5515f28 021/110: Allow using symbols instead of words in word cmds, (continued)
- [elpa] master 5515f28 021/110: Allow using symbols instead of words in word cmds, Oleh Krehel, 2019/05/11
- [elpa] master a911903 029/110: avy.el (avy-goto-word-1): Work for "^A"-"^Z", Oleh Krehel, 2019/05/11
- [elpa] master a5fb936 028/110: avy.el (avy-resume): Make it show up in M-x, Oleh Krehel, 2019/05/11
- [elpa] master 20ecb9b 024/110: Use flyspell if its minor mode is active, Oleh Krehel, 2019/05/11
- [elpa] master b522bfe 023/110: avy.el (avy-resume): Add, Oleh Krehel, 2019/05/11
- [elpa] master e460d7e 025/110: avy.el (flyspell-correct-word-before-point): Declare, Oleh Krehel, 2019/05/11
- [elpa] master 05a5003 022/110: avy.el: Fix linum-related compile warnings, Oleh Krehel, 2019/05/11
- [elpa] master 430d750 019/110: avy.el (avy--line-cands): Split away from avy--line, Oleh Krehel, 2019/05/11
- [elpa] master 0f5e99b 030/110: avy.el: Use next-char-property-change, not next-overlay-change, Oleh Krehel, 2019/05/11
- [elpa] master 33af738 017/110: avy.el (avy-goto-word-1-above): Add, Oleh Krehel, 2019/05/11
- [elpa] master 105efc8 037/110: avy.el (avy-action-copy): Copy line for avy-goto-line,
Oleh Krehel <=
- [elpa] master 4e4c488 020/110: Add avy-linum-mode, Oleh Krehel, 2019/05/11
- [elpa] master d644be1 016/110: avy.el (avy-goto-char-2-above): Simplify, Oleh Krehel, 2019/05/11
- [elpa] master 4dcf0a9 018/110: avy.el (avy-goto-char-2): Translate "RET" to "C-j", Oleh Krehel, 2019/05/11
- [elpa] master ba950a0 015/110: avy.el (avy-goto-char-2-above): Add, Oleh Krehel, 2019/05/11
- [elpa] master 58bc417 014/110: Escape regex metacharacters for standard isearch, Oleh Krehel, 2019/05/11
- [elpa] master 2e3c2f7 013/110: Add new command `avy-move-region', Oleh Krehel, 2019/05/11
- [elpa] master 85a384a 012/110: Add char at window start for avy-goto-subword-0, Oleh Krehel, 2019/05/11
- [elpa] master a80f95c 007/110: Add "X" dispatch to kill a word without moving there, Oleh Krehel, 2019/05/11
- [elpa] master 9e61f78 006/110: avy.el: Improve defcustom :type, Oleh Krehel, 2019/05/11
- [elpa] master 5ba3602 009/110: Assign avy-action-ispell to "i", Oleh Krehel, 2019/05/11