radian-software / prescient.el

☄️ Simple but effective sorting and filtering for Emacs.
MIT License
615 stars 25 forks source link

Is there a way to disable prescient for a single (ivy-read) call? #104

Closed Dima-369 closed 3 years ago

Dima-369 commented 3 years ago

Say I have a call like this:

(ivy-read "Test: " '("1" "2" "3"))

Is there a easy way to disable prescient for this simple call?

Dima-369 commented 3 years ago

Seeing how this repository is not maintained anymore, I used Selectrum to achieve the exact same result for me:

(selectrum-completing-read "Test: " '("1" "2" "3"))
clemera commented 3 years ago

+1 for Selectrum :smile: But your example still would use prescient sorting if you have it enabled. To disable sorting for a single completion session you could use:

(minibuffer-with-setup-hook
    (lambda ()
      (setq-local selectrum-should-sort nil))
  (completing-read "Test: " '("1" "2" "3")))