From e1193819370d6efdd2840325b40386963d4c69bb Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sun, 9 Aug 2015 23:38:11 -0400 Subject: Revert "Remove km/avy-goto-subword-1" This reverts commit 808e4c576e1b751570ea8436bc89b697ea2fa35a. I was mistaken about being mistaken. Calling avy-goto-subword-1 in Org with folded headings assigns candidates to hidden text. --- lisp/init-ace.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lisp/init-ace.el') diff --git a/lisp/init-ace.el b/lisp/init-ace.el index 3417013..cc6eee3 100644 --- a/lisp/init-ace.el +++ b/lisp/init-ace.el @@ -2,7 +2,16 @@ (require 'avy) -(key-chord-define-global "jf" 'avy-goto-subword-1) +(defun km/avy-goto-subword-1 (char arg) + "Like `avy-goto-subword-1', but don't consider invisible text." + (interactive (list (read-char "char: ") current-prefix-arg)) + (avy--with-avy-keys avy-goto-subword-1 + (let ((char (downcase char))) + (avy-goto-subword-0 + arg (lambda () (and (not (invisible-p (point))) + (eq (downcase (char-after)) char))))))) + +(key-chord-define-global "jf" 'km/avy-goto-subword-1) ;;; Ace Link -- cgit v1.2.3