From 601431c612b1585cbf32f18d4de6287b83cfbdf2 Mon Sep 17 00:00:00 2001 From: Brian Leung Date: Fri, 1 Jan 2021 19:04:27 -0800 Subject: [PATCH 3/4] comint-read-input-ring: skip over the comint-input-ring-separator * lisp/comint.el (comint-read-input-ring): Skip the separator. Because re-search-backward moves point to the beginning of the match, and since we don't want the separator appearing in the output, we skip over it. This is required to properly detect instances of the value that zsh uses for `comint-input-ring-file-prefix'; if the `comint-input-ring-file-prefix' is ':potato', the subsequent invocation `looking-at' sees '\n:potato' for all entries after the one at the very beginning of the history file. --- lisp/comint.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/comint.el b/lisp/comint.el index f92b7b4a7b..36fcbb9465 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -994,6 +994,7 @@ comint-read-input-ring (setq start (if (re-search-backward ring-separator nil t) (progn + (goto-char (match-end 0)) (when (and ring-file-prefix (looking-at ring-file-prefix)) -- 2.29.2