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

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

[nongnu] elpa/gptel 444a43134f 083/273: gptel-curl: Fix current-buffer f


From: ELPA Syncer
Subject: [nongnu] elpa/gptel 444a43134f 083/273: gptel-curl: Fix current-buffer for Curl requests
Date: Wed, 1 May 2024 10:01:49 -0400 (EDT)

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

    gptel-curl: Fix current-buffer for Curl requests
    
    * gptel-curl.el (gptel-curl-get-response): Set buffer-local model 
parameters in
    the correct (i.e. gptel) buffer, not in Curl's process buffer. This fixes 
#43.
---
 gptel-curl.el | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/gptel-curl.el b/gptel-curl.el
index 58695c8c62..76f0368b34 100644
--- a/gptel-curl.el
+++ b/gptel-curl.el
@@ -72,13 +72,13 @@ INFO is a plist with the following keys:
 
 Call CALLBACK with the response and INFO afterwards. If omitted
 the response is inserted into the current buffer after point."
-  (with-current-buffer (generate-new-buffer "*gptel-curl*")
-    (let* ((token (md5 (format "%s%s%s%s"
-                               (random) (emacs-pid) (user-full-name)
-                               (recent-keys))))
-           (args (gptel-curl--get-args (plist-get info :prompt) token))
-           (process (apply #'start-process "gptel-curl" (current-buffer)
-                           "curl" args)))
+  (let* ((token (md5 (format "%s%s%s%s"
+                             (random) (emacs-pid) (user-full-name)
+                             (recent-keys))))
+         (args (gptel-curl--get-args (plist-get info :prompt) token))
+         (process (apply #'start-process "gptel-curl"
+                         (generate-new-buffer "*gptel-curl*") "curl" args)))
+    (with-current-buffer (process-buffer process)
       (set-process-query-on-exit-flag process nil)
       (setf (alist-get process gptel-curl--process-alist)
             (nconc (list :token token



reply via email to

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