[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master bca96ae 02/20: Add avy-goto-char-timer
From: |
Oleh Krehel |
Subject: |
[elpa] master bca96ae 02/20: Add avy-goto-char-timer |
Date: |
Sat, 09 May 2015 11:57:48 +0000 |
branch: master
commit bca96ae3b4d7124875374055c5d11fd722b338ca
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
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
---
avy-jump.el | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/avy-jump.el b/avy-jump.el
index b0a1ba8..444b27a 100644
--- a/avy-jump.el
+++ b/avy-jump.el
@@ -442,6 +442,24 @@ ARG lines can be used."
(eval-after-load '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-background 'avy-background "0.1.0")
(define-obsolete-variable-alias 'avi-word-punc-regexp 'avy-word-punc-regexp
"0.1.0")
- [elpa] master updated (e3dbd7a -> e1f9513), Oleh Krehel, 2015/05/09
- [elpa] master e49f6d0 01/20: avy-jump.el (avy--regex-candidates): Update arglist, Oleh Krehel, 2015/05/09
- [elpa] master bca96ae 02/20: Add avy-goto-char-timer,
Oleh Krehel <=
- [elpa] master b114cf8 03/20: ace-window.el (aw-ignore-current): New defcustom, Oleh Krehel, 2015/05/09
- [elpa] master e931071 04/20: When selecting from many windows, prioritize the current, Oleh Krehel, 2015/05/09
- [elpa] master 6acbeb6 05/20: Use `avy-keys' for `avy-goto-subword-1', Oleh Krehel, 2015/05/09
- [elpa] master 35e1309 06/20: Add customization type to `avy-keys', Oleh Krehel, 2015/05/09
- [elpa] master c32b91f 07/20: Add more customization types, Oleh Krehel, 2015/05/09
- [elpa] master 6ff26f5 08/20: Use cl-lib instead of cl-macs, Oleh Krehel, 2015/05/09
- [elpa] master cc822c1 12/20: Fix eval-after-load isearch, Oleh Krehel, 2015/05/09
- [elpa] master a558585 09/20: Move the package metadata to avy.el, Oleh Krehel, 2015/05/09
- [elpa] master 0634762 11/20: Add a dependency to cl-lib for Emacs < 24.3, Oleh Krehel, 2015/05/09
- [elpa] master 0e049bb 10/20: Always default to avy-keys but allow for per-command overrides, Oleh Krehel, 2015/05/09