gptel: Fix reading bounds in org files (#98)
* gptel.el (gptel--restore-state): When there is no "GPTEL_BOUNDS" org property, `read' asks for stdin instead. Fix by only calling `read' when this property is non-nil. Thanks to @Elilif for spotting this bug.
This commit is contained in:
parent
0f161a466b
commit
c0ffce0849
1 changed files with 2 additions and 3 deletions
5
gptel.el
5
gptel.el
|
@ -331,11 +331,10 @@ Currently saving and restoring state is implemented only for
|
|||
(widen)
|
||||
(condition-case-unless-debug nil
|
||||
(progn
|
||||
(when-let ((bounds
|
||||
(read (org-entry-get (point-min) "GPTEL_BOUNDS"))))
|
||||
(when-let ((bounds (org-entry-get (point-min) "GPTEL_BOUNDS")))
|
||||
(mapc (pcase-lambda (`(,beg . ,end))
|
||||
(put-text-property beg end 'gptel 'response))
|
||||
bounds)
|
||||
(read bounds))
|
||||
(message "gptel chat restored."))
|
||||
(when-let ((model (org-entry-get (point-min) "GPTEL_MODEL")))
|
||||
(setq-local gptel-model model))
|
||||
|
|
Loading…
Add table
Reference in a new issue