mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-27 17:35:07 +01:00
Style Khoj chat directly via elisp instead of via in-buffer settings
This commit is contained in:
parent
f6ff7b1beb
commit
4f655d20ae
1 changed files with 6 additions and 5 deletions
|
@ -351,9 +351,7 @@ Render results in BUFFER-NAME using QUERY, CONTENT-TYPE."
|
|||
(let ((json-response (cdr (assoc 'response (khoj--query-chat-api "")))))
|
||||
(with-current-buffer (get-buffer-create buffer-name)
|
||||
(erase-buffer)
|
||||
(insert "#+STARTUP: showall hidestars\n")
|
||||
;; allow sub, superscript text within {} for footnotes
|
||||
(insert "#+OPTIONS: ^:{}\n")
|
||||
(insert "* Khoj Chat\n")
|
||||
(thread-last
|
||||
json-response
|
||||
;; generate chat messages from Khoj Chat API response
|
||||
|
@ -361,21 +359,24 @@ Render results in BUFFER-NAME using QUERY, CONTENT-TYPE."
|
|||
;; insert chat messages into Khoj Chat Buffer
|
||||
(mapc #'insert))
|
||||
(progn
|
||||
(org-mode)
|
||||
(khoj--add-hover-text-to-footnote-refs (point-min))
|
||||
|
||||
;; render reference footnotes as superscript
|
||||
(setq-local
|
||||
org-startup-folded "showall"
|
||||
org-hide-leading-stars t
|
||||
org-use-sub-superscripts '{}
|
||||
org-pretty-entities-include-sub-superscripts t
|
||||
org-pretty-entities t)
|
||||
(org-set-startup-visibility)
|
||||
|
||||
;; create khoj chat shortcut keybindings
|
||||
(use-local-map (copy-keymap org-mode-map))
|
||||
(local-set-key (kbd "m") #'khoj--chat)
|
||||
(local-set-key (kbd "C-x m") #'khoj--chat)
|
||||
|
||||
;; enable appropriate khoj chat major, minor modes
|
||||
(org-mode)
|
||||
;; enable minor modes for khoj chat
|
||||
(visual-line-mode)
|
||||
(read-only-mode t)))))
|
||||
|
||||
|
|
Loading…
Reference in a new issue