abo-abo / avy

Jump to things in Emacs tree-style
1.74k stars 111 forks source link

Are some matches not possible with avy--generic-jump? #200

Closed ghost closed 7 years ago

ghost commented 7 years ago

I tried to make the main motion keys I usually use in vim such as W. W matches the first character in a sequence of non-space characters.

Using pcre this is not too difficult:((?<=\s)|^)\S where \s is a whitespace character and \S is non-whitepsace

avy--generic-jump takes in emacs regex.

But in emacs regexps there is no lookbehind.

Does this mean some patterns that require lookbacks and lookaround cannot be written using avy--generic-jump?

abo-abo commented 7 years ago

This is correct, one regex won't do. But there are easy workarounds if you know elisp. Just build a list of points yourself and pass it to avy.

ghost commented 7 years ago

Hi, I made a function get-WORD-begin-points that collects the avy targets. Looking at the avy source code I see some functions that take in an individual point. Where exactly do I pass the list of points in to avy?

abo-abo commented 7 years ago

avy--process. See also the code of avy--generic-jump.