Function: window--dump-frame

window--dump-frame is a byte-compiled function defined in window.el.gz.

Signature

(window--dump-frame &optional WINDOW-OR-FRAME)

Documentation

Dump WINDOW-OR-FRAME to buffer *window-frame-dump*.

WINDOW-OR-FRAME can be a frame or a window and defaults to the selected frame. When WINDOW-OR-FRAME is a window, dump that window's frame. The buffer *window-frame-dump* is erased before dumping to it.

Source Code

;; Defined in /usr/src/emacs/lisp/window.el.gz
(defun window--dump-frame (&optional window-or-frame)
  "Dump WINDOW-OR-FRAME to buffer *window-frame-dump*.
WINDOW-OR-FRAME can be a frame or a window and defaults to the
selected frame.  When WINDOW-OR-FRAME is a window, dump that
window's frame.  The buffer *window-frame-dump* is erased before
dumping to it."
  (let* ((window
	  (cond
	   ((or (not window-or-frame)
		(frame-live-p window-or-frame))
	    (frame-root-window window-or-frame))
	   ((or (window-live-p window-or-frame)
		(window-child window-or-frame))
	    window-or-frame)
	   (t
	    (frame-root-window))))
	 (frame (window-frame window)))
    (with-current-buffer (get-buffer-create "*window-frame-dump*")
      (erase-buffer)
      (insert
       (format "frame pixel: %s x %s   cols/lines: %s x %s   units: %s x %s\n"
	       (frame-pixel-width frame) (frame-pixel-height frame)
	       (frame-total-cols frame) (frame-total-lines frame)
	       (frame-char-width frame) (frame-char-height frame))
       (format "frame text pixel: %s x %s   cols/lines: %s x %s\n"
	       (frame-text-width frame) (frame-text-height frame)
	       (frame-text-cols frame) (frame-text-lines frame))
       (format "tab: %s  tool: %s  scroll: %s/%s  fringe: %s  border: %s  right: %s  bottom: %s\n\n"
	       (if (fboundp 'tab-bar-height)
		   (tab-bar-height frame t)
		 "0")
	       (if (fboundp 'tool-bar-height)
		   (tool-bar-height frame t)
		 "0")
	       (frame-scroll-bar-width frame)
	       (frame-scroll-bar-height frame)
	       (frame-fringe-width frame)
	       (frame-border-width frame)
	       (frame-right-divider-width frame)
	       (frame-bottom-divider-width frame)))
      (walk-window-tree 'window--dump-window frame t t))))