diff options
author | Kyle Meyer <kyle@kyleam.com> | 2015-08-09 23:38:11 -0400 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2015-08-09 23:38:11 -0400 |
commit | e1193819370d6efdd2840325b40386963d4c69bb (patch) | |
tree | 2816df5ef8ab3113a09cf65fc9ab018c571b90e9 | |
parent | 20863271fd69f2e06628d16ceba8d13a5c01cb06 (diff) | |
download | emacs.d-e1193819370d6efdd2840325b40386963d4c69bb.tar.gz |
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.
-rw-r--r-- | lisp/init-ace.el | 11 | ||||
-rw-r--r-- | lisp/init-mail.el | 2 | ||||
-rw-r--r-- | lisp/init-org.el | 2 | ||||
-rw-r--r-- | lisp/init-view.el | 2 |
4 files changed, 13 insertions, 4 deletions
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 diff --git a/lisp/init-mail.el b/lisp/init-mail.el index 3413052..1b4331d 100644 --- a/lisp/init-mail.el +++ b/lisp/init-mail.el @@ -96,7 +96,7 @@ is off." (defun km/gnus-avy-goto-subword-and-select () (interactive) - (call-interactively #'avy-goto-subword-1) + (call-interactively #'km/avy-goto-subword-1) (gnus-summary-scroll-up 0)) (defun km/gnus-follow-last-message-link (copy) diff --git a/lisp/init-org.el b/lisp/init-org.el index 4793a2f..a7ffd81 100644 --- a/lisp/init-org.el +++ b/lisp/init-org.el @@ -483,7 +483,7 @@ displayed in the agenda." (defun km/org-agenda-avy-goto-subword-1 () (interactive) - (call-interactively #'avy-goto-subword-1) + (call-interactively #'km/avy-goto-subword-1) (org-agenda-do-context-action)) (define-key km/global-org-map "a" 'org-agenda) diff --git a/lisp/init-view.el b/lisp/init-view.el index 9a4536c..e80160f 100644 --- a/lisp/init-view.el +++ b/lisp/init-view.el @@ -6,7 +6,7 @@ (define-key view-mode-map "b" 'backward-word) (define-key view-mode-map "]" 'forward-paragraph) (define-key view-mode-map "[" 'backward-paragraph) - (define-key view-mode-map "j" 'avy-goto-subword-1)) + (define-key view-mode-map "j" 'km/avy-goto-subword-1)) (key-chord-define-global "hq" 'view-mode) |