]> git.eshelyaron.com Git - emacs.git/commit
Erase existing duplicates in eshell-history-ring
authorRobin Joy <emacs@robinjoy.net>
Fri, 24 May 2024 12:26:39 +0000 (14:26 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sun, 26 May 2024 05:56:56 +0000 (07:56 +0200)
commit6c6459a73b79fbf6303a41ebc24948b8f207a573
tree3e1a5eadc21fa1b4234eee98511c1f53d17d21fe
parent9116f0b35526c7a05b1a46a16c7d7c4c667b7ddf
Erase existing duplicates in eshell-history-ring

Erase all existing duplicates instead of just the last duplicate entry
when 'eshell-hist-ignoredups' is set to 'erase'.  Multiple duplicates
can exist in case 'eshell-hist-ignoredups' was set to something else
than 'erase' in the past or if the history file contains duplicates
(bug#71107).

* lisp/eshell/em-hist.el (eshell-add-input-to-history): Remove all
duplicates from history ring.

* test/lisp/eshell/em-hist-tests.el
(em-hist-test/add-to-history/erase-existing-dups): New test.

(cherry picked from commit 984fb346fdf0d5ec9eaea6126aad0bea8823b8a3)
lisp/eshell/em-hist.el
test/lisp/eshell/em-hist-tests.el