branch: externals/ellama commit 8128ca3e6d4003765140ac70bc94ae71f9ae6b7a Author: Sergey Kostyaev <sskosty...@gmail.com> Commit: Sergey Kostyaev <sskosty...@gmail.com>
Fix buffer management Fixed buffer management by explicitly passing the current buffer to `kill-buffer` in several places. This ensures that the correct buffer is killed, preventing potential issues with unintended buffer closure. --- ellama.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ellama.el b/ellama.el index 6e8a6321ac..f47d556207 100644 --- a/ellama.el +++ b/ellama.el @@ -629,7 +629,7 @@ Skip code blocks and math environments." (ellama--apply-transformations prev-point (point-max))) (prog1 (buffer-substring-no-properties (point-min) (point-max)) - (kill-buffer)))) + (kill-buffer (current-buffer))))) (defun ellama--translate-markdown-to-org-filter (text) "Filter to translate code blocks from markdown syntax to org syntax in TEXT. @@ -1944,7 +1944,7 @@ Extract profession from this message. Be short and concise." (with-current-buffer buf (prog1 (string-trim (buffer-substring-no-properties (point-min) (point-max))) - (kill-buffer))))) + (kill-buffer buf))))) (defun ellama-get-last-user-message () "Return last not sent user message in current session buffer."