diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el index e559f5b39fe..18e19a9d9a5 100644 --- a/lisp/eshell/em-hist.el +++ b/lisp/eshell/em-hist.el @@ -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)