From 48e4a983c5c41824f9f7a704cb6876a3b408a4eb Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Fri, 5 Aug 2022 18:47:20 +0300 Subject: [PATCH] Allow switching search type in the middle of querying Khoj on Emacs - More generally, this allows configuring the khoj search anytime while in khoj minibuffer window - Earlier could only configure search type at the start of the search --- src/interface/emacs/khoj.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/interface/emacs/khoj.el b/src/interface/emacs/khoj.el index 035cd703..2c17050f 100644 --- a/src/interface/emacs/khoj.el +++ b/src/interface/emacs/khoj.el @@ -243,8 +243,6 @@ (let* ((khoj-buffer-name (get-buffer-create khoj--buffer-name))) ;; set khoj search type to last used or based on current buffer (setq khoj--search-type (or khoj--search-type (khoj--buffer-name-to-search-type (buffer-name)))) - ;; setup temporary keymap for khoj - (set-transient-map (khoj--search-keymap) t) ;; setup rerank to improve results once user idle for KHOJ--RERANK-AFTER-IDLE-TIME seconds (setq khoj--rerank-timer (run-with-idle-timer khoj--rerank-after-idle-time t 'khoj--incremental-search t)) ;; switch to khoj results buffer @@ -252,6 +250,8 @@ ;; open and setup minibuffer for incremental search (minibuffer-with-setup-hook (lambda () + ;; Add khoj keybindings for configuring search to minibuffer keybindings + (khoj--make-search-keymap minibuffer-local-map) ;; set current (mini-)buffer entered as khoj minibuffer ;; used to query khoj API only when user in khoj minibuffer (setq khoj--minibuffer-window (current-buffer))