Eshell: Add comment on history uniqueness algorithm
parent
91f8d8b8f0
commit
45575ad88d
|
@ -235,6 +235,10 @@ This should be faster then `seq-uniq'."
|
|||
(index 1))
|
||||
(while (<= index (1- (ring-length eshell-history-ring)))
|
||||
(if (string= first (ring-ref eshell-history-ring index))
|
||||
;; REVIEW: We could stop at the first match, it would be faster and it
|
||||
;; would eliminate duplicates if we started from a fresh history.
|
||||
;; From an existing history that would not clean up existing
|
||||
;; duplicates beyond the first one.
|
||||
(ring-remove eshell-history-ring index)
|
||||
(setq index (1+ index))))))
|
||||
(add-hook 'eshell-pre-command-hook 'ambrevar/eshell-history-remove-duplicates)
|
||||
|
|
Loading…
Reference in New Issue