diff --git a/emacs/.emacs.d/packages/llama/llama.el b/emacs/.emacs.d/packages/llama/llama.el index d08c41c..afd1fff 100644 --- a/emacs/.emacs.d/packages/llama/llama.el +++ b/emacs/.emacs.d/packages/llama/llama.el @@ -208,6 +208,7 @@ it has been inserted into the chat buffer." (defun llama-chat-follow-link () (interactive) (cond + ((button-at (point)) (push-button (point))) ((markdown-link-p) (markdown-follow-link-at-point)))) (defun llama-chat-context-action () @@ -305,7 +306,7 @@ NAME defaults to `llama-chat-default-name'." (if current-prefix-arg (read-string "Chat buffer: ") llama-chat-default-name))) - (let ((input (format "%s\n%s" (buffer-substring-no-properties start end) prompt))) + (let ((input (format "\n%s\n\n%s" (buffer-substring-no-properties start end) prompt))) (llama-send-string-to-chat (or name llama-chat-default-name) input) @@ -320,10 +321,16 @@ NAME defaults to `llama-chat-default-name'." (if current-prefix-arg (read-string "Chat buffer: ") llama-chat-default-name))) - (let ((input (format "%s\n%s" (buffer-substring-no-properties (point-min) (point-max)) prompt))) + (let* ((input (format "%s\n\n%s" (buffer-substring-no-properties (point-min) (point-max)) prompt)) + (buf (current-buffer)) + (button (buttonize + (format "" (current-buffer)) + (lambda (_) + (pop-to-buffer buf))))) (llama-send-string-to-chat (or name llama-chat-default-name) - input) + input + :user-visible-string (format "%s\n\n%s" button prompt)) (display-buffer (or name llama-chat-default-name)))) (defun llama-replace-in-region (start end prompt)