radian-software / prescient.el

☄️ Simple but effective sorting and filtering for Emacs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

completing-read on non-string inputs raises wrong-type-argument error

martenlienen opened this issue · comments

Hi,
the following code produces a (wrong-type-argument sequencep gpu) with ivy and prescient.

(let ((candidates '((default "julia") (remote "ssh"))))
  (completing-read "julia binary" candidates))

The problem is that
https://github.com/raxod502/prescient.el/blob/47fef02cc32b1fcd8ca97ec801572f5ba91a1a2a/prescient.el#L475-L476
assumes that the candidates are strings or something that you can call length on. This precludes prescient from working on integer or symbol candidates. One simple fix would be to convert all candidates to strings but since the code seems to be quite performance-optimized that may be unacceptable.

Best,
Marten

That sounds like a bug in Ivy, it should be converting candidates to strings before passing them to the sort function. Selectrum does not have this problem.

I can reproduce your problem though, to be clear. See #65.