Function: edebug-trace-display

edebug-trace-display is a byte-compiled function defined in edebug.el.gz.

Signature

(edebug-trace-display BUF-NAME FMT &rest ARGS)

Documentation

In buffer BUF-NAME, display FMT and ARGS at the end and make it visible.

The buffer is created if it does not exist. You must include newlines in FMT to break lines, but one newline is appended.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/edebug.el.gz
;;; Trace display

(defun edebug-trace-display (buf-name fmt &rest args)
  "In buffer BUF-NAME, display FMT and ARGS at the end and make it visible.
The buffer is created if it does not exist.
You must include newlines in FMT to break lines, but one newline is appended."
  ;; e.g.
  ;; (edebug-trace-display "*trace-point*"
  ;;                       "saving: point = %s  window-start = %s"
  ;;                       (point) (window-start))
  (let* ((oldbuf (current-buffer))
	 (selected-window (selected-window))
	 (buffer (get-buffer-create buf-name))
	 buf-window)
    ;; (message "before pop-to-buffer") (sit-for 1)
    (edebug-pop-to-buffer buffer)
    (setq truncate-lines t)
    (setq buf-window (selected-window))
    (goto-char (point-max))
    (insert (apply #'edebug-format fmt args) "\n")
    ;; Make it visible.
    (vertical-motion (- 1 (window-height)))
    (set-window-start buf-window (point))
    (goto-char (point-max))
    ;; (set-window-point buf-window (point))
    ;; (sit-for 0)
    (bury-buffer buffer)
    (select-window selected-window)
    (set-buffer oldbuf))
  buf-name)