153 Commits

Author SHA1 Message Date
Markus Hauck
d22493c0ec Autload avy-goto-word-or-subword-1
Fixes #82
2015-07-21 09:31:53 +02:00
Oleh Krehel
492ac494e9 avy.el (avy-pop-mark): Add
Fixes #81
2015-07-21 09:28:29 +02:00
Oleh Krehel
26123a7b37 avy.el (avy-goto-line): Fixup goto-line clause
Fixes #79
2015-07-16 22:03:25 +02:00
Oleh Krehel
3b9a60a334 avy.el (avy-dispatch-alist): Upgrade to defcustom
* avy.el (avy-handler-default): `avy-dispatch-alist' is actually an
  alist now.
2015-07-16 16:07:28 +02:00
Oleh Krehel
a6db8a3506 Rename avy--with-avy-keys to avy-with
* avy.el (avy-with): Macro renamed from `avy--with-avy-keys'.
(avy--with-avy-keys): Add obsolete alias.
2015-07-16 16:06:21 +02:00
Oleh Krehel
465d5f2f9c Improve docstrings
* avy.el (avy-keys): Update.
(avy-background-face): Update.
2015-07-16 16:05:33 +02:00
Oleh Krehel
1d1e4b62e8 Allow to switch action midway from goto to kill/mark/copy
* avy.el (avy-action): New defvar.
(avy-dispatch-alist): New defvar.
Customize this to add new dispatch functionality.
(avy-handler-default): Use `avy-dispatch-alist'.
(avy--with-avy-keys): Set `avy-action' to nil, which means
`avy-action-goto' will be called by default.
(avy--goto): Remove defun. Redirect it as an obsolete alias to identity.
(avy-action-goto): New defun.
(avy-action-mark): New defun.
(avy-action-copy): New defun.
(avy-action-kill): New defun.
(avy--process): Call `avy-action'. This function alone now does
what (avy--goto (avy--process ...)) used to do.
(avy--generic-jump): Remove `avy--goto'.
(avy-goto-char-in-line): Remove `avy--goto'.
(avy-isearch): Remove `avy--goto'.
(avy--line): Set `avy-action' to identity so that `avy--process' doesn't
move point.
(avy-goto-line): Replace `avy--goto' with `avy-action-goto'.
(avy-copy-line): `avy--line' now returns a point, not a cons.
(avy-move-line): `avy--line' now returns a point, not a cons.
(avy-copy-region): `avy--line' now returns a point, not a cons.

**Example of use.**

Suppose you have:
(global-set-key (kbd "M-g w") 'avy-goto-word-1)

To jump to a certain word (e.g. first one on screen): "M-g wa".
To copy the word instead of jumping to it:            "M-g wna".
To mark the word after jumping to it:                 "M-g wma".
To kill the word after jumping to it:                 "M-g wxa".

Re #78
2015-07-16 15:13:31 +02:00
Oleh Krehel
7928d11ef3 Remove the old obsolete aliases 2015-07-16 14:25:06 +02:00
Tassilo Horn
0cac5890f1 Allow non-printing keys in avy-keys
Now you can set avy-keys also to the arrow keys and page up/down, e.g.,

  (setq avy-keys '(left right up down prior next))

and those will be displayed as ▲, ▼, ◀, ▶, △, ▽ in the overlays.  The
display is controlled by the variable `avy-key-to-char-alist'.
2015-07-14 08:31:49 +02:00
Oleh Krehel
36e4d145c8 Respect the current input method for target chars
* avy.el (avy-goto-char):
(avy-goto-char-in-line):
(avy-goto-char-2):
(avy-goto-word-1):
(avy-goto-subword-1):
(avy-goto-char-timer): Update.

Fixes #76
2015-07-07 17:11:47 +02:00
Oleh Krehel
eb28aeb40e avy.el (avy-goto-line): push mark for numeric line
Fixes #74
2015-07-01 14:32:04 +02:00
Junpeng Qiu
8c8ad97de1 Add de-bruijn to the defcustom of avy-styles-alist 2015-06-25 15:54:32 -04:00
Oleh Krehel
8d38a898f2 avy.el (avy-goto-char-timer): Obey avy-styles-alist
Fixes #67
2015-06-21 17:04:59 +02:00
Oleh Krehel
44d76b9d2a Bump version to 0.3.0
* doc/Changelog.org: Start tracking the changes in each new version.
0.3.0
2015-06-19 17:59:25 +02:00
Nelson Loyola
a7c92d884f Updated screenshot image for ivy-goto-char.
Fixes #65
Fixes #64
2015-06-17 19:44:30 +02:00
Oleh Krehel
e5104ca416 avy.el (avy-goto-word-1): Quote punctuation
Fixes #63
2015-06-15 19:48:08 +02:00
Oleh Krehel
7b0ba80620 avy.el (avy-style): Switch the default from 'pre to 'at-full 2015-06-15 16:25:49 +02:00
Oleh Krehel
7376a0c611 avy.el (avy--overlay-at-full): Fixup (for overlays-in)
* 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.

Fixes #52.
2015-06-15 16:17:58 +02:00
Oleh Krehel
15c7f9fe39 targets/avy-init.el: Use the new checkdoc-file
* targets/avy-init.el (checkdoc-file): This function is now available in
  trunk Emacs.
2015-06-08 13:07:52 +02:00
Oleh Krehel
054390f5f6 avy.el (avy-translate-char-function): Fixup doc 2015-06-08 13:04:31 +02:00
Tim Perkins
236293a401 avy.el (avy-isearch): Allow different styles
Fixes #61
2015-06-06 16:41:57 -04:00
York Zhao
035d663ab4 Add `avy-translate-char-function' to translate user input key
This can be useful for adding mirror key. For example, one can make SPACE an
alternative of 'a', by adding:

(setq avy-translate-char-function
      (lambda (c) (if (= c 32) ?a c)))

to allow typing SPACE instead of character 'a' to jump to the location
highlighted by 'a'.

Fixes #59
2015-06-04 17:37:59 +02:00
Oleh Krehel
02bf35b6a0 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.

Fixes #53
2015-06-03 18:19:00 +02:00
Oleh Krehel
6dfa445e07 README.md: Mention a custom-command tutorial
Fixes #55
2015-06-03 17:30:14 +02:00
Oleh Krehel
27b3da3f4b avy.el (avy-goto-char-in-line): Fix to this window
Fixes #58
2015-06-02 18:54:04 +02:00
Oleh Krehel
fc93fe676c avy.el (avy-ignored-modes): New defcustom.
* avy.el (avy-dowindows): Use `avy-ignored-modes'.

Fixes #57
2015-06-02 17:38:38 +02:00
Oleh Krehel
7a008217e3 avy.el (avy-dowindows): Ignore pdf-view-mode
Fixes #57
2015-06-02 16:59:57 +02:00
Oleh Krehel
1350ab318e avy.el (avy-goto-char-in-line): Quote char
Fixes #56
2015-06-02 16:57:50 +02:00
Oleh Krehel
78d20e0b02 Fix jumping to other frames
* avy.el (avy--goto): Select the window frame if needed.

Fixes #54
2015-05-30 10:11:04 +02:00
Oleh Krehel
9ddde6dd79 avy.el (avy--overlay-at-full): Improve
Re #51
2015-05-26 16:59:01 +02:00
Oleh Krehel
b5e02ac61c Fixup byte-compile warnings
* avy.el (avy-tree): Move.
2015-05-26 16:05:05 +02:00
Oleh Krehel
55c77c5eb8 For De Bruin, don't build a tree
* avy.el (avy--group-by): Remove.
(avy--path-alist-to-tree): Remove.
(avy-tree-de-bruijn): Remove.
(avy-read-de-bruijn): New defun.
(avy--process): Update.

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.

Re #51
Re #5
2015-05-26 15:40:21 +02:00
Tassilo Horn
27b98bb730 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.
2015-05-26 14:30:41 +02:00
Oleh Krehel
791c16c6ac avy.el (avy-goto-char-in-line): New command
Fixes #49
2015-05-25 10:12:17 +02:00
Oleh Krehel
aa2eb24f53 Makefile: "all" should depend on "compile" 2015-05-19 16:21:47 +02:00
Oleh Krehel
199c52606d Bump version 2015-05-19 14:29:03 +02:00
Oleh Krehel
be74714fd4 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

Fixes #47
2015-05-18 20:38:20 +02:00
Oleh Krehel
a4f4015db4 avy.el (avy--overlay-at-full): Check overlay window
* avy.el (avy--overlay-at-full): Update.

Re #47
2015-05-18 19:14:03 +02:00
Oleh Krehel
92a7884d9c avy.el (avy-window-list): Fixup last commit
* avy.el (avy-window-list): Update.

Fixes #45
2015-05-18 16:31:46 +02:00
Oleh Krehel
b288c69aa0 make compile should run checkdoc
* targets/avy-init.el: Call `checkdoc' for "avy.el". This will actually
  work only in trunk Emacs.
2015-05-18 10:14:00 +02:00
Oleh Krehel
d6b741b444 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'.
2015-05-18 08:57:12 +02:00
Oleh Krehel
dc06220ba0 Fix the at-full style interaction with tabs
* avy.el (avy--overlay-at-full): When at tab, visualize it using
  `tab-width' spaces. Assume the path is shorter than `tab-width'.

Fixes #43
2015-05-17 13:44:17 +02:00
Oleh Krehel
4b4b7b46f1 README.md: Add a link to the wiki for defcustoms 2015-05-17 13:31:16 +02:00
Oleh Krehel
50cfc74ed0 Fixup the last commit and add contribution guidelines
* avy.el (avy-goto-char):
(avy-goto-char-2):
(avy-goto-word-1):
(avy-goto-subword-1):
(avy-goto-word-or-subword-1): Update argument list and docstring.

* README.md: Add a "Contributing" section.

Re #44
2015-05-17 12:40:56 +02:00
Yang Zhao
59c6b9d15e Expose chars to be read as args. 2015-05-16 21:53:09 -07:00
Oleh Krehel
ea6f5c5953 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.

Fixes #42
2015-05-16 19:33:17 +02:00
Oleh Krehel
1127467669 avy.el (avy-move-line): Use ARG lines 2015-05-16 17:59:35 +02:00
Ting-Yu Lin
f0694a2b73 Remove empty line after original one being moved
Fixed #40.
2015-05-14 18:10:17 +08:00
Oleh Krehel
a39f689908 Allow all kinds of styles for `avy-goto-line'
* avy.el (avy--line): Use the custom style. Use line end postion for
  'post style.

Fixes abo-abo/ace-link#17

Any of the following do something different now:

(setq avy-styles-alist
      '((avy-goto-line . post)))
(setq avy-styles-alist
      '((avy-goto-line . at)))
(setq avy-styles-alist
      '((avy-goto-line . at-full)))
(setq avy-styles-alist
      '((avy-goto-line . pre)))
2015-05-14 00:05:28 +02:00
Oleh Krehel
b0512fc8f7 avy.el (avy--overlay-at): Use `avy--overlay-offset'
Fixes abo-abo/lispy#70
2015-05-13 23:31:34 +02:00