emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ellama 1213032397 4/8: Use org-mode for ellama-instant


From: ELPA Syncer
Subject: [elpa] externals/ellama 1213032397 4/8: Use org-mode for ellama-instant
Date: Fri, 19 Jan 2024 18:58:00 -0500 (EST)

branch: externals/ellama
commit 1213032397a86d511fe769546bb843c07aa023ba
Author: Sergey Kostyaev <sskostyaev@gmail.com>
Commit: Sergey Kostyaev <sskostyaev@gmail.com>

    Use org-mode for ellama-instant
---
 ellama.el | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/ellama.el b/ellama.el
index a6571cc21a..5f20aaa46c 100644
--- a/ellama.el
+++ b/ellama.el
@@ -254,6 +254,11 @@ It should be a function with single argument generated 
text string."
   :group 'ellama
   :type 'function)
 
+(defcustom ellama-instant-mode 'org-mode
+  "Major mode for ellama instant commands."
+  :group 'ellama
+  :type 'symbol)
+
 (defvar-local ellama--change-group nil)
 
 (defvar-local ellama--current-request nil)
@@ -711,9 +716,15 @@ If CREATE-SESSION set, creates new session even if there 
is an active session."
   (let* ((buffer-name (ellama-generate-name ellama-provider real-this-command 
prompt))
         (buffer (get-buffer-create (if (get-buffer buffer-name)
                                        (make-temp-name (concat buffer-name " 
"))
-                                     buffer-name))))
+                                     buffer-name)))
+        (filter (when (equal ellama-instant-mode 'org-mode)
+                  'ellama--translate-markdown-to-org-filter)))
+    (with-current-buffer buffer
+      (funcall ellama-instant-mode))
     (display-buffer buffer)
-    (ellama-stream prompt :buffer buffer (point-min))))
+    (ellama-stream prompt
+                  :buffer buffer
+                  :filter filter)))
 
 ;;;###autoload
 (defun ellama-translate ()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]