From 216b17cfd0d4e3db830e1fa3ed0b1660d5fa0842 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Wed, 18 Jan 2023 22:00:12 -0300 Subject: [PATCH] Dynamically populate content type choices when khoj transient invoked --- src/interface/emacs/khoj.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/interface/emacs/khoj.el b/src/interface/emacs/khoj.el index 18452c15..138c05c7 100644 --- a/src/interface/emacs/khoj.el +++ b/src/interface/emacs/khoj.el @@ -359,7 +359,8 @@ Render results in BUFFER-NAME." :argument-regexp ".+" ;; 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--search-type (khoj--buffer-name-to-search-type (buffer-name)))))) - :choices '("org" "markdown" "ledger" "music" "image")) + ;; dynamically set choices to content types enabled on khoj backend + :choices (mapcar #'symbol-name (khoj--get-enabled-content-types))) (transient-define-suffix khoj--search (&optional args) (interactive (list (transient-args transient-current-command)))