From 0e9e9648e67bcd4ff97ee5fed5b9f5cc7424386c Mon Sep 17 00:00:00 2001 From: Alexander Matyasko Date: Wed, 7 Aug 2024 00:58:27 +0800 Subject: [PATCH 1/2] Fix emacs if syntax --- 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 31d427a0..6c185276 100644 --- a/src/interface/emacs/khoj.el +++ b/src/interface/emacs/khoj.el @@ -424,7 +424,7 @@ Auto invokes setup steps on calling main entrypoint." "Send multi-part form `BODY' of `CONTENT-TYPE' in request to khoj server. Append 'TYPE-QUERY' as query parameter in request url. Specify `BOUNDARY' used to separate files in request header." - (let ((url-request-method ((if force) "PUT" "PATCH")) + (let ((url-request-method (if force "PUT" "PATCH")) (url-request-data body) (url-request-extra-headers `(("content-type" . ,(format "multipart/form-data; boundary=%s" boundary)) ("Authorization" . ,(format "Bearer %s" khoj-api-key))))) From f16b0f628bd58da45315a38183dbb38e1078abef Mon Sep 17 00:00:00 2001 From: Alexander Matyasko Date: Sun, 11 Aug 2024 13:58:06 +0800 Subject: [PATCH 2/2] Fix true/false evaluation in Emacs to prevent unintended index re-indexing Previously, the code incorrectly treated all non-nil values as true, leading to the index being re-indexed with the force flag whenever the user selected to update the index. --- 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 6c185276..2456b4f3 100644 --- a/src/interface/emacs/khoj.el +++ b/src/interface/emacs/khoj.el @@ -1265,7 +1265,7 @@ Paragraph only starts at first text after blank line." (transient-define-suffix khoj--update-command (&optional args) "Call khoj API to update index of specified content type." (interactive (list (transient-args transient-current-command))) - (let* ((force-update (if (member "--force-update" args) "true" "false")) + (let* ((force-update (if (member "--force-update" args) t nil)) ;; set content type to: specified > last used > based on current buffer > default type (content-type (or (transient-arg-value "--content-type=" args) (khoj--buffer-name-to-content-type (buffer-name)))) (url-request-method "GET"))