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

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

[nongnu] elpa/slime 9be8de1faa: Print large repl results in chunks.


From: ELPA Syncer
Subject: [nongnu] elpa/slime 9be8de1faa: Print large repl results in chunks.
Date: Thu, 21 Nov 2024 13:00:55 -0500 (EST)

branch: elpa/slime
commit 9be8de1faac578407cbaebf4e17ecfb30867673e
Author: Stas Boukarev <stassats@gmail.com>
Commit: Stas Boukarev <stassats@gmail.com>

    Print large repl results in chunks.
    
    Makes it interruptible. Allows sending strings larger than
    (UNSIGNED-BYTE 24) encodable by swank/rpc.
---
 contrib/swank-presentations.lisp | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/contrib/swank-presentations.lisp b/contrib/swank-presentations.lisp
index 6913762f25..3d692c6f13 100644
--- a/contrib/swank-presentations.lisp
+++ b/contrib/swank-presentations.lisp
@@ -104,11 +104,16 @@ The secondary value indicates the absence of an entry."
            (let ((id (and *record-repl-results*
                           (save-presented-object value))))
             (send-to-emacs `(:presentation-start ,id :repl-result))
-            (send-to-emacs `(:write-string ,(prin1-to-string value)
-                                           :repl-result))
+             (let ((string (prin1-to-string value)))
+               (if (> (length string) 10000)
+                   (loop for i below (length string) by 10000
+                         do (send-to-emacs `(:write-string ,(subseq string i 
(min (length string)
+                                                                               
   (+ i 10000))) 
+                                             :repl-result)))
+                  (send-to-emacs `(:write-string ,string :repl-result))))
             (send-to-emacs `(:presentation-end ,id :repl-result))
             (send-to-emacs `(:write-string ,(string #\Newline)
-                                           :repl-result)))))
+                             :repl-result)))))
     (fresh-line)
     (really-finish-output *standard-output*)
     (if (null values)



reply via email to

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