Function: backtrace--print-to-string

backtrace--print-to-string is a byte-compiled function defined in backtrace.el.gz.

Signature

(backtrace--print-to-string SEXP &optional LIMIT)

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/backtrace.el.gz
(defun backtrace--print-to-string (sexp &optional limit)
  ;; This is for use by callers who wrap the call with
  ;; backtrace--with-output-variables.
  (setq limit (or limit backtrace-line-length))
  (with-temp-buffer
    (insert (cl-print-to-string-with-limit #'backtrace--print sexp limit))
    ;; Add a unique backtrace-form property.
    (put-text-property (point-min) (point) 'backtrace-form (gensym))
    ;; Make buttons from all the "..."s.  Since there might be many of
    ;; them, use text property buttons.
    (goto-char (point-min))
    (while (< (point) (point-max))
      (let ((end (next-single-property-change (point) 'cl-print-ellipsis
                                              nil (point-max))))
        (when (get-text-property (point) 'cl-print-ellipsis)
          (make-text-button (point) end :type 'backtrace-ellipsis))
        (goto-char end)))
    (buffer-string)))