Emacs: Read gptel key from disk
This commit is contained in:
parent
26ea89d625
commit
263a8bec1a
@ -246,6 +246,7 @@ Finish up
|
|||||||
mu4e-alert
|
mu4e-alert
|
||||||
dirvish
|
dirvish
|
||||||
restclient
|
restclient
|
||||||
|
gptel
|
||||||
disaster
|
disaster
|
||||||
magit))
|
magit))
|
||||||
|
|
||||||
@ -2315,8 +2316,20 @@ These help speed eglot up apparently [[https://www.reddit.com/r/emacs/comments/1
|
|||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(setq gptel-default-mode #'org-mode)
|
(setq gptel-default-mode #'org-mode)
|
||||||
(setq gptel-model "gpt-4")
|
(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 ()
|
(defun gptel--save-state ()
|
||||||
"Write the gptel state to the buffer.
|
"Write the gptel state to the buffer.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user