[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/gptel 226f8f0d90 208/273: gptel: Add customizable display-
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/gptel 226f8f0d90 208/273: gptel: Add customizable display-action (#216) |
Date: |
Wed, 1 May 2024 10:02:24 -0400 (EDT) |
branch: elpa/gptel
commit 226f8f0d9091e1feb113623ab6da5fdc471994e8
Author: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
Commit: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
gptel: Add customizable display-action (#216)
* gptel.el (gptel-display-buffer-action, gptel): Add
`gptel-display-buffer-action` to customize the display of the
gptel buffer.
* README: Mention new option.
---
README.org | 17 +++++++++--------
gptel.el | 22 +++++++++++++++++++++-
2 files changed, 30 insertions(+), 9 deletions(-)
diff --git a/README.org b/README.org
index dfec62f475..f5211fc35d 100644
--- a/README.org
+++ b/README.org
@@ -553,14 +553,15 @@ Other Emacs clients for LLMs prescribe the format of the
interaction (a comint s
| =gptel-temperature= | Randomness in response text, 0 to 2.
|
|-------------------+---------------------------------------------------------|
-|-----------------------------+----------------------------------------|
-| *Chat UI options* | |
-|-----------------------------+----------------------------------------|
-| =gptel-default-mode= | Major mode for dedicated chat buffers. |
-| =gptel-prompt-prefix-alist= | Text inserted before queries. |
-| =gptel-response-prefix-alist= | Text inserted before responses. |
-| =gptel-use-header-line= | Display status messages in header-line (default)
or minibuffer |
-|-----------------------------+----------------------------------------|
+|-----------------------------+----------------------------------------------------------------|
+| *Chat UI options* |
|
+|-----------------------------+----------------------------------------------------------------|
+| =gptel-default-mode= | Major mode for dedicated chat buffers.
|
+| =gptel-prompt-prefix-alist= | Text inserted before queries.
|
+| =gptel-response-prefix-alist= | Text inserted before responses.
|
+| =gptel-use-header-line= | Display status messages in header-line
(default) or minibuffer |
+| =gptel-display-buffer-action= | Placement of the gptel chat buffer.
|
+|-----------------------------+----------------------------------------------------------------|
** COMMENT Will you add feature X?
diff --git a/gptel.el b/gptel.el
index 796634799b..2886e7b7ff 100644
--- a/gptel.el
+++ b/gptel.el
@@ -313,6 +313,26 @@ information and the echo area for messages."
:type 'boolean
:group 'gptel)
+(defcustom gptel-display-buffer-action '(pop-to-buffer)
+ "The action used to display gptel chat buffers.
+
+The gptel buffer is displayed in a window using
+
+ (display-buffer BUFFER gptel-display-buffer-action)
+
+The value of this option has the form (FUNCTION . ALIST),
+where FUNCTION is a function or a list of functions. Each such
+function should accept two arguments: a buffer to display and an
+alist of the same form as ALIST. See info node `(elisp)Choosing
+Window' for details."
+ :group 'gptel
+ :type '(choice
+ (const :tag "Use display-buffer defaults" nil)
+ (const :tag "Display in selected window" (pop-to-buffer-same-window))
+ (cons :tag "Specify display-buffer action"
+ (choice function (repeat :tag "Functions" function))
+ alist)))
+
(defcustom gptel-crowdsourced-prompts-file
(let ((cache-dir (or (getenv "XDG_CACHE_HOME")
(getenv "XDG_DATA_HOME")
@@ -1242,7 +1262,7 @@ INTERACTIVEP is t when gptel is called interactively."
(skip-chars-backward "\t\r\n")
(if (bobp) (insert (or initial (gptel-prompt-prefix-string))))
(when interactivep
- (pop-to-buffer (current-buffer))
+ (display-buffer (current-buffer) gptel-display-buffer-action)
(message "Send your query with %s!"
(substitute-command-keys "\\[gptel-send]")))
(current-buffer)))
- [nongnu] elpa/gptel aa50cbab70 123/273: gptel: Bump version, (continued)
- [nongnu] elpa/gptel aa50cbab70 123/273: gptel: Bump version, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel c97778d5a8 127/273: gptel: address byte-compile and checkdoc warnings, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 3e361323d5 137/273: Update available OpenAI GPT models to match API (#146), ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 32dd463bd6 160/273: README: Mention YouTube demo, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 3ac5963080 168/273: README: Add instructions for Llamafile, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel bea31e33e2 175/273: gptel-ollama: Use default host in gptel-make-ollama, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel c6a07043af 179/273: gptel-kagi: Add support for Kagi FastGPT, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 3fb064a763 181/273: gptel: Better handling of read-only bufs, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel e79e386964 191/273: README: Move gptel-request to FAQ, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel a61fda4661 197/273: gptel-transient: better multi-line directive editing, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 226f8f0d90 208/273: gptel: Add customizable display-action (#216),
ELPA Syncer <=
- [nongnu] elpa/gptel 8ba07d042c 210/273: gptel: Bump version, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel a32f4effe5 215/273: gptel-curl: Handle empty responses correctly, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel e5f54d1d09 229/273: gptel-anthropic: Modify order of request items, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel f529457bbe 232/273: gptel: Use visual-line-mode when ediff-ing, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 9eea4be5ed 245/273: gptel-transient: Fix gptel-menu definition bug (#265), ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 6d3e4a99f5 236/273: gptel-transient: Rename additional-directive functions, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 5d069cfca8 243/273: gptel-anthropic: Simplify stream parser, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel b31c9be5e0 238/273: gptel-ollama: Adjust Ollama stream parser for libjansson, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 73a0cc25ba 237/273: gptel-transient: Simplify model selection, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 12e00cbd09 247/273: gptel-transient: No pre-fill when reading from minibuffer, ELPA Syncer, 2024/05/01