From 1cc3067eefdb9bb92eb67fdbff2c903c5df41f6c Mon Sep 17 00:00:00 2001 From: Jens Schmidt Date: Sat, 20 May 2023 23:03:29 +0200 Subject: [PATCH] Preserve mark in comint-history-isearch Preserve mark in `comint-history-isearch-backward' and friends, which tend to set the mark on completion of the isearch to unexpected positions. * lisp/comint.el (comint-history-isearch-end): Set `isearch-opoint' to point. --- lisp/comint.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lisp/comint.el b/lisp/comint.el index 9d2c245247f..77973ab76de 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -1543,6 +1543,8 @@ comint-history-isearch-end (setq isearch-message-function nil) (setq isearch-wrap-function nil) (setq isearch-push-state-function nil) + ;; Force isearch to not change mark. + (setq isearch-opoint (point)) (kill-local-variable 'isearch-lazy-count) (remove-hook 'isearch-mode-end-hook 'comint-history-isearch-end t) (unless isearch-suspended -- 2.30.2