Skip to content

Commit

Permalink
Move inravina client
Browse files Browse the repository at this point in the history
  • Loading branch information
yitzchak committed Jan 20, 2023
1 parent f1126fa commit 03ec54a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
24 changes: 6 additions & 18 deletions src/lisp/kernel/lsp/format-pprint.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,6 @@

(in-package "SYS")

;;; The guts of print-unreadable-object, inspired by SBCL. This is
;;; a redefinition of the function in iolib.lisp which add support
;;; for pprint-logical-block.
(defun %print-unreadable-object (object stream type identity body)
(cond (*print-readably*
(error 'print-not-readable :object object))
((and *print-pretty* (inravina:pretty-stream-p inravina:*client* stream))
(pprint-logical-block (stream nil :prefix "#<" :suffix ">")
(print-unreadable-object-contents object stream type identity body)))
(t
(write-string "#<" stream)
(print-unreadable-object-contents object stream type identity body)
(write-char #\> stream)))
nil)

;;;; Format directive definition macros and runtime support.

(defmacro expander-pprint-next-arg (string offset)
Expand Down Expand Up @@ -84,7 +69,7 @@
(write-string spaces stream :end n)))

(defun format-relative-tab (stream colrel colinc)
(if (inravina:pretty-stream-p inravina:*client* stream)
(if (inravina:pretty-stream-p inravina-intrinsic:*client* stream)
(pprint-tab :line-relative colrel colinc stream)
(let* ((cur (#-(or ecl clasp) sys::charpos #+(or ecl clasp) sys::file-column stream))
(spaces (if (and cur (plusp colinc))
Expand All @@ -93,7 +78,7 @@
(output-spaces stream spaces))))

(defun format-absolute-tab (stream colnum colinc)
(if (inravina:pretty-stream-p inravina:*client* stream)
(if (inravina:pretty-stream-p inravina-intrinsic:*client* stream)
(pprint-tab :line colnum colinc stream)
(let ((cur (#-(or ecl clasp) sys::charpos #+(or ecl clasp) sys:file-column stream)))
(cond ((null cur)
Expand Down Expand Up @@ -483,7 +468,10 @@
(error 'format-error
:complaint "No corresponding open bracket."))

(setf inravina:*client* (make-instance 'incless-native:native-client)
(defclass printer-client (incless-native:native-client inravina-intrinsic:intrinsic-client)
())

(setf inravina-intrinsic:*client* (make-instance 'printer-client)
(first (cdr si::+io-syntax-progv-list+)) inravina-intrinsic:*standard-pprint-dispatch*)


2 changes: 1 addition & 1 deletion src/lisp/kernel/lsp/pprint.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
(defun %print-unreadable-object (object stream type identity body)
(cond (*print-readably*
(error 'print-not-readable :object object))
((and *print-pretty* (inravina:pretty-stream-p inravina:*client* stream))
((and *print-pretty* (inravina:pretty-stream-p inravina-intrinsic:*client* stream))
(pprint-logical-block (stream nil :prefix "#<" :suffix ">")
(print-unreadable-object-contents object stream type identity body)))
(t
Expand Down

0 comments on commit 03ec54a

Please sign in to comment.