Function: zone--prepare-frames

zone--prepare-frames is a byte-compiled function defined in zone.el.gz.

Signature

(zone--prepare-frames PRIM-FRM)

Documentation

Reorganize frames and their windows to show the zone out.

This is based on the settings of three customization flags:
+ zone-all-frames,
+ zone-all-windows-in-frame, and
+ zone-delete-other-windows

These have been partially performed on the primary frame PRIM-FRM. Based on the settings, the other frames may be similarly adjusted.

Source Code

;; Defined in /usr/src/emacs/lisp/play/zone.el.gz
;;;; Configure frames and windows based on customization flags

(defun zone--prepare-frames (prim-frm)
  "Reorganize frames and their windows to show the zone out.
This is based on the settings of three customization flags:
+ `zone-all-frames',
+ `zone-all-windows-in-frame', and
+ `zone-delete-other-windows'

These have been partially performed on the primary frame PRIM-FRM.
Based on the settings, the other frames may be similarly adjusted."
  (let* ((z (get-buffer zone-buffer-name))
         (prim-win (frame-selected-window prim-frm))
         (f prim-frm)
         (no-cursor '((cursor-type . (bar . 0))))
         w1)
    ;; Handle the primary frame
    (select-frame f t)
    (setq w1 (frame-selected-window f))
    ;; Put zone in current or every window
    (dolist (w (if zone-all-windows-in-frame
                   (window-list f 'no-minibuf w1)
                 (list w1)))
      (set-window-buffer w z nil))
    (modify-frame-parameters f no-cursor)
    ;; Handle the remaining frames
    (dolist (f (visible-frame-list))
      (unless (eq f prim-frm)
        (select-frame f t)
        (setq w1 (frame-selected-window f))
        ;; Single window frame
        (when zone-delete-other-windows
          (delete-other-windows))
        ;; Put zone in current or every window
        (dolist (w (if zone-all-windows-in-frame
                       (window-list f 'no-minibuf w1)
                     (list w1)))
          (set-window-buffer w z nil))
        (modify-frame-parameters f no-cursor)
        (set-frame-selected-window f w1 t)))
    (select-frame prim-frm)
    (set-frame-selected-window prim-frm prim-win t)))