branch: externals/ellama commit 2ed1c046fcaeb35b7a4d3716e4cfb486e9a6206c Author: Sergey Kostyaev <sskosty...@gmail.com> Commit: Sergey Kostyaev <sskosty...@gmail.com>
Add new function and update keybinding Added a new function `ellama-send-buffer-to-new-chat-then-kill` to send the current buffer to a new chat session and then kill it. Updated the keybinding in `ellama-blueprint-mode-map` to use this new function instead of the old one. Fix #245 --- ellama.el | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ellama.el b/ellama.el index efe245b215..f9c3eeb6af 100644 --- a/ellama.el +++ b/ellama.el @@ -1255,6 +1255,15 @@ the context." (buffer-substring-no-properties (point-min) (point-max)) t)) +;;;###autoload +(defun ellama-send-buffer-to-new-chat-then-kill () + "Send current buffer to new chat session. +Then kill current buffer." + (interactive) + (ellama-send-buffer-to-new-chat) + (ellama-kill-current-buffer)) + +;;;###autoload (defun ellama-kill-current-buffer () "Kill current buffer." (interactive) @@ -1263,7 +1272,7 @@ the context." (defvar-keymap ellama-blueprint-mode-map :doc "Local keymap for Ellama blueprint mode buffers." :parent global-map - "C-c C-c" #'ellama-send-buffer-to-new-chat + "C-c C-c" #'ellama-send-buffer-to-new-chat-then-kill "C-c C-k" #'ellama-kill-current-buffer) ;;;###autoload @@ -1275,7 +1284,7 @@ the context." :group 'ellama (setq header-line-format (substitute-command-keys - "`\\[ellama-send-buffer-to-new-chat]' to send `\\[ellama-kill-current-buffer]' to cancel"))) + "`\\[ellama-send-buffer-to-new-chat-then-kill]' to send `\\[ellama-kill-current-buffer]' to cancel"))) (defun ellama-update-context-buffer () "Update ellama context buffer."