From 48ad3c535e3298b7ccc88517d592f651d258f7c0 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Thu, 19 Jan 2023 19:33:56 -0300 Subject: [PATCH] Use default content types if fail to call backend on khoj.el load Do not want khoj.el to fail on init/load if khoj backend not running --- src/interface/emacs/khoj.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interface/emacs/khoj.el b/src/interface/emacs/khoj.el index 9083d8fc..a36221b3 100644 --- a/src/interface/emacs/khoj.el +++ b/src/interface/emacs/khoj.el @@ -390,7 +390,7 @@ Render results in BUFFER-NAME." ;; set content type to last used or based on current buffer or to default :init-value (lambda (obj) (oset obj value (format "--content-type=%s" (or khoj--content-type (khoj--buffer-name-to-content-type (buffer-name)))))) ;; dynamically set choices to content types enabled on khoj backend - :choices (mapcar #'symbol-name (khoj--get-enabled-content-types))) + :choices (or (ignore-errors (mapcar #'symbol-name (khoj--get-enabled-content-types))) '("org" "markdown" "ledger" "music" "image"))) (transient-define-suffix khoj--search-command (&optional args) (interactive (list (transient-args transient-current-command)))