mirror of
https://github.com/abo-abo/avy.git
synced 2025-10-13 13:33:03 +00:00
Add avy-goto-char-timer
avy-jump.el (avy-goto-char-timer): New command. Generalize `avy-goto-char' and `avy-goto-char-2' with a timer. * avy-jump.el (avy-timeout-seconds): New defcustom. Fixes #13
This commit is contained in:
parent
e49f6d02eb
commit
bca96ae3b4
18
avy-jump.el
18
avy-jump.el
@ -442,6 +442,24 @@ ARG lines can be used."
|
|||||||
(eval-after-load 'isearch
|
(eval-after-load 'isearch
|
||||||
'(define-key isearch-mode-map (kbd "C-'") 'avy-isearch)))
|
'(define-key isearch-mode-map (kbd "C-'") 'avy-isearch)))
|
||||||
|
|
||||||
|
(defcustom avy-timeout-seconds 0.5
|
||||||
|
"How many seconds to wait for the second char.")
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun avy-goto-char-timer (&optional arg)
|
||||||
|
"Read one or two consecutive chars and jump to the first one.
|
||||||
|
The window scope is determined by `avy-all-windows' (ARG negates it)."
|
||||||
|
(interactive "P")
|
||||||
|
(let ((c1 (read-char "char 1: "))
|
||||||
|
(c2 (read-char "char 2: " nil avy-timeout-seconds)))
|
||||||
|
(avy--generic-jump
|
||||||
|
(regexp-quote
|
||||||
|
(if c2
|
||||||
|
(string c1 c2)
|
||||||
|
(string c1)))
|
||||||
|
arg
|
||||||
|
avy-goto-char-style)))
|
||||||
|
|
||||||
(define-obsolete-variable-alias 'avi-keys 'avy-keys "0.1.0")
|
(define-obsolete-variable-alias 'avi-keys 'avy-keys "0.1.0")
|
||||||
(define-obsolete-variable-alias 'avi-background 'avy-background "0.1.0")
|
(define-obsolete-variable-alias 'avi-background 'avy-background "0.1.0")
|
||||||
(define-obsolete-variable-alias 'avi-word-punc-regexp 'avy-word-punc-regexp "0.1.0")
|
(define-obsolete-variable-alias 'avi-word-punc-regexp 'avy-word-punc-regexp "0.1.0")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user