avy.el (avy-escape-chars): Add defcustom

Re #249
This commit is contained in:
Oleh Krehel 2020-05-19 12:07:44 +02:00
parent 36a48baa2c
commit f34ff764aa

8
avy.el
View File

@ -1,6 +1,6 @@
;;; avy.el --- Jump to arbitrary positions in visible text and select text quickly. -*- lexical-binding: t -*- ;;; avy.el --- Jump to arbitrary positions in visible text and select text quickly. -*- lexical-binding: t -*-
;; Copyright (C) 2015-2019 Free Software Foundation, Inc. ;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
;; Author: Oleh Krehel <ohwoeowho@gmail.com> ;; Author: Oleh Krehel <ohwoeowho@gmail.com>
;; URL: https://github.com/abo-abo/avy ;; URL: https://github.com/abo-abo/avy
@ -255,6 +255,10 @@ character read. The default represents `C-h' and `DEL'. See
`event-convert-list'." `event-convert-list'."
:type 'list) :type 'list)
(defcustom avy-escape-chars '(?\e ?\C-g)
"List of characters that quit avy during `read-char'."
:type 'list)
(defvar avy-ring (make-ring 20) (defvar avy-ring (make-ring 20)
"Hold the window and point history.") "Hold the window and point history.")
@ -455,7 +459,7 @@ KEYS is the path from the root of `avy-tree' to LEAF."
(unless (eq avy-style 'words) (unless (eq avy-style 'words)
(setq avy-action (cdr dispatch))) (setq avy-action (cdr dispatch)))
(throw 'done 'restart)) (throw 'done 'restart))
((memq char '(?\e ?\C-g)) ((memq char avy-escape-chars)
;; exit silently ;; exit silently
(throw 'done 'abort)) (throw 'done 'abort))
((eq char ??) ((eq char ??)