Fix problem with empty command histories in eshell and `erase'

* lisp/eshell/em-hist.el (eshell-add-input-to-history): Protect
against an empty ring (bug#48770).
This commit is contained in:
Lars Ingebrigtsen 2021-06-03 09:50:20 +02:00
parent 3272cfa8d4
commit 2e8212a565

View file

@ -379,7 +379,7 @@ input."
(if (eq eshell-hist-ignoredups 'erase)
;; Remove any old occurrences of the input, and put
;; the new one at the end.
(progn
(unless (ring-empty-p eshell-history-ring)
(ring-remove eshell-history-ring
(ring-member eshell-history-ring input))
t)