mirror of
https://github.com/khoj-ai/khoj.git
synced 2025-02-17 08:04:21 +00:00
Initialize the Khoj Transient menu on first run instead of load
This prevents Khoj from polling the Khoj server until explicitly invoked via `khoj' entrypoint function. Previously it'd make a request to the khoj server every time Emacs or khoj.el was loaded Closes #243
This commit is contained in:
parent
b669aa2395
commit
f64fa06e22
1 changed files with 49 additions and 43 deletions
|
@ -1092,6 +1092,9 @@ Paragraph only starts at first text after blank line."
|
|||
;; Khoj Menu
|
||||
;; ---------
|
||||
|
||||
(defun khoj--setup-and-show-menu ()
|
||||
"Create Transient menu for khoj and show it."
|
||||
;; Create the Khoj Transient menu
|
||||
(transient-define-argument khoj--content-type-switch ()
|
||||
:class 'transient-switches
|
||||
:argument-format "--content-type=%s"
|
||||
|
@ -1153,6 +1156,9 @@ Paragraph only starts at first text after blank line."
|
|||
("u" "Update" khoj--update-command)
|
||||
("q" "Quit" transient-quit-one)]])
|
||||
|
||||
;; Show the Khoj Transient menu
|
||||
(khoj--menu))
|
||||
|
||||
|
||||
;; ----------
|
||||
;; Entrypoint
|
||||
|
@ -1164,7 +1170,7 @@ Paragraph only starts at first text after blank line."
|
|||
(interactive)
|
||||
(when khoj-auto-setup
|
||||
(khoj-setup t))
|
||||
(khoj--menu))
|
||||
(khoj--setup-and-show-menu))
|
||||
|
||||
(provide 'khoj)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue