[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 3b9a60a 09/78: avy.el (avy-dispatch-alist): Upgrade to def
From: |
Oleh Krehel |
Subject: |
[elpa] master 3b9a60a 09/78: avy.el (avy-dispatch-alist): Upgrade to defcustom |
Date: |
Sat, 23 Jan 2016 13:59:39 +0000 |
branch: master
commit 3b9a60a334e1201eb0d088fecdced14659e3f420
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
avy.el (avy-dispatch-alist): Upgrade to defcustom
* avy.el (avy-handler-default): `avy-dispatch-alist' is actually an
alist now.
---
avy.el | 29 ++++++++++++++++++-----------
1 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/avy.el b/avy.el
index 24234c0..b65ce16 100644
--- a/avy.el
+++ b/avy.el
@@ -115,6 +115,23 @@ If the commands isn't on the list, `avy-style' is used."
(const :tag "Post" post)
(const :tag "De Bruijn" de-bruijn))))
+(defcustom avy-dispatch-alist
+ '((?x . avy-action-kill)
+ (?m . avy-action-mark)
+ (?n . avy-action-copy))
+ "List of actions for `avy-handler-default'.
+
+Each item is (KEY . ACTION). When KEY not on `avy-keys' is
+pressed during the dispatch, ACTION is set to replace the default
+`avy-action-goto' once a candidate is finally selected."
+ :type
+ '(alist
+ :key-type (choice (character :tag "Char"))
+ :value-type (choice
+ (const :tag "Mark" avy-action-mark)
+ (const :tag "Copy" avy-action-copy)
+ (const :tag "Kill" avy-action-kill))))
+
(defcustom avy-background nil
"When non-nil, a gray background will be added during the selection."
:type 'boolean)
@@ -316,22 +333,12 @@ KEYS is the path from the root of `avy-tree' to LEAF."
(defvar avy-action nil
"Function to call at the end of select.")
-(defvar avy-dispatch-alist
- '((?x avy-action-kill)
- (?m avy-action-mark)
- (?n avy-action-copy))
- "List of actions for `avy-handler-default'.
-
-Each item is (KEY ACTION). When KEY that is not on `avy-keys' is
-pressed during the dispatch, ACTION is set to replace the default
-`avy-action-goto' once a candidate is finally selected.")
-
(defun avy-handler-default (char)
"The default handler for a bad CHAR."
(let (dispatch)
(if (setq dispatch (assoc char avy-dispatch-alist))
(progn
- (setq avy-action (cadr dispatch))
+ (setq avy-action (cdr dispatch))
(throw 'done 'restart))
(signal 'user-error (list "No such candidate" char))
(throw 'done nil))))
- [elpa] master updated (4300eae -> a6b7502), Oleh Krehel, 2016/01/23
- [elpa] master 8c8ad97 01/78: Add de-bruijn to the defcustom of avy-styles-alist, Oleh Krehel, 2016/01/23
- [elpa] master eb28aeb 02/78: avy.el (avy-goto-line): push mark for numeric line, Oleh Krehel, 2016/01/23
- [elpa] master 7928d11 05/78: Remove the old obsolete aliases, Oleh Krehel, 2016/01/23
- [elpa] master 0cac589 04/78: Allow non-printing keys in avy-keys, Oleh Krehel, 2016/01/23
- [elpa] master 36e4d14 03/78: Respect the current input method for target chars, Oleh Krehel, 2016/01/23
- [elpa] master 465d5f2 07/78: Improve docstrings, Oleh Krehel, 2016/01/23
- [elpa] master 26123a7 10/78: avy.el (avy-goto-line): Fixup goto-line clause, Oleh Krehel, 2016/01/23
- [elpa] master 492ac49 11/78: avy.el (avy-pop-mark): Add, Oleh Krehel, 2016/01/23
- [elpa] master 3b9a60a 09/78: avy.el (avy-dispatch-alist): Upgrade to defcustom,
Oleh Krehel <=
- [elpa] master d22493c 12/78: Autload avy-goto-word-or-subword-1, Oleh Krehel, 2016/01/23
- [elpa] master 1d1e4b6 06/78: Allow to switch action midway from goto to kill/mark/copy, Oleh Krehel, 2016/01/23
- [elpa] master 30067dd 14/78: avy.el (avy-action-goto): Don't push mark when region is active, Oleh Krehel, 2016/01/23
- [elpa] master a6db8a3 08/78: Rename avy--with-avy-keys to avy-with, Oleh Krehel, 2016/01/23
- [elpa] master 1e578a1 15/78: Considers letter case only if given Upcase letter, Oleh Krehel, 2016/01/23
- [elpa] master e8cebf1 13/78: Make arg optional in avy-goto-subword-1, Oleh Krehel, 2016/01/23
- [elpa] master 36b296c 20/78: avy.el (subword-backward-regexp): Fix declaration, Oleh Krehel, 2016/01/23
- [elpa] master dbd2d20 17/78: avy.el (avy-pop-mark): Handle multiple frames, Oleh Krehel, 2016/01/23
- [elpa] master a86bdee6 16/78: avy.el (avy-pop-mark): use own history for points and windows, Oleh Krehel, 2016/01/23
- [elpa] master ed120ea 19/78: avy.el (avy-goto-line): Allow numeric prefix arg, Oleh Krehel, 2016/01/23