From f3c1512c38079dd9b8945182a70a2e2b312a8aa0 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Sun, 7 Aug 2022 15:57:08 +0300 Subject: [PATCH] Fix to let user to start enter query right after initiating khoj on emacs - Fix regression since moving to use `which-key-show-full-keymap~ - The above function reads user keypress, so eats up 1 keypress before starting to enter query - No way to pass no-paging config via the external function to the internally used which-key--show-keymap function that does allow setting no-paging to not read user keypress - So use the internal function instead and set no-paging arg to t --- src/interface/emacs/khoj.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/interface/emacs/khoj.el b/src/interface/emacs/khoj.el index 60bf8ba5..12e64918 100644 --- a/src/interface/emacs/khoj.el +++ b/src/interface/emacs/khoj.el @@ -97,7 +97,9 @@ C-x i | images Use `which-key` if available, else display simple message in echo area" (if (fboundp 'which-key-show-full-keymap) (let ((khoj--keymap (khoj--make-search-keymap))) - (which-key-show-full-keymap 'khoj--keymap)) + (which-key--show-keymap (symbol-name 'khoj--keymap) + (symbol-value 'khoj--keymap) + nil t t)) (message "%s" khoj--keybindings-info-message))) (defun khoj--extract-entries-as-markdown (json-response query) @@ -242,7 +244,7 @@ Use `which-key` if available, else display simple message in echo area" (delete-process proc))))) (defun khoj--teardown-incremental-search () - (message "[Khoj]: Teardown Incremental Search") + (message "Khoj: Teardown Incremental Search") ;; remove advice to rerank results on normal exit from minibuffer (advice-remove 'exit-minibuffer #'khoj--minibuffer-exit-advice) ;; unset khoj minibuffer window