Closed Elilif closed 11 months ago
Thank you for spotting this bug -- I ran into it for the first time a couple of hours after your message!
Fixed in c0ffce08.
@karthink Thank you for quick response.
The same problem also exists in gptel--save-state
, beacuse (gptel--get-bounds)
would return nil
.
The same problem also exists in
gptel--save-state
, beacuse(gptel--get-bounds)
would returnnil
.
I'm not sure I understand. It's fine for gptel--get-bounds to return nil, and desirable for that to be written into the Org file:
:PROPERTIES: :GPTEL_MODEL: gpt-3.5-turbo :GPTEL_BOUNDS: nil :END:
^ Do you foresee a problem with this?
@karthink Sorry for my ambiguous comment.
Here are steps to reproduce in emacs -Q
:
(add-to-list 'load-path "path-to/gptel/")
(require 'gptel)
(setq gptel-default-mode 'org-mode)
Then you will get (wrong-type-argument number-or-marker-p nil)
error.
I guess the error is caused by (= (marker-position offset-marker) offset)
when (gptel--get-bounds)
returns nil
.
In
gptel--restore-state
,read
will use the value of standard-input if(org-entry-get (point-min) "GPTEL_BOUNDS")
returnsnil
. That will interrupt your workflow when you restore a lot of gptel buffers. Therefore, should we make adjustments to the code? For example:The same as in
gptel--save-state