historian.el icon indicating copy to clipboard operation
historian.el copied to clipboard

simple example of where this works?

Open unhammer opened this issue 8 years ago • 6 comments

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?

unhammer avatar May 15 '17 15:05 unhammer

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.

raxod502 avatar Jun 12 '17 04:06 raxod502

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)

unhammer avatar Jun 12 '17 08:06 unhammer

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 avatar Jun 28 '17 19:06 unhammer

@unhammer that is possible, but I am less familiar with how sorting is done in a non-flx setting.

PythonNut avatar Jun 10 '18 19:06 PythonNut

Since my last comment, I developed and switched to prescient.el, so that's always an alternative.

raxod502 avatar Jun 10 '18 22:06 raxod502

I also have this doubt...

I don't know where this package is useful or under what circumstances it will be triggered.

yuzumx avatar Jan 13 '19 01:01 yuzumx