branch: externals/ellama
commit 03a65ca738d7cadf54b6f564b14694ccc85ccad7
Author: Sergey Kostyaev <sskosty...@gmail.com>
Commit: Sergey Kostyaev <sskosty...@gmail.com>

    Add function to activate session by id
---
 ellama.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/ellama.el b/ellama.el
index 73fd43240f..d7c675d657 100644
--- a/ellama.el
+++ b/ellama.el
@@ -780,6 +780,10 @@ If EPHEMERAL non nil new session will not be associated 
with any file."
     (when (file-exists-p translation-file)
       (delete-file translation-file t))))
 
+(defun ellama-activate-session (id)
+  "Change current active session to session with ID."
+  (setq ellama--current-session-id id))
+
 ;;;###autoload
 (defun ellama-session-switch ()
   "Change current active session."
@@ -788,7 +792,7 @@ If EPHEMERAL non nil new session will not be associated 
with any file."
              "Select session to activate: "
              (hash-table-keys ellama--active-sessions)))
         (buffer (ellama-get-session-buffer id)))
-    (setq ellama--current-session-id id)
+    (ellama-activate-session id)
     (display-buffer buffer)))
 
 ;;;###autoload

Reply via email to