[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/gptel f218388d4d 082/273: gptel-transient: Fix bug when se
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/gptel f218388d4d 082/273: gptel-transient: Fix bug when sending in existing session |
Date: |
Wed, 1 May 2024 10:01:48 -0400 (EDT) |
branch: elpa/gptel
commit f218388d4dcd88aa339872c797f4805a66d10217
Author: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
Commit: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
gptel-transient: Fix bug when sending in existing session
* gptel-transient.el (gptel--suffix-send, gptel-menu): When
reading input from the minibuffer and sending the output to an
existing gptel session, only use the prompt read from the
minibuffer. Reword the "Overwrite/Delete prompt" option.
---
gptel-transient.el | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
diff --git a/gptel-transient.el b/gptel-transient.el
index 1548325677..167b870e42 100644
--- a/gptel-transient.el
+++ b/gptel-transient.el
@@ -69,7 +69,7 @@ Or is it the other way around?"
(gptel--infix-model)]
["Prompt:"
("-r" "From minibuffer instead" "-r")
- ("-i" "Overwrite/Delete prompt" "-i")
+ ("-i" "Replace/Delete prompt" "-i")
"Response to:"
("-m" "Minibuffer instead" "-m")
("-n" "New session" "-n"
@@ -339,18 +339,19 @@ will get progressively longer!"
(setq buffer (get-buffer buffer-name))
(setq output-to-other-buffer-p t)
(let ((reduced-prompt
- (if (use-region-p)
- (buffer-substring-no-properties (region-beginning)
- (region-end))
- (buffer-substring-no-properties
- (save-excursion
- (text-property-search-backward
- 'gptel 'response
- (when (get-char-property (max (point-min) (1- (point)))
- 'gptel)
- t))
- (point))
- (point)))))
+ (or prompt
+ (if (use-region-p)
+ (buffer-substring-no-properties (region-beginning)
+ (region-end))
+ (buffer-substring-no-properties
+ (save-excursion
+ (text-property-search-backward
+ 'gptel 'response
+ (when (get-char-property (max (point-min) (1- (point)))
+ 'gptel)
+ t))
+ (point))
+ (point))))))
(with-current-buffer buffer
(goto-char (point-max))
(insert reduced-prompt)
- [nongnu] elpa/gptel a43f5ac5fa 064/273: gptel: Rename stream-related vars and defuns, (continued)
- [nongnu] elpa/gptel a43f5ac5fa 064/273: gptel: Rename stream-related vars and defuns, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 2e34981aa0 062/273: gptel: Rename :insert-marker, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 23332a9bc5 077/273: gptel-transient: Add outline-minor-mode support, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 00abbf7597 081/273: gptel-transient: More visual feedback, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 444a43134f 083/273: gptel-curl: Fix current-buffer for Curl requests, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 37c381c2e5 092/273: README: Update with acknowledgments and more, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel d13b0c4ab7 088/273: gptel-transient: Fix gptel-system-prompt, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 6202474a6e 080/273: README: Update with changes to gptel-menu, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 075609544a 085/273: README: Update instructions for setting key (#46), ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel a7207a3835 097/273: README: Add TOC, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel f218388d4d 082/273: gptel-transient: Fix bug when sending in existing session,
ELPA Syncer <=
- [nongnu] elpa/gptel 30700cc88a 096/273: README: Mention extensions, gptel-proxy, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 09729ee718 089/273: gptel: Create customization group, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel ac754ceb2a 086/273: gptel: Handle read-only gptel-buffers, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel cc6c5e7321 104/273: gptel: saving and restoring state, and limiting context, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 24add64455 114/273: gptel: Adjust how gptel--system-message is set, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 17a58d38e7 135/273: gptel: Fix bug in url-retrieve setup, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 61c0df5e19 119/273: gptel, gptel-curl: Make the gptel text-property non-sticky, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 50a2498259 126/273: README: Tweak instructions for local LLMs, mention #120, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel ec0e461b35 128/273: gptel-curl: Increased curl timeout (#127), ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel d5949ef428 140/273: gptel-curl: handle large Curl payloads with a temp file (#137), ELPA Syncer, 2024/05/01