Closed jdtsmith closed 2 years ago
We could modify consult-mode-histories to support both cons pairs and three element lists and then update the index accordingly. The problem with duplicates will remain of course. If you are interested, I welcome a PR which adds this feature.
'((eshell-mode eshell-history-ring eshell-history-index)
(comint-mode comint-input-ring comint-input-ring-index)
(term-mode term-input-ring term-input-ring-index))
See #669.
A very useful feature of comint's ring-history search tools is that they record location. I.e, they set
comint-input-ring-index
to indicate where along the ring the command has been pulled from. This is necessary so that commands likecomint-get-next-from-history
can function. It's very convenient to select command from history, then useC-c C-x
repeatedly to pull the next commands on the ring.consult-history
does not permit this workflow, since it doesn't save location.I looked for an obvious way to implement this but couldn't find one. One issue is that consult removes duplicates from the history ring (for good reason). If
consult-history
at least returned the user-selected string, some:filter-return
advice on it utilizingring-member
could be added, to updatecomint-input-ring-index
. I don't know if "saved place along a ring" is a generic RING concept, or specific to comint. If it's general and discoverable, perhaps consult could just do this itself.