simple example of where this works?
I tried
(setq gnus-completing-read-function ; based on gnus-ido-completing-read
(defun gnus-ivy-completing-read (prompt collection &optional require-match
initial-input history def)
"Call `ivy-completing-read-function'."
(ivy-completing-read prompt collection nil require-match
initial-input history def)))
(use-package ivy-historian
:ensure t
:init
(ivy-historian-mode))
but whenever I click j in gnus, I get the exact same order.
Is there a simple example somewhere of where this package has an effect?
I don't use gnus, but I do use ivy-historian for everything except M-x, with good success overall. You can see my specific configuration here. I don't know enough to debug your specific problem, unfortunately.
Hm, I just did C-h v and typed his and picked historian--history-table (number 5 in a list of 10), then I did that again at least 5 times, but the list has the exact same ordering every time.
It seems to be saved, just not applied:
ELISP> (gethash "historian--history-table" (cdr (gethash 'counsel-describe-variable historian--history-table )))
10 (#o12, #xa, ?\C-j)
(did I do it 10 times maybe? lost count)
I took a look at the code, and it adds advices to ivy-historian--nadvice/ivy-read (which made it store the frequencies) and ivy-historian--nadvice/ivy--flx-sort (where it uses them), but I wasn't using flx sorting! After I snatched your (setq ivy-flx-limit 2000 ivy-re-builders-alist '((swiper . ivy--regex-plus) (t . ivy--regex-fuzzy))), it seems to sort :-)
Should ivy-historian perhaps advice the other sorting functions too?
@unhammer that is possible, but I am less familiar with how sorting is done in a non-flx setting.
Since my last comment, I developed and switched to prescient.el, so that's always an alternative.
I also have this doubt...
I don't know where this package is useful or under what circumstances it will be triggered.