[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ellama 84501ea9ea 3/7: Split into a session and instant
From: |
ELPA Syncer |
Subject: |
[elpa] externals/ellama 84501ea9ea 3/7: Split into a session and instant mode. |
Date: |
Sat, 3 Feb 2024 15:57:52 -0500 (EST) |
branch: externals/ellama
commit 84501ea9ea9180f03a66309e1cbfe07618f351a7
Author: Steven Allen <steven@stebalien.com>
Commit: Steven Allen <steven@stebalien.com>
Split into a session and instant mode.
---
ellama.el | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/ellama.el b/ellama.el
index 104655e625..58502910f3 100644
--- a/ellama.el
+++ b/ellama.el
@@ -277,14 +277,20 @@ Too low value can break generated code by splitting long
comment lines."
(if ellama-session-mode
(progn
(add-hook 'after-save-hook 'ellama--save-session nil t)
- (add-hook 'kill-buffer-hook 'ellama--cancel-current-request nil t)
(add-hook 'kill-buffer-hook 'ellama--session-deactivate nil t))
- (remove-hook 'kill-buffer-hook 'ellama--cancel-current-request)
(remove-hook 'kill-buffer-hook 'ellama--session-deactivate)
(remove-hook 'after-save-hook 'ellama--save-session)
- (ellama--cancel-current-request)
(ellama--session-deactivate)))
+(define-minor-mode ellama-instant-mode
+ "Minor mode for ellama instant buffers."
+ :interactive nil
+ :keymap '(([remap keyboard-quit] . ellama--cancel-current-request-and-quit))
+ (if ellama-instant-mode
+ (add-hook 'kill-buffer-hook 'ellama--cancel-current-request nil t)
+ (remove-hook 'kill-buffer-hook 'ellama--cancel-current-request)
+ (ellama--cancel-current-request)))
+
(defvar-local ellama--change-group nil)
(defvar-local ellama--current-request nil)
@@ -466,6 +472,7 @@ If EPHEMERAL non nil new session will not be associated
with any file."
(defun ellama--session-deactivate ()
"Deactivate current session."
+ (ellama--cancel-current-request)
(when-let* ((session ellama--current-session)
(id (ellama-session-id session)))
(when (string= (buffer-name)
@@ -783,7 +790,7 @@ If CREATE-SESSION set, creates new session even if there is
an active session."
'ellama--translate-markdown-to-org-filter)))
(with-current-buffer buffer
(funcall ellama-major-mode)
- (ellama-session-mode +1))
+ (ellama-instant-mode +1))
(display-buffer buffer)
(ellama-stream prompt
:buffer buffer
- [elpa] externals/ellama updated (37060832a7 -> e745ec1fb8), ELPA Syncer, 2024/02/03
- [elpa] externals/ellama 5d312b88b8 5/7: Bump version, ELPA Syncer, 2024/02/03
- [elpa] externals/ellama 84501ea9ea 3/7: Split into a session and instant mode.,
ELPA Syncer <=
- [elpa] externals/ellama 55085881e7 1/7: Remove advice and introduce a session-mode, ELPA Syncer, 2024/02/03
- [elpa] externals/ellama 8c72c680da 2/7: fix: remove save session hook as well, ELPA Syncer, 2024/02/03
- [elpa] externals/ellama a8ac8adb80 6/7: Improve CI pipeline, ELPA Syncer, 2024/02/03
- [elpa] externals/ellama 092bce2954 4/7: Merge pull request #62 from Stebalien/steb/remove-advice, ELPA Syncer, 2024/02/03
- [elpa] externals/ellama e745ec1fb8 7/7: Merge pull request #66 from s-kostyaev/update-ci, ELPA Syncer, 2024/02/03