emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/gptel c0ffce0849 110/273: gptel: Fix reading bounds in org


From: ELPA Syncer
Subject: [nongnu] elpa/gptel c0ffce0849 110/273: gptel: Fix reading bounds in org files (#98)
Date: Wed, 1 May 2024 10:02:10 -0400 (EDT)

branch: elpa/gptel
commit c0ffce0849c8596d763d0ad603b9d67f75e93161
Author: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
Commit: Karthik Chikmagalur <karthikchikmagalur@gmail.com>

    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.
---
 gptel.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/gptel.el b/gptel.el
index 460262555c..0871826ddd 100644
--- a/gptel.el
+++ b/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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]