From d7fb9a596e62cb747d40810eb45ed70178a98a27 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Mon, 27 Mar 2023 01:16:05 +0700 Subject: [PATCH] Auto configure server before loading khoj-menu If the config hasn't changed there'll be no update. If config has changed indexing will get triggered asynchronously. But user cannot make query till indexing done As easier to know when server ready to configure --- src/interface/emacs/khoj.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/interface/emacs/khoj.el b/src/interface/emacs/khoj.el index ba9fc344..c2aa013d 100644 --- a/src/interface/emacs/khoj.el +++ b/src/interface/emacs/khoj.el @@ -266,7 +266,9 @@ for example), set this to the full interpreter path." (setq khoj--server-ready? nil)) :filter (lambda (process msg) (cond ((string-match (format "Uvicorn running on %s" khoj-server-url) msg) - (setq khoj--server-ready? t)) + (progn + (setq khoj--server-ready? t) + (khoj--server-configure))) ((not khoj--server-ready?) (dolist (line (split-string msg "\n")) (message "khoj.el: %s" (nth 1 (split-string msg " " t " *")))))) @@ -923,6 +925,7 @@ Paragraph only starts at first text after blank line." (khoj--server-setup)) (while (not khoj--server-ready?) (sleep-for 0.5)) + (khoj--server-configure) (khoj--menu)) (provide 'khoj)