From e95686c89ca9207cb01206b072e28991156af020 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Sat, 6 Aug 2022 16:27:23 +0300 Subject: [PATCH] Show complete Khoj keybindings when initiate search in Emacs - The keybindings to select search types was previously confusing as it only highlighted the final symbol to press (the C-x was shown but it wasn't made apparent that it had to be pressed before) - Previously some keybindings unrelated to khoj were also being shown in the which-key popup. Now only the khoj keybindings are visible --- src/interface/emacs/khoj.el | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/interface/emacs/khoj.el b/src/interface/emacs/khoj.el index cfac223b..60bf8ba5 100644 --- a/src/interface/emacs/khoj.el +++ b/src/interface/emacs/khoj.el @@ -95,12 +95,9 @@ C-x i | images (defun khoj--display-keybinding-info () "Display information on keybindings to customize khoj search. Use `which-key` if available, else display simple message in echo area" - (if (fboundp 'which-key--create-buffer-and-show) - (which-key--create-buffer-and-show - (kbd "C-x") - (symbolp (khoj--make-search-keymap)) - '(lambda (binding) (string-prefix-p "khoj--" (cdr binding))) - "Khoj Bindings") + (if (fboundp 'which-key-show-full-keymap) + (let ((khoj--keymap (khoj--make-search-keymap))) + (which-key-show-full-keymap 'khoj--keymap)) (message "%s" khoj--keybindings-info-message))) (defun khoj--extract-entries-as-markdown (json-response query) @@ -262,6 +259,7 @@ Use `which-key` if available, else display simple message in echo area" (defun khoj--minibuffer-exit-advice (&rest _args) (khoj--incremental-search t)) + ;;;###autoload (defun khoj () "Natural, Incremental Search for your personal notes, transactions and music using Khoj"