[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/gptel 7c2e342f35 176/273: gptel-transient: Add prompting f
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/gptel 7c2e342f35 176/273: gptel-transient: Add prompting from kill-ring |
Date: |
Wed, 1 May 2024 10:02:20 -0400 (EDT) |
branch: elpa/gptel
commit 7c2e342f358019f236e641b920615ede11dbde86
Author: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
Commit: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
gptel-transient: Add prompting from kill-ring
* gptel-transient.el (gptel-menu, gptel--suffix-send): Add a
transient menu option to select the prompt from the kill-ring.
By default the latest kill is selected. Sending with a prefix-arg
allows for choosing the kill ring element.
TODO: This latter behavior needs to be made discoverable somehow.
---
gptel-transient.el | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/gptel-transient.el b/gptel-transient.el
index 82889430ce..f1c7e1b497 100644
--- a/gptel-transient.el
+++ b/gptel-transient.el
@@ -123,6 +123,7 @@ which see."
(gptel--infix-temperature)]
["Prompt:"
("p" "From minibuffer instead" "p")
+ ("y" "From kill-ring instead" "y")
("i" "Replace/Delete prompt" "i")
"Response to:"
("m" "Minibuffer instead" "m")
@@ -379,13 +380,20 @@ will get progressively longer!"
(buffer) (position)
(callback) (gptel-buffer-name)
(prompt
- (and (member "p" args)
- (read-string
- (format "Ask %s: " (gptel-backend-name gptel-backend))
- (apply #'buffer-substring-no-properties
- (if (use-region-p)
- (list (region-beginning) (region-end))
- (list (line-beginning-position)
(line-end-position))))))))
+ (cond
+ ((member "p" args)
+ (read-string
+ (format "Ask %s: " (gptel-backend-name gptel-backend))
+ (apply #'buffer-substring-no-properties
+ (if (use-region-p)
+ (list (region-beginning) (region-end))
+ (list (line-beginning-position) (line-end-position))))))
+ ((member "y" args)
+ (unless (car-safe kill-ring)
+ (user-error "`kill-ring' is empty! Nothing to send."))
+ (if current-prefix-arg
+ (read-from-kill-ring "Prompt from kill-ring: ")
+ (current-kill 0))))))
(cond
((member "m" args)
(setq stream nil)
- [nongnu] elpa/gptel eb088f2f21 213/273: gptel-anthropic: support Anthropic AI's Claude 3 (#229), (continued)
- [nongnu] elpa/gptel eb088f2f21 213/273: gptel-anthropic: support Anthropic AI's Claude 3 (#229), ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 3935a6dcf8 221/273: :recycle:: Untangle Gemini model and endpoint #212 (#213), ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 260be9d8d4 230/273: gptel: Consolidate HTTP request process, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 53a905dafc 253/273: gptel: Show chosen system message in header-line, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 306fe3bd8c 269/273: gptel-ollama: Fix parsing error (#179), ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 97ab6cbd1e 273/273: gptel: Add .elpaignore, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 4356f6fbec 103/273: gptel: correct system message with gptel-request, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 3308449761 133/273: gptel: Fix prompt string handling in gptel-request, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 190d1d20e2 121/273: gptel: Update header line and package info description, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel f571323174 163/273: gptel-gemini: Simulate system-message for gemini, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 7c2e342f35 176/273: gptel-transient: Add prompting from kill-ring,
ELPA Syncer <=
- [nongnu] elpa/gptel 1752f1d589 180/273: gptel-kagi: Add support for the Kagi summarizer, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel d0c685e501 189/273: gptel: checkdoc linting and indentation rules, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 8a25058eed 190/273: gptel-openai: default :header key to simplify config, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel f0e4889c36 196/273: gptel: Update OpenAI model list, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 95925f3571 198/273: Automatically create parent directories for gptel-crowdsourced-prompts-file (#203), ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel af5444a2ea 201/273: gptel: docstrings for multi-LLM support, bump version, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 49cfc78378 203/273: gptel: Add page boundaries, restructure files, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 0d6264f268 214/273: gptel-curl: Adjust response beginning position, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 39376aa3f4 020/273: gptel-transient: Add transient menus for setting parameters, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel dfca03a266 028/273: LICENSE: Add GPLv3 license, ELPA Syncer, 2024/05/01