[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ellama 02bb628778 5/8: Fix bug wrong clearing session
From: |
ELPA Syncer |
Subject: |
[elpa] externals/ellama 02bb628778 5/8: Fix bug wrong clearing session |
Date: |
Fri, 19 Jan 2024 18:58:00 -0500 (EST) |
branch: externals/ellama
commit 02bb628778569993c250b0153db93ce70e7b24b5
Author: Sergey Kostyaev <sskostyaev@gmail.com>
Commit: Sergey Kostyaev <sskostyaev@gmail.com>
Fix bug wrong clearing session
---
ellama.el | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/ellama.el b/ellama.el
index 5f20aaa46c..ae98e9e87c 100644
--- a/ellama.el
+++ b/ellama.el
@@ -401,13 +401,21 @@ Provided PROVIDER and PROMPT will be used in new session."
(advice-add #'keyboard-quit :before #'ellama--cancel-current-request)
-(defun ellama--session-deactivate (&rest _)
- "Deactivate current session."
- (when ellama--current-session
- (let ((id (ellama-session-id ellama--current-session)))
+(defun ellama--session-deactivate (&rest args)
+ "Deactivate current session with ARGS."
+ (when-let* ((buf (car args))
+ (session
+ (with-current-buffer buf
+ ellama--current-session))
+ (id (ellama-session-id session)))
+ (when (string= (if (bufferp buf)
+ (buffer-name buf)
+ buf)
+ (buffer-name (ellama-get-session-buffer id)))
+ (message "clearing %s" id)
+ (remhash id ellama--active-sessions)
(when (equal ellama--current-session-id id)
- (setq ellama--current-session-id nil))
- (remhash id ellama--active-sessions))))
+ (setq ellama--current-session-id nil)))))
(advice-add #'kill-buffer :before #'ellama--session-deactivate)
@@ -594,7 +602,8 @@ when the request completes (with BUFFER current)."
(window (get-buffer-window buffer)))
(with-selected-window window
(goto-char (point-max))
- (recenter -1)))))))
+ (recenter -1)))
+ (undo-amalgamate-change-group ellama--change-group)))))
(setq ellama--change-group (prepare-change-group))
(activate-change-group ellama--change-group)
(set-marker start point)
@@ -609,7 +618,6 @@ when the request completes (with BUFFER current)."
(lambda (text)
(funcall insert-text text)
(with-current-buffer buffer
- (undo-amalgamate-change-group
ellama--change-group)
(accept-change-group ellama--change-group)
(spinner-stop)
(funcall donecb text)
- [elpa] externals/ellama updated (b301ed87f5 -> 77d614fd44), ELPA Syncer, 2024/01/19
- [elpa] externals/ellama 6a426dd913 2/8: Programmatically translate code blocks from markdown to org-mode, ELPA Syncer, 2024/01/19
- [elpa] externals/ellama dec7ebdf5e 3/8: Improve org processing, ELPA Syncer, 2024/01/19
- [elpa] externals/ellama f6337ebb79 6/8: Add ellama-long-lines-length custom variable, ELPA Syncer, 2024/01/19
- [elpa] externals/ellama 466f16f425 7/8: Update documentation, ELPA Syncer, 2024/01/19
- [elpa] externals/ellama 8bab25150a 1/8: Use org-mode by default for chat. Experimental, ELPA Syncer, 2024/01/19
- [elpa] externals/ellama 77d614fd44 8/8: Merge pull request #52 from s-kostyaev/org-experiment, ELPA Syncer, 2024/01/19
- [elpa] externals/ellama 1213032397 4/8: Use org-mode for ellama-instant, ELPA Syncer, 2024/01/19
- [elpa] externals/ellama 02bb628778 5/8: Fix bug wrong clearing session,
ELPA Syncer <=