From 125025c407e6995dd9239a51997082cb898acf3b Mon Sep 17 00:00:00 2001 From: Brian Leung Date: Fri, 1 Jan 2021 19:41:26 -0800 Subject: [PATCH 4/4] comint-read-input-ring: Tidy * lisp/comint.el (comint-read-input-ring): Simplify. --- lisp/comint.el | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/lisp/comint.el b/lisp/comint.el index 36fcbb9465..3476fd146c 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -991,23 +991,14 @@ comint-read-input-ring (while (and (< count comint-input-ring-size) (re-search-backward ring-separator nil t) (setq end (match-beginning 0))) - (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)) - ;; Skip zsh extended_history stamps - (goto-char (match-end 0))) - (match-end 0)) - (progn - (goto-char (point-min)) - (when (and ring-file-prefix - (looking-at - ring-file-prefix)) - (goto-char (match-end 0))) - (point)))) + (goto-char (if (re-search-backward ring-separator nil t) + (match-end 0) + (point-min))) + (when (and ring-file-prefix + (looking-at ring-file-prefix)) + ;; Skip zsh extended_history stamps + (goto-char (match-end 0))) + (setq start (point)) (setq history (buffer-substring start end)) (goto-char start) (when (and (not (string-match history-ignore history)) -- 2.29.2