* avy.el (avy--overlay-at-full): Account for `overlays-in' not being
returned in the buffer order sometimes: it seems to be random order.
Instead, look at the minimum of all overlay starts that are on the
current line.
Oleh Krehel [Wed, 3 Jun 2015 16:19:00 +0000 (18:19 +0200)]
Modify `at-full' and `de-bruijn' overlays to color depth
* avy.el (avy-lead-face-2): New face.
(avy-lead-faces): New defconst. Each element will be used to color the
corresponding depth.
(avy--overlay-at-full): Use `avy-lead-faces' to represent the current
decision depth. For `de-bruijn', prepend the old stuff, so that nothing
moves.
Instead of building a tree (from a flat sequence) and traversing it,
just use the flat sequence. This has the advantage of candidates being
in proper buffer-sequential order.
Tassilo Horn [Tue, 26 May 2015 11:17:37 +0000 (13:17 +0200)]
Add 'de-bruijn option for avy-style
* avy.el (avy-style): New choice option.
(avy--de-bruijn): New defun.
(avy--path-alist-1): New defun.
(avy--group-by): New defun.
(avy--path-alist-to-tree): New defun.
(avy-tree-de-bruijn): New defun, semi-compatible with `avy-tree'.
(avy--process): Use `avy-tree-de-bruijn' when `avy-style' is 'de-bruijn.
(avy--style-fn): Use `avy--overlay-at-full' when `avy-style' is
'de-bruijn.
Fixes #51
Re #5
TODO: When tree produced by `avy-tree-de-bruijn' is traversed
depth-first, the results should be in-order of their appearance in the
window. Only in this case the overlay functions will work correctly,
since they need to be applied sequentially from window end to window
start.
Oleh Krehel [Mon, 18 May 2015 18:38:20 +0000 (20:38 +0200)]
avy.el (avy--overlay-at-full): Work-around 20607
* avy.el (avy--overlay-at-full): There's a problem when there are two
overlays at the same point in the same buffer, but in different
windows, *only if* they are of different length. Make them the same
length to work-around this bug.
See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20607
Oleh Krehel [Mon, 18 May 2015 06:57:12 +0000 (08:57 +0200)]
Allow for all operations to work across frames
* avy.el (avy-all-windows): Change the custom type to choice: this
window/this frame/all frames.
(avy-window-list): New defun.
(avy-dowindows): Use `avy-window-list'.
(avy--process): Use `avy-window-list'.
Oleh Krehel [Sat, 16 May 2015 17:31:26 +0000 (19:31 +0200)]
Customize how `avy-lead-face-0' is applied
* avy.el (avy-highlight-first): New defcustom. When non-nil, use
`avy-lead-face-0' even on terminal chars.
(avy--overlay-pre): Update.
(avy--overlay-at-full): Update.
(avy--overlay-post): Update.
Oleh Krehel [Tue, 12 May 2015 10:36:18 +0000 (12:36 +0200)]
Add `avy-lead-face-1' for dimmed matched chars
* avy.el (avy-lead-face-0): Update doc.
(avy-lead-face-1): New face.
(avy-current-path): New defvar.
(avy-read): Store the current matched chars in `avy-current-path'.
(avy--overlay-pre):
(avy--overlay-post): Extend the string with the matched part. This
prevents shifting during selection, and looks nice too.
Oleh Krehel [Mon, 11 May 2015 19:26:23 +0000 (21:26 +0200)]
Stop 'at-full from shifting text
* avy.el (avy-read): Call DISPLAY-FN in buffer's reverse order.
(avy--overlay-at-full): When there's an avy overlay after point, shorten
the current overlay to one letter.
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.