summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-05-29 22:33:26 -0400
committerKyle Meyer <kyle@kyleam.com>2015-05-29 22:33:26 -0400
commitf88d106fc37ca6a3057789c236d70eb49ec58528 (patch)
treeb90f680bc2437724581c81a9acfe08ffb3f90903
parent8fccff249687308542d490ed00d1e0a68a44b9f2 (diff)
downloademacs.d-f88d106fc37ca6a3057789c236d70eb49ec58528.tar.gz
Make avy-goto-subword-1 ignore invisible text
-rw-r--r--lisp/init-ace.el13
1 files changed, 12 insertions, 1 deletions
diff --git a/lisp/init-ace.el b/lisp/init-ace.el
index e971121..d033e52 100644
--- a/lisp/init-ace.el
+++ b/lisp/init-ace.el
@@ -1,6 +1,17 @@
;;; Avy
-(key-chord-define-global "jf" 'avy-goto-subword-1)
+(require 'avy)
+
+(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