@@ -544,22 +544,28 @@ LOCATION is the location at which to insert.
544
544
COMMENT-PREFIX is the comment prefix for the first line of output.
545
545
CONTINUED-PREFIX is the comment prefix to use for the remaining lines.
546
546
COMMENT-POSTFIX is the text to output after the last line."
547
- (cl-flet ((multiline-comment-handler (buffer value)
548
- (with-current-buffer buffer
549
- (save-excursion
550
- (goto-char location)
551
- (let ((lines (split-string value " [\n ]+" t )))
552
- ; ; only the first line gets the normal comment-prefix
553
- (insert (concat comment-prefix (pop lines)))
554
- (dolist (elem lines)
555
- (insert (concat " \n " continued-prefix elem)))
556
- (unless (string= comment-postfix " " )
557
- (insert comment-postfix)))))))
558
- (nrepl-make-response-handler buffer
559
- '()
560
- #'multiline-comment-handler
561
- #'multiline-comment-handler
562
- '())))
547
+ (let ((res " " ))
548
+ (nrepl-make-response-handler
549
+ buffer
550
+ (lambda (_buffer value )
551
+ (setq res (concat res value)))
552
+ nil
553
+ nil
554
+ (lambda (buffer )
555
+ (with-current-buffer buffer
556
+ (save-excursion
557
+ (goto-char location)
558
+ (let ((lines (split-string res " [\n ]+" t )))
559
+ ; ; only the first line gets the normal comment-prefix
560
+ (insert (concat comment-prefix (pop lines)))
561
+ (dolist (elem lines)
562
+ (insert (concat " \n " continued-prefix elem)))
563
+ (unless (string= comment-postfix " " )
564
+ (insert comment-postfix))))))
565
+ nil
566
+ nil
567
+ (lambda (_buffer warning )
568
+ (setq res (concat res warning ))))))
563
569
564
570
(defun cider-popup-eval-handler (&optional buffer )
565
571
" Make a handler for printing evaluation results in popup BUFFER.
0 commit comments