Oleh Krehel [Sat, 9 May 2015 16:14:50 +0000 (18:14 +0200)]
Allow to break from `avy-goto-line' into `goto-line'
* avy.el (avy-handler-default): New defun.
(avy-handler-function): New variable. Bind this temporarily to catch bad chars.
(avy-read): Forward to `avy-handler-default'.
* avy-jump.el (avy--goto): Consider the case of 'exit symbol being
returned.
(avy-goto-line): Bind `avy-handler-function' to catch digits and call
`goto-line' in that case.
Oleh Krehel [Sat, 9 May 2015 11:38:05 +0000 (13:38 +0200)]
Update and document the style customization
* avy-jump.el (avy-style): New defcustom. Replaces `avy-goto-char-style'
and `avy-goto-word-style'.
(avy-styles-alist): New defcustom. Allows to customize the style for
each command separately.
(avy--with-avy-keys): Update.
(avy-goto-char-style): Obsolete.
(avy-goto-word-style): Obsolete.
Tassilo Horn [Fri, 8 May 2015 20:56:33 +0000 (22:56 +0200)]
Always default to avy-keys but allow for per-command overrides
Using the new `avy-keys-alist` one can override the default `avy-keys`
on a per-command basis. That's much better than hard-coding ?a-?z for
some commands and using the defaults for some others.
Tassilo Horn [Thu, 7 May 2015 12:37:31 +0000 (14:37 +0200)]
Special-case char RET to allow for jumping to end-of-lines.
With this change you can use `avy-goto-char' also to jump to the end of
some currently visible line. E.g., C-c j <return> (assuming C-c j is
bound to `avy-goto-char') makes all line endings jump targets.
`avy--overlay-at' had to be adapted so that the overlay at \n doesn't
make the line-break disappear.
`avy--overlay' had to be adapted in order not to put an overlay on the
char after (point-max) in case `avy--overlay-post' is used. (Honestly,
this feature is a bit awkward with 'post overlays where the jump
location is visualized as first char in the next line.)
Oleh Krehel [Thu, 7 May 2015 11:28:27 +0000 (13:28 +0200)]
Abstract windows and rely on subword
* avy-jump.el (avy-dowindows): New macro.
(avy--regex-candidates): Use `avy-dowindows'.
(avy-goto-subword-0): Rely on `subword-backward'.
(avy--line): Use `avy-dowindows'.
Tassilo Horn [Thu, 7 May 2015 08:22:42 +0000 (10:22 +0200)]
Regexp-quote strings of avy-goto-char* functions.
Before this commit, avy-goto-char with char ^ would inf-loop because the
resulting string "^" is treated as a regular expressions. However, with
the avy-goto-char* function, the char should be treated literally. For
example, in Clojure ^:foo is treated as metadata annotation and thus ^
is a likely jump target.