[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master c2e2a4a 083/110: avy.el (avy--read-candidates): Custom key
From: |
Oleh Krehel |
Subject: |
[elpa] master c2e2a4a 083/110: avy.el (avy--read-candidates): Custom keys for deleting last read char |
Date: |
Sat, 11 May 2019 10:15:49 -0400 (EDT) |
branch: master
commit c2e2a4a3f2064b1efc9794447a7f4a64b52b4a0d
Author: Jiangbin Zhao <address@hidden>
Commit: Oleh Krehel <address@hidden>
avy.el (avy--read-candidates): Custom keys for deleting last read char
Add a defcustom for list of events that delete last read char, with
the default being '(8 127) which represents C-h and DEL.
Fixes #251
---
avy.el | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/avy.el b/avy.el
index 50f0214..fc21ac0 100644
--- a/avy.el
+++ b/avy.el
@@ -248,6 +248,12 @@ Typically, these modes don't use the text representation."
"In case there is only one candidate jumps directly to it."
:type 'boolean)
+(defcustom avy-del-last-char-by '(8 127)
+ "List of event types, i.e. key presses, that delete the last
+character read. The default represents `C-h' and `DEL'. See
+`event-convert-list'."
+ :type 'list)
+
(defvar avy-ring (make-ring 20)
"Hold the window and point history.")
@@ -1882,8 +1888,9 @@ newline."
(defun avy--read-candidates (&optional re-builder)
"Read as many chars as possible and return their occurrences.
At least one char must be read, and then repeatedly one next char
-may be read if it is entered before `avy-timeout-seconds'. `C-h'
-or `DEL' deletes the last char entered, and `RET' exits with the
+may be read if it is entered before `avy-timeout-seconds'. Any
+key defined in `avy-del-last-char-by' (by default `C-h' and `DEL')
+deletes the last char entered, and `RET' exits with the
currently read string immediately instead of waiting for another
char for `avy-timeout-seconds'.
The format of the result is the same as that of `avy--regex-candidates'.
@@ -1917,7 +1924,7 @@ Otherwise, the whole regex is highlighted."
(setq break t)
(setq str (concat str (list ?\n)))))
;; Handle C-h, DEL
- ((memq char '(8 127))
+ ((memq char avy-del-last-char-by)
(let ((l (length str)))
(when (>= l 1)
(setq str (substring str 0 (1- l))))))
- [elpa] master fd0101e 101/110: avy.el (avy-push-mark): Turn off message, (continued)
- [elpa] master fd0101e 101/110: avy.el (avy-push-mark): Turn off message, Oleh Krehel, 2019/05/11
- [elpa] master e802510 098/110: avy.el (avy-jump): New API, don't use avy--generic-jump, Oleh Krehel, 2019/05/11
- [elpa] master 7cfe11e 074/110: Added ability to display avy candidates from bottom to top, Oleh Krehel, 2019/05/11
- [elpa] master 8606a89 072/110: avy.el (avy--process): Remove redundant copy-sequence, Oleh Krehel, 2019/05/11
- [elpa] master 002b8f3 091/110: avy.el (avy--visible-p): Add to fix org-toggle-link-display, Oleh Krehel, 2019/05/11
- [elpa] master 16482e0 089/110: avy.el (avy--generic-jump): Remove `style' arg, Oleh Krehel, 2019/05/11
- [elpa] master 909483e 090/110: avy.el (avy--process): Make `overlay-fn' arg optional, Oleh Krehel, 2019/05/11
- [elpa] master 24b5137 087/110: Ignore mistyping when no candidates available, Oleh Krehel, 2019/05/11
- [elpa] master c4e2d50 077/110: avy.el: avy-goto-char will now display shortest overlays for cands near point, Oleh Krehel, 2019/05/11
- [elpa] master 1de6233 076/110: Add avy-goto-end-of-line, Oleh Krehel, 2019/05/11
- [elpa] master c2e2a4a 083/110: avy.el (avy--read-candidates): Custom keys for deleting last read char,
Oleh Krehel <=
- [elpa] master 4f1b8a1 086/110: avy.el: Fix compiler warnings, Oleh Krehel, 2019/05/11
- [elpa] master e7c0fc0 088/110: avy.el (avy-pre-action): New defvar, Oleh Krehel, 2019/05/11
- [elpa] master bcc0cb0 085/110: avy.el (avy-org-refile-as-child): Don't refile when avy aborted, Oleh Krehel, 2019/05/11
- [elpa] master 6331b7a 071/110: avy.el (avy--process): Fix avy-goto-line for empty buffer, Oleh Krehel, 2019/05/11
- [elpa] master fd7b929 078/110: Add option to display an indented goto line overlay, Oleh Krehel, 2019/05/11
- [elpa] master 70e384a 073/110: avy.el (avy--process-1): Extract, Oleh Krehel, 2019/05/11
- [elpa] master cd8fb10 081/110: avy.el (avy--read-candidates): Quit on ESC, Oleh Krehel, 2019/05/11
- [elpa] master df4c4ac 084/110: Show number of matches so far in prompt, Oleh Krehel, 2019/05/11
- [elpa] master 93d4bd2 066/110: avy.el: Fix indentation, Oleh Krehel, 2019/05/11
- [elpa] master 157486a 079/110: avy.el: Fix compiler warning, Oleh Krehel, 2019/05/11