From ffb8a29562a64d9bbeef1e5ab6ff79b5043a1859 Mon Sep 17 00:00:00 2001 From: egr95 Date: Sat, 3 Aug 2024 14:29:21 -0400 Subject: [PATCH] Customize isearch behavior in REPL. --- jupyter-repl.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/jupyter-repl.el b/jupyter-repl.el index c68e731e..de289e13 100644 --- a/jupyter-repl.el +++ b/jupyter-repl.el @@ -170,6 +170,16 @@ about DEPTH." :type 'integer :group 'jupyter-repl) +(defcustom jupyter-repl-isearch-override t + "Override isearch behavior in REPL buffers. +If non-nil, whenever a new REPL buffer is created, the isearch behavior will +be overriden so that instead of searching the contents of the buffer, we +search over the REPL command history instead. + +Can set this variable to nil in order to keep the standard isearch behavior." + :type 'boolean + :group 'jupyter-repl) + ;;; Implementation (defclass jupyter-repl-client (jupyter-widget-client jupyter-kernel-client) @@ -1715,7 +1725,8 @@ Return the buffer switched to." (add-hook 'pre-redisplay-functions 'jupyter-repl-preserve-window-margins nil t) ;; Initialize the REPL (jupyter-repl-initialize-fontification) - (jupyter-repl-isearch-setup) + (if jupyter-repl-isearch-override + (jupyter-repl-isearch-setup)) (jupyter-repl-sync-execution-state) (jupyter-repl-interaction-mode) ;; Do this last so that it runs before any other `change-major-mode-hook's.