From 48047c06006f8a26881c54fc39755e96ee8b3c95 Mon Sep 17 00:00:00 2001 From: Karthik Chikmagalur Date: Fri, 29 Dec 2023 15:27:47 -0800 Subject: [PATCH] gptel-transient: Improve system-message edit buffer * gptel-transient.el (gptel--suffix-system-message): Use a header line for better messaging when editing the system prompt. --- gptel-transient.el | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/gptel-transient.el b/gptel-transient.el index c06933d..5fce095 100644 --- a/gptel-transient.el +++ b/gptel-transient.el @@ -535,19 +535,20 @@ This uses the prompts in the variable (let ((inhibit-read-only t)) (erase-buffer) (text-mode) + (setq header-line-format + (concat + "Edit 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.")) (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") + "# Example: You are a poet. Reply only in verse.\n\n") (add-text-properties - (point-min) (point) + (point-min) (1- (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))