From: Andrea Corallo Date: Sun, 8 Sep 2019 17:56:37 +0000 (+0200) Subject: fix pretty printing in native compilation buffer X-Git-Tag: emacs-28.0.90~2727^2~1194 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5adfe6520b5a3ff2e3bacc603487c4f12e54dfc7;p=emacs.git fix pretty printing in native compilation buffer --- diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 702e10df8d9..4f407eabc05 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -203,6 +203,7 @@ BODY is evaluate only if `comp-debug' is non nil." (goto-char (point-max)) ,@body)))) + (defun comp-log (string) "Log a STRING into the log-buffer." (comp-within-log-buff @@ -211,6 +212,12 @@ BODY is evaluate only if `comp-debug' is non nil." (t (insert (format "%s\n" string)))))) +(defun comp-prettyprint (data) + "Nicely print DATA in the current buffer." + (mapc (lambda (x) + (insert (prin1-to-string x) "\n")) + data)) + (defun comp-log-func (func) "Pretty print function FUNC in the log-buffer." (comp-within-log-buff @@ -219,7 +226,7 @@ BODY is evaluate only if `comp-debug' is non nil." using (hash-value bb) do (progn (insert (concat "\n<" (symbol-name block-name) ">")) - (cl-prettyprint (comp-block-insns bb)))))) + (comp-prettyprint (comp-block-insns bb)))))) ;;; spill-lap pass specific code. @@ -270,7 +277,7 @@ Put PREFIX in front of it." (setf (comp-func-byte-func func) (byte-compile (comp-func-symbol-name func))) (comp-within-log-buff - (cl-prettyprint byte-to-native-last-lap)) + (comp-prettyprint byte-to-native-last-lap)) (let ((lambda-list (aref (comp-func-byte-func func) 0))) (setf (comp-func-args func) (comp-decrypt-lambda-list lambda-list))) @@ -298,7 +305,7 @@ Put PREFIX in front of it." :lap lap :frame-size (aref bytecode 3)) do (comp-within-log-buff - (cl-prettyprint lap)) + (comp-prettyprint lap)) collect func)) (defun comp-spill-lap (input)