branch: externals/ellama
commit 9256543fdd377be635d42bdcec868ef23c37f0b4
Author: Sergey Kostyaev <[email protected]>
Commit: Sergey Kostyaev <[email protected]>
Add new session option to ask commands
Added `--new-session` option to the `ellama-transient-ask-menu` command.
This
allows users to specify whether they want to create a new session when
using the
ask line, selection, or about functions. The changes include defining new
transient suffixes and updating the menu definition to include the new
option.
---
ellama-transient.el | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/ellama-transient.el b/ellama-transient.el
index 5f28cc51a9..50870e3307 100644
--- a/ellama-transient.el
+++ b/ellama-transient.el
@@ -244,13 +244,30 @@ Otherwise, prompt the user to enter a system message."
("f" "Make Format" ellama-make-format)]
["Quit" ("q" "Quit" transient-quit-one)]])
+(transient-define-suffix ellama-transient-ask-line (&optional args)
+ "Ask line. ARGS used for transient arguments."
+ (interactive (list (transient-args transient-current-command)))
+ (ellama-ask-line (transient-arg-value "--new-session" args)))
+
+(transient-define-suffix ellama-transient-ask-selection (&optional args)
+ "Ask selection. ARGS used for transient arguments."
+ (interactive (list (transient-args transient-current-command)))
+ (ellama-ask-selection (transient-arg-value "--new-session" args)))
+
+(transient-define-suffix ellama-transient-ask-about (&optional args)
+ "Ask about current buffer or region. ARGS used for transient arguments."
+ (interactive (list (transient-args transient-current-command)))
+ (ellama-ask-about (transient-arg-value "--new-session" args)))
+
;;;###autoload (autoload 'ellama-transient-ask-menu "ellama-transient" nil t)
(transient-define-prefix ellama-transient-ask-menu ()
"Ask Commands."
[["Ask Commands"
- ("l" "Ask Line" ellama-ask-line)
- ("s" "Ask Selection" ellama-ask-selection)
- ("a" "Ask About" ellama-ask-about)]
+ ("l" "Ask Line" ellama-transient-ask-line)
+ ("s" "Ask Selection" ellama-transient-ask-selection)
+ ("a" "Ask About" ellama-transient-ask-about)]
+ ["Session Options"
+ ("-n" "Create New Session" "--new-session")]
["Quit" ("q" "Quit" transient-quit-one)]])
;;;###autoload (autoload 'ellama-transient-translate-menu "ellama-transient"
nil t)