branch: externals/ellama
commit c696e3cefcd420836d8d17de7b1131d64737ccb9
Merge: a931224a0d 2e8e7c9adc
Author: Sergey Kostyaev <s-kosty...@users.noreply.github.com>
Commit: GitHub <nore...@github.com>

    Merge pull request #106 from alarawms/main
    
    added function to summrize text in the killring-0.
---
 ellama.el | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/ellama.el b/ellama.el
index 51b14cf4cd..718298b300 100644
--- a/ellama.el
+++ b/ellama.el
@@ -110,6 +110,7 @@
     ;; summarize
     (define-key map (kbd "s s") 'ellama-summarize)
     (define-key map (kbd "s w") 'ellama-summarize-webpage)
+    (define-key map (kbd "s c") 'ellama-summarize-killring)
     ;; session
     (define-key map (kbd "s l") 'ellama-load-session)
     (define-key map (kbd "s r") 'ellama-session-rename)
@@ -1262,6 +1263,15 @@ ARGS contains keys for fine control.
                (buffer-substring-no-properties (point-min) (point-max)))))
     (ellama-instant (format ellama-summarize-prompt-template text))))
 
+;;;###autoload
+(defun ellama-summarize-killring ()
+  "Summarize text from the kill ring."
+  (interactive)
+  (let ((text (current-kill 0)))
+    (if (string-empty-p text)
+        (message "No text in the kill ring to summarize.")
+      (ellama-instant (format ellama-summarize-prompt-template text)))))
+
 ;;;###autoload
 (defun ellama-code-review ()
   "Review code in selected region or current buffer."

Reply via email to