Function: backtrace--print-locals

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

Signature

(backtrace--print-locals FRAME VIEW)

Documentation

Print a backtrace FRAME's local variables according to VIEW.

Print them only if :show-locals is non-nil in the VIEW plist.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/backtrace.el.gz
(defun backtrace--print-locals (frame view)
  "Print a backtrace FRAME's local variables according to VIEW.
Print them only if :show-locals is non-nil in the VIEW plist."
  (when (plist-get view :show-locals)
    (let* ((beg (point))
           (locals (backtrace-frame-locals frame)))
      (if (null locals)
	  (insert "    [no locals]\n")
        (pcase-dolist (`(,symbol . ,value) locals)
          (insert "    ")
          (backtrace--print symbol)
	  (insert " = ")
          (insert (backtrace--print-to-string value))
          (insert "\n")))
      (put-text-property beg (point) 'backtrace-section 'locals))))