128 Commits

Author SHA1 Message Date
Oleh Krehel
248bff08bb avy.el (avy--regex-candidates): Simplify
Remove the let-bound BEG and END that would shadow the function's args.
2015-10-19 10:08:26 +02:00
Yasushi SHOJI
70bd6cec70 Search only in the visible region
The current version of `avy--regex-candidates` first searches for the
given regex then skip the match if it's invisible.  This works fine with
less than a few thousand lines of buffer, however, it takes quit time if
your have tens of thousand lines hidden, say, in org file.

This patch reverse the strategy. Find all visible regions in given the
window first, then map the original search function to that list.  This
change reduced candidates search time from 10 or more seconds to instant
on my 100,000+ lines of org file.

It might be possible to have hundreds of visibility-interleaved regions
in a huge window on the 4K or 8K monitor in near the future, but this
reversed strategy should be fast enough for those system.

This fixes #108.
Fixes #109
2015-10-19 10:02:18 +02:00
Tassilo Horn
bda04b287b Properly highlight depending on avy-all-windows
Before this change, the highlighting was only performed in the selected
window even if avy-all-windows was true.  Now it's consistent with the
value of that variable.
2015-10-06 21:31:12 +02:00
Oleh Krehel
d439b9d44f avy.el (avy--overlay-at-full): Avoid negative length
Fixes #102
2015-09-22 11:51:11 +02:00
momomo5717
acdd9e8b3d Modify avy--read-string-timer 2015-09-19 19:00:39 +09:00
Tassilo Horn
22b4ff0658 Define new face avy-goto-char-timer-face for the highlights 2015-09-17 08:22:52 +02:00
Tassilo Horn
f9d7a76cd4 Improve avy-goto-char-timer.
1. Handle DEL in order to fix typos.
2. Handle RET in order to use the current input string immediately
   without waiting for another char for avy-timeout-seconds.
3. Highlight matches while reading chars.
2015-09-16 18:29:37 +02:00
Oleh Krehel
3f53a2a15e avy.el (avy-goto-line): Fix off-by-one 2015-09-11 12:24:02 +02:00
Oleh Krehel
67662efdb3 Fix indentation of defface
Re #97
2015-09-09 17:27:10 +02:00
Tassilo Horn
48aa2cd828 Improve avy-goto-char-timer so that it may read 1 or many chars
Now you can use avy-goto-char-timer and type as many chars as you want
given each char comes before avy-timeout-seconds (and the very first
char is mandatory, i.e., there is no timeout for the first one).
2015-09-09 16:51:17 +02:00
Akira Tamamori
ac162279f2 Add padding for wide-width character
Add padding for wide-width character (ex. Japanese and Chinese).
2015-09-04 10:38:10 +09:00
Oleh Krehel
b1ef1f8f8c avy.el (avy--line): Obey avy-background
Fixes #94
2015-08-24 11:11:26 +02:00
Oleh Krehel
72afecbc29 avy.el (avy-push-mark): Bring back push-mark
Fixes abo-abo/ace-window#41
2015-08-21 20:59:19 +02:00
Oleh Krehel
53decea669 avy.el (avy--line): Don't error on end of buffer
Re #91
2015-08-21 18:17:53 +02:00
Oleh Krehel
a6cfedaf5e avy.el (avy-goto-subword-0): Don't offer invisible chars
Fixes #90
2015-08-21 14:50:57 +02:00
Oleh Krehel
009c0bc1ed avy.el (avy--line): Work for visual-line-mode
Use `point' instead of `line-beginning-position'.

Fixes #91
2015-08-21 14:47:32 +02:00
Oleh Krehel
2c74d0160a avy.el (avy--generic-jump): Add beg and end optional args
* avy.el (avy-goto-char-in-line): Update.

Fixes #89
2015-08-21 14:34:07 +02:00
Oleh Krehel
36b296c82a avy.el (subword-backward-regexp): Fix declaration 2015-08-21 14:31:34 +02:00
Oleh Krehel
ed120ea164 avy.el (avy-goto-line): Allow numeric prefix arg
The old behavior remains for ARG 1 and 4. For all other ARG, simply go
to that line.

Fixes #86
2015-08-21 14:22:56 +02:00
Oleh Krehel
53d457cfe4 Add misc punctuation to subword commands
* avy.el (avy-goto-subword-0): Temporarily bind
  `subword-backward-regexp' to allow chars like ! or @ to count as
  subword parts.

Fixes #93
2015-08-21 13:19:36 +02:00
Oleh Krehel
dbd2d2018d avy.el (avy-pop-mark): Handle multiple frames
Re #88
2015-08-07 15:48:30 +02:00
Oleh Krehel
a86bdee66c avy.el (avy-pop-mark): use own history for points and windows
* avy.el (avy-action-goto): Don't save mark here, since the window was
  already changed.
(avy--process): Set mark here.
(avy-ring): New defvar.
(avy-push-mark): New defun.
(avy-pop-mark): Use `avy-ring' unless it's empty. Then use the mark ring.

Fixes #88
Re #69
Re #81
2015-08-07 15:06:28 +02:00
B Jacquet
1e578a147a Considers letter case only if given Upcase letter
Fixes #87
2015-08-07 12:58:36 +02:00
Oleh Krehel
30067ddc09 avy.el (avy-action-goto): Don't push mark when region is active
* avy.el (avy-action-goto): When the region is active, the user probably
  doesn't want to move the mark.

Fixes #84
2015-07-29 17:59:42 +02:00
Dror Levin
e8cebf1616 Make arg optional in avy-goto-subword-1 2015-07-21 15:42:21 +03:00
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