mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-30 19:03:01 +01: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
|
;; 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 ()
|
(transient-define-argument khoj--content-type-switch ()
|
||||||
:class 'transient-switches
|
:class 'transient-switches
|
||||||
:argument-format "--content-type=%s"
|
:argument-format "--content-type=%s"
|
||||||
|
@ -1153,6 +1156,9 @@ Paragraph only starts at first text after blank line."
|
||||||
("u" "Update" khoj--update-command)
|
("u" "Update" khoj--update-command)
|
||||||
("q" "Quit" transient-quit-one)]])
|
("q" "Quit" transient-quit-one)]])
|
||||||
|
|
||||||
|
;; Show the Khoj Transient menu
|
||||||
|
(khoj--menu))
|
||||||
|
|
||||||
|
|
||||||
;; ----------
|
;; ----------
|
||||||
;; Entrypoint
|
;; Entrypoint
|
||||||
|
@ -1164,7 +1170,7 @@ Paragraph only starts at first text after blank line."
|
||||||
(interactive)
|
(interactive)
|
||||||
(when khoj-auto-setup
|
(when khoj-auto-setup
|
||||||
(khoj-setup t))
|
(khoj-setup t))
|
||||||
(khoj--menu))
|
(khoj--setup-and-show-menu))
|
||||||
|
|
||||||
(provide 'khoj)
|
(provide 'khoj)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue