abo-abo / avy

Jump to things in Emacs tree-style
1.72k stars 110 forks source link

Add filter argument to `avy-jump` #267

Closed Luis-Henriquez-Perez closed 5 years ago

Luis-Henriquez-Perez commented 5 years ago

I see that avy--regex-candidates has the potential to use a filter to control which of the candidates we want and don't want. However, this filter is not available to avy-jump. I had to use advice to override avy-jump just so I could add one.

I propose adding an argument filter to avy-jump so it would look like this:

(cl-defun avy-jump (regex &key window-flip beg end action filter)
  (setq avy-action (or action avy-action))
  (let ((avy-all-windows
         (if window-flip
             (not avy-all-windows)
           avy-all-windows)))
    (avy--process
     (avy--regex-candidates regex beg end filter))))
abo-abo commented 5 years ago

Thanks.