(defcustom window-min-height 4
"The minimum number of lines of any window.
-The value has to accomodate a mode- or header-line if present. A
-value less than `window-safe-min-height' is ignored. The value
+The value has to accommodate a mode- or header-line if present.
+A value less than `window-safe-min-height' is ignored. The value
of this variable is honored when windows are resized or split.
Applications should never rebind this variable. To resize a
(balance-windows-2 window horizontal)
(let ((size (window-new-total window)))
(while sub
- (set-window-new-total sub size)
+ (set-window-new-total sub size)
(balance-windows-1 sub horizontal)
(setq sub (window-right sub))))))))
(window-list-no-nils
type
(unless (window-next-sibling window) (cons 'last t))
- (cons 'clone-number (window-clone-number window))
(cons 'total-height (window-total-size window))
(cons 'total-width (window-total-size window t))
(cons 'normal-height (window-normal-size window))
(unless (memq (car parameter)
window-state-ignored-parameters)
(setq list (cons parameter list))))
+ (unless (window-parameter window 'clone-of)
+ ;; Make a clone-of parameter.
+ (setq list (cons (cons 'clone-of window) list)))
(when list
(cons 'parameters list)))
(when buffer
"Helper function for `window-state-put'."
(dolist (item window-state-put-list)
(let ((window (car item))
- (clone-number (cdr (assq 'clone-number item)))
(splits (cdr (assq 'splits item)))
(nest (cdr (assq 'nest item)))
(parameters (cdr (assq 'parameters item)))
(state (cdr (assq 'buffer item))))
- ;; Put in clone-number.
- (when clone-number (set-window-clone-number window clone-number))
(when splits (set-window-splits window splits))
(when nest (set-window-nest window nest))
;; Process parameters.
function specified in the second element of the list is
responsible for displaying the buffer. `display-buffer' calls
this function with the buffer as first argument and the remaining
-elements of the list as the other arguments.
+elements of the list as the second.
The function should choose or create a window, display the buffer
in it, and return the window. It is also responsible for giving
(setq window
(cond
((eq cand 'largest)
- ;; The largest window.
+ ;; The largest window.
(get-largest-window frame t))
((eq cand 'lru)
;; The least recently used window.
(display-buffer-reuse-window
buffer '(nil nil t) '((reuse-window-dedicated . t)))))))
-(defsubst display-buffer-same-window (&optional buffer-or-name label)
+(defsubst display-buffer-same-window (&optional buffer-or-name label)
"Display buffer specified by BUFFER-OR-NAME in the selected window.
Another window will be used only if the buffer can't be shown in
the selected window, usually because it is dedicated to another
(interactive "BDisplay buffer in same window:\nP")
(display-buffer buffer-or-name 'same-window label))
-(defsubst display-buffer-same-frame (&optional buffer-or-name label)
+(defsubst display-buffer-same-frame (&optional buffer-or-name label)
"Display buffer specified by BUFFER-OR-NAME in a window on the same frame.
Another frame will be used only if there is no other choice.
Optional argument BUFFER-OR-NAME and LABEL are as for
(interactive "BDisplay buffer on same frame:\nP")
(display-buffer buffer-or-name 'same-frame label))
-(defsubst display-buffer-other-window (&optional buffer-or-name label)
+(defsubst display-buffer-other-window (&optional buffer-or-name label)
"Display buffer specified by BUFFER-OR-NAME in another window.
The selected window will be used only if there is no other
choice. Windows on the selected frame are preferred to windows
(interactive "BDisplay buffer in another window:\nP")
(display-buffer buffer-or-name 'other-window label))
-(defun display-buffer-same-frame-other-window (&optional buffer-or-name label)
+(defun display-buffer-same-frame-other-window (&optional buffer-or-name label)
"Display buffer specified by BUFFER-OR-NAME in another window on the same frame.
The selected window or another frame will be used only if there
is no other choice. Optional argument BUFFER-OR-NAME and LABEL are
(interactive "BPop to buffer in selected window:\nP")
(pop-to-buffer buffer-or-name 'same-window norecord label))
-(defsubst pop-to-buffer-same-frame (&optional buffer-or-name norecord label)
+(defsubst pop-to-buffer-same-frame (&optional buffer-or-name norecord label)
"Pop to buffer specified by BUFFER-OR-NAME in a window on the selected frame.
Another frame will be used only if there is no other choice.
Optional arguments BUFFER-OR-NAME, NORECORD and LABEL are as for
(interactive "BPop to buffer in another window:\nP")
(pop-to-buffer buffer-or-name 'other-window norecord))
-(defsubst pop-to-buffer-same-frame-other-window (&optional buffer-or-name norecord label)
+(defsubst pop-to-buffer-same-frame-other-window (&optional buffer-or-name norecord label)
"Pop to buffer specified by BUFFER-OR-NAME in another window on the selected frame.
The selected window or another frame will be used only if there
is no other choice. Optional arguments BUFFER-OR-NAME, NORECORD
If ARGS is a list whose car is a symbol, use (car ARGS) as a
function to do the work. Pass it BUFFER as first argument,
-and (cdr ARGS) as second."
+and (cdr ARGS) as the rest of the arguments."
(if (and args (symbolp (car args)))
(apply (car args) buffer (cdr args))
(let ((window (get-buffer-window buffer 0)))
;; window and the current buffer when we're done.
(setq window (window-normalize-live-window window))
;; Can't resize a full height or fixed-size window.
- (unless (or (window-size-fixed-p window)
+ (unless (or (window-size-fixed-p window)
(window-full-height-p window))
;; `with-selected-window' should orderly restore the current buffer.
(with-selected-window window