[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/gptel 0ea3c7fb15 143/273: gptel-transient: Improve suffix
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/gptel 0ea3c7fb15 143/273: gptel-transient: Improve suffix message editor |
Date: |
Wed, 1 May 2024 10:02:16 -0400 (EDT) |
branch: elpa/gptel
commit 0ea3c7fb15b0b60bcc930d7cadc5148abb1ca724
Author: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
Commit: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
gptel-transient: Improve suffix message editor
* gptel-transient.el (gptel--suffix-system-message): Improve the
editing prompt for custom suffixes. Unset the "C-c C-c" and "C-c
C-k" keys from text-mode. FIXME: This is fragile, instead add the
keymap with these keys as a sticky text-property over the text.
---
gptel-transient.el | 43 +++++++++++++++++++++++++------------------
1 file changed, 25 insertions(+), 18 deletions(-)
diff --git a/gptel-transient.el b/gptel-transient.el
index 2ee95219d9..7694fedceb 100644
--- a/gptel-transient.el
+++ b/gptel-transient.el
@@ -520,24 +520,29 @@ This uses the prompts in the variable
(let ((orig-buf (current-buffer))
(msg-start (make-marker)))
(with-current-buffer (get-buffer-create "*gptel-system*")
- (erase-buffer)
- (text-mode)
- (insert
- "# Insert your system message below and press "
- (propertize "C-c C-c" 'face 'help-key-binding)
- " when ready, or "
- (propertize "C-c C-k" 'face 'help-key-binding)
- " to abort.\n"
- "# Example: You are a helpful assistant. Answer as concisely as
possible.\n"
- "# Example: Reply only with shell commands and no prose.\n"
- "# Example: You are a poet. Reply only in verse.\n\n")
- (set-marker msg-start (point))
- (insert (buffer-local-value 'gptel--system-message orig-buf))
- (beginning-of-line)
- (push-mark)
- (end-of-line)
- (exchange-point-and-mark)
- (activate-mark)
+ (let ((inhibit-read-only t))
+ (erase-buffer)
+ (text-mode)
+ (insert
+ "# Insert your system message below and press "
+ (propertize "C-c C-c" 'face 'help-key-binding)
+ " when ready, or "
+ (propertize "C-c C-k" 'face 'help-key-binding)
+ " to abort.\n"
+ "# Example: You are a helpful assistant. Answer as concisely as
possible.\n"
+ "# Example: Reply only with shell commands and no prose.\n"
+ "# Example: You are a poet. Reply only in verse.\n")
+ (add-text-properties
+ (point-min) (point)
+ (list 'read-only t 'face 'font-lock-comment-face))
+ (insert "\n")
+ ;; TODO: make-separator-line requires Emacs 28.1+.
+ ;; (insert (propertize (make-separator-line) 'rear-nonsticky t))
+ (set-marker msg-start (point))
+ (insert (buffer-local-value 'gptel--system-message orig-buf))
+ (push-mark)
+ (beginning-of-line)
+ (activate-mark))
(display-buffer (current-buffer)
`((display-buffer-below-selected)
(body-function . ,#'select-window)
@@ -545,6 +550,8 @@ This uses the prompts in the variable
(let ((quit-to-menu
(lambda ()
(interactive)
+ (local-unset-key (kbd "C-c C-c"))
+ (local-unset-key (kbd "C-c C-k"))
(quit-window)
(display-buffer
orig-buf
- [nongnu] elpa/gptel 30700cc88a 096/273: README: Mention extensions, gptel-proxy, (continued)
- [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
- [nongnu] elpa/gptel 0ea3c7fb15 143/273: gptel-transient: Improve suffix message editor,
ELPA Syncer <=
- [nongnu] elpa/gptel ce75072f9d 152/273: gptel: Bump version, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 3af2650342 170/273: gptel-transient: save window state when ediff, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel e67ed41e31 173/273: README: Specify: no key needed for llama backend, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 1fcb4606a2 184/273: Fix compilation warning in gptel-openai.el, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel b3d028d074 185/273: Add .gitignore, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 5465271541 207/273: gptel: Add gpt-4-0125-preview to model list (Fix #215), ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 43f625ecb9 209/273: gptel-openai: curl-args slot in gptel-backend (#221), ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel d502ad8ecb 222/273: test-gptel-org: Add markdown conversion tests, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 9925dc91b4 223/273: gptel: Improve markdown converter, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel dade9ec8e1 231/273: gptel: Add introspection commands, ELPA Syncer, 2024/05/01