branch: externals/ellama commit 25911f9687a84793f26ad7fc13b6defd7c7ba860 Author: Sergey Kostyaev <sskosty...@gmail.com> Commit: Sergey Kostyaev <sskosty...@gmail.com>
Add kill current buffer function Added a new function `ellama-kill-current-buffer` and updated the keymap in `ellama-blueprint-mode-map` to use this function instead of an anonymous lambda. Also, updated the header line format to display the correct command names using `substitute-command-keys`. --- ellama.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ellama.el b/ellama.el index 39a369856f..efe245b215 100644 --- a/ellama.el +++ b/ellama.el @@ -1255,11 +1255,16 @@ the context." (buffer-substring-no-properties (point-min) (point-max)) t)) +(defun ellama-kill-current-buffer () + "Kill current buffer." + (interactive) + (kill-buffer (current-buffer))) + (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-k" (lambda () (interactive) (kill-buffer (current-buffer)))) + "C-c C-k" #'ellama-kill-current-buffer) ;;;###autoload (define-derived-mode ellama-blueprint-mode @@ -1269,7 +1274,8 @@ the context." :keymap ellama-blueprint-mode-map :group 'ellama (setq header-line-format - "'C-c C-c' to send 'C-c C-k' to cancel")) + (substitute-command-keys + "`\\[ellama-send-buffer-to-new-chat]' to send `\\[ellama-kill-current-buffer]' to cancel"))) (defun ellama-update-context-buffer () "Update ellama context buffer."