Subject: bug#71107: 29.3; eshell-hist/Incorrect history handling with eshell-hist-ignoredups 'erase

From: Robin Campbell Joy <[email-masked]>
Date: Wed, 22 May 2024 10:21:12 +0200

Severity: minor
Tags: patch

In case of eshell-hist-ingoredups set to 'erase, history handling isn't
working correctly.

1) If the input ring is empty, no elements are added to the ring.
2) If elements are on the ring, but the element added to the ring is not
yet in the ring, the last element is deleted.
3) When switching to 'erase with multiple duplicates in the ring, only
the last equal element is removed.

emacs -Q
(require 'eshell)
(setq eshell-hist-ignoredups 'erase)
(eshell)
$ echo foo
foo
M-p -> Empty input ring