From 36a48baa2c25a71ed1f305f82f871ee9b48883a5 Mon Sep 17 00:00:00 2001 From: Oleh Krehel Date: Tue, 19 May 2020 08:59:08 +0200 Subject: [PATCH] avy.el (avy-goto-char-2): Allow backspace Fixes #249 --- avy.el | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/avy.el b/avy.el index 49a76d0..2af14f5 100644 --- a/avy.el +++ b/avy.el @@ -1308,8 +1308,18 @@ The window scope is determined by `avy-all-windows' (ARG negates it)." The window scope is determined by `avy-all-windows'. When ARG is non-nil, do the opposite of `avy-all-windows'. BEG and END narrow the scope where candidates are searched." - (interactive (list (read-char "char 1: " t) - (read-char "char 2: " t) + (interactive (list (let ((c1 (read-char "char 1: " t))) + (if (memq c1 '(? ?\b)) + (keyboard-quit) + c1)) + (let ((c2 (read-char "char 2: " t))) + (cond ((eq c2 ?) + (keyboard-quit)) + ((memq c2 avy-del-last-char-by) + (keyboard-escape-quit) + (call-interactively 'avy-goto-char-2)) + (t + c2))) current-prefix-arg nil nil)) (when (eq char1 ? )