branch: externals/ellama commit e1bd9ecfc6495bc235efa8d70350edf705c80648 Author: Sergey Kostyaev <sskosty...@gmail.com> Commit: Sergey Kostyaev <sskosty...@gmail.com>
Fix buffer name handling in context addition Ensure that the buffer name is correctly extracted and used when adding a buffer to the context. The code now checks if `buf` is a string and uses it directly, otherwise, it retrieves the buffer name using `buffer-name`. --- ellama.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ellama.el b/ellama.el index 67edcd5d27..ad55f7349d 100644 --- a/ellama.el +++ b/ellama.el @@ -1302,7 +1302,10 @@ If EPHEMERAL non nil new session will not be associated with any file." (defun ellama-context-add-buffer (buf) "Add BUF to context." (interactive "bSelect buffer: ") - (let ((element (ellama-context-element-buffer :name buf))) + (let* ((buffer-name (if (stringp buf) + buf + (buffer-name buf))) + (element (ellama-context-element-buffer :name buffer-name))) (ellama-context-element-add element))) ;;;###autoload