avy.el (avy--process): Add window to candidates if not present

`avy-read-de-bruijn' relies on the window being the cdr of each
candidate.

Fixes abo-abo/ace-link#22
This commit is contained in:
Oleh Krehel 2015-10-20 10:35:37 +02:00
parent f7ddd4b687
commit 528125e096

5
avy.el
View File

@ -485,6 +485,11 @@ Set `avy-style' according to COMMMAND as well."
(defun avy--process (candidates overlay-fn) (defun avy--process (candidates overlay-fn)
"Select one of CANDIDATES using `avy-read'. "Select one of CANDIDATES using `avy-read'.
Use OVERLAY-FN to visualize the decision overlay." Use OVERLAY-FN to visualize the decision overlay."
(unless (and (consp (car candidates))
(windowp (cdar candidates)))
(setq candidates
(mapcar (lambda (x) (cons x (selected-window)))
candidates)))
(let ((len (length candidates)) (let ((len (length candidates))
(cands (copy-sequence candidates)) (cands (copy-sequence candidates))
res) res)