diff --git a/.config/emacs/init.org b/.config/emacs/init.org index 89f87bc..babf3f0 100644 --- a/.config/emacs/init.org +++ b/.config/emacs/init.org @@ -246,6 +246,7 @@ Finish up mu4e-alert dirvish restclient + gptel disaster magit)) @@ -2315,8 +2316,20 @@ These help speed eglot up apparently [[https://www.reddit.com/r/emacs/comments/1 #+begin_src emacs-lisp (setq gptel-default-mode #'org-mode) (setq gptel-model "gpt-4") -(add-hook 'gptel-post-response-functions #'font-lock-ensure) +(setq gptel-api-key (with-temp-buffer + (insert-file-contents (expand-file-name "gptel-key" user-emacs-directory)) + (buffer-string))) +(add-hook 'gptel-post-response-functions #'font-lock-ensure) +#+end_src + +This function was suggested by Karthink in order to fix an issue where gptel +org-mode was jumping back up to the top anytime the buffer was saved. Keeping it +around just in case. + +https://github.com/karthink/gptel/issues/199 + +#+begin_src emacs-lisp :tangle no (defun gptel--save-state () "Write the gptel state to the buffer.