From 5a6418f693bd71c3dc0cb398209b769c45e59f30 Mon Sep 17 00:00:00 2001 From: Brian Leung Date: Fri, 1 Jan 2021 18:58:26 -0800 Subject: [PATCH 2/4] comint-read-input-ring: Use comint buffer's ring-file-prefix * lisp/comint.el (comint-read-input-ring): Bind `comint-input-ring-file-prefix' in anticipation of a buffer switch. --- lisp/comint.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lisp/comint.el b/lisp/comint.el index 2e683a7572..f92b7b4a7b 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -979,6 +979,7 @@ comint-read-input-ring (ring (make-ring ring-size)) ;; Use possibly buffer-local values of these variables. (ring-separator comint-input-ring-separator) + (ring-file-prefix comint-input-ring-file-prefix) (history-ignore comint-input-history-ignore) (ignoredups comint-input-ignoredups)) (with-temp-buffer @@ -993,17 +994,17 @@ comint-read-input-ring (setq start (if (re-search-backward ring-separator nil t) (progn - (when (and comint-input-ring-file-prefix + (when (and ring-file-prefix (looking-at - comint-input-ring-file-prefix)) + ring-file-prefix)) ;; Skip zsh extended_history stamps (goto-char (match-end 0))) (match-end 0)) (progn (goto-char (point-min)) - (when (and comint-input-ring-file-prefix + (when (and ring-file-prefix (looking-at - comint-input-ring-file-prefix)) + ring-file-prefix)) (goto-char (match-end 0))) (point)))) (setq history (buffer-substring start end)) -- 2.29.2