]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix problem with empty command histories in eshell and `erase'
authorLars Ingebrigtsen <larsi@gnus.org>
Thu, 3 Jun 2021 07:50:20 +0000 (09:50 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 3 Jun 2021 07:50:35 +0000 (09:50 +0200)
* lisp/eshell/em-hist.el (eshell-add-input-to-history): Protect
against an empty ring (bug#48770).

lisp/eshell/em-hist.el

index e559f5b39fee17418ed4e84ef62a7da7be697381..18e19a9d9a508c987f432a4326d865d11e5bf925 100644 (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)