branch: externals/ellama
commit 6904cdc47b8bdba099663a96fb1a76fbf923da5a
Author: Sergey Kostyaev <sskosty...@gmail.com>
Commit: Sergey Kostyaev <sskosty...@gmail.com>

    Simplify marker creation in ellama.el
    
    Refactored the marker creation logic to use `copy-marker` for both 
`beg-marker`
    and `end-marker`, reducing redundancy and improving readability.
---
 ellama.el | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/ellama.el b/ellama.el
index dff74191a3..8028f80797 100644
--- a/ellama.el
+++ b/ellama.el
@@ -1206,14 +1206,10 @@ FILTER is a function for text transformation."
   (declare-function org-fill-paragraph "org")
   (with-current-buffer
       buffer
-    (let* ((beg-marker (make-marker))
-          (end-marker (make-marker))
+    (let* ((end-marker (copy-marker (or point (point)) t))
+           (beg-marker (copy-marker end-marker nil))
           (previous-filtered-text "")
           (safe-common-prefix ""))
-      (set-marker end-marker (or point (point)))
-      (set-marker beg-marker end-marker)
-      (set-marker-insertion-type end-marker t)
-      (set-marker-insertion-type beg-marker nil)
       (lambda
        (text)
        (with-current-buffer buffer

Reply via email to