DarwinAwardWinner / ido-completing-read-plus

Fancy completion all over Emacs, not just for buffers and files.
GNU General Public License v3.0
241 stars 31 forks source link

Dynamic collection updates ignore restrictions #133

Closed DarwinAwardWinner closed 7 years ago

DarwinAwardWinner commented 7 years ago

After running ido-restrict-to-matches, dynamic completion updates can add back in items that don't satisfy the restriction.

Example from https://github.com/DarwinAwardWinner/ido-completing-read-plus/issues/126#issuecomment-317880240:

(completing-read
 "Describe variable: "
 (collection-as-function obarray)
 (lambda (vv)
   (setq vv (intern vv))
   (or (get vv 'variable-documentation)
       (and (boundp vv) (not (keywordp vv)))))
 t nil nil)

And then type popup C-SPC type. Completions are not restricted to variables that match "popup".

DarwinAwardWinner commented 7 years ago

cc @vspinu

vspinu commented 7 years ago

Thanks Ryan for the quick fix. I think you forgot to include memoise in the dependencies ;)

I have updated and the restriction seem to work only with the most recent restriction. So if I do cider- C-SPC mode-map C-SPC I see candidates with mode-map but they don't contain cider-. Can you see this?

DarwinAwardWinner commented 7 years ago

Yes, I found a logic error in the code. Can you try latest master (version 4.5)?

vspinu commented 7 years ago

Great. Updated and it works like a charm. Thanks!