emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ellama 7f309375d0 07/11: Add switch between active sess


From: ELPA Syncer
Subject: [elpa] externals/ellama 7f309375d0 07/11: Add switch between active sessions
Date: Thu, 18 Jan 2024 15:57:53 -0500 (EST)

branch: externals/ellama
commit 7f309375d058f17c3d410768ff76aa2f9340ae1b
Author: Sergey Kostyaev <sskostyaev@gmail.com>
Commit: Sergey Kostyaev <sskostyaev@gmail.com>

    Add switch between active sessions
---
 ellama.el | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/ellama.el b/ellama.el
index 5ca58203b7..9afb2f3d35 100644
--- a/ellama.el
+++ b/ellama.el
@@ -444,6 +444,16 @@ PROMPT is a variable contains last prompt in this session."
     (delete-file file t)
     (delete-file session-file t)))
 
+(defun ellama-session-switch ()
+  "Change current active session."
+  (interactive)
+  (let* ((id (completing-read
+             "Select session to activate: "
+             (hash-table-keys ellama--active-sessions)))
+        (buffer (ellama-get-session-buffer id)))
+    (setq ellama--current-session-id id)
+    (display-buffer buffer)))
+
 (defun ellama-stream (prompt &rest args)
   "Query ellama for PROMPT.
 ARGS contains keys for fine control.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]