]> code.delx.au - gnu-emacs-elpa/commitdiff
avy-jump.el (avy-goto-word-or-subword-1): New command
authorOleh Krehel <ohwoeowho@gmail.com>
Mon, 11 May 2015 08:26:09 +0000 (10:26 +0200)
committerOleh Krehel <ohwoeowho@gmail.com>
Mon, 11 May 2015 08:26:09 +0000 (10:26 +0200)
Fixes #33

avy-jump.el

index 1da11c6f40e9bc404423ef29c6720f9a352d7693..b32d22cb0c8de5d30914e2618a80051efdf06402 100644 (file)
@@ -466,6 +466,15 @@ The case is ignored."
       (avy-goto-subword-0
        arg (lambda () (eq (downcase (char-after)) char))))))
 
+(defun avy-goto-word-or-subword-1 (&optional arg)
+  "Jump to a word or subword start, depending on `subword-mode'.
+The window scope is determined by `avy-all-windows' (ARG negates it).
+The case is ignored."
+  (interactive "P")
+  (if (bound-and-true-p subword-mode)
+      (avy-goto-subword-1 arg)
+    (avy-goto-word-1 arg)))
+
 (defun avy--line (&optional arg)
   "Select a line.
 The window scope is determined by `avy-all-windows' (ARG negates it)."