(or (window-buffer object) (window-child object))
t))
-;; The following four functions should probably go to subr.el.
-(defsubst normalize-live-buffer (buffer-or-name)
+(defsubst window-normalize-buffer (buffer-or-name)
"Return buffer specified by BUFFER-OR-NAME.
BUFFER-OR-NAME must be either a buffer or a string naming a live
buffer and defaults to the current buffer."
(t
(error "No such buffer %s" buffer-or-name))))
-(defsubst normalize-live-frame (frame)
+(defsubst window-normalize-frame (frame)
"Return frame specified by FRAME.
FRAME must be a live frame and defaults to the selected frame."
(if frame
(error "%s is not a live frame" frame))
(selected-frame)))
-(defsubst normalize-any-window (window)
+(defsubst window-normalize-any-window (window)
"Return window specified by WINDOW.
WINDOW must be a window that has not been deleted and defaults to
the selected window."
(error "%s is not a window" window))
(selected-window)))
-(defsubst normalize-live-window (window)
+(defsubst window-normalize-live-window (window)
"Return live window specified by WINDOW.
WINDOW must be a live window and defaults to the selected one."
(if window
(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
WINDOW can be any window and defaults to the selected one.
Optional argument HORIZONTAL non-nil means return WINDOW's first
child if WINDOW is a horizontal combination."
- (setq window (normalize-any-window window))
+ (setq window (window-normalize-any-window window))
(if horizontal
(window-left-child window)
(window-top-child window)))
WINDOW can be any window and defaults to the selected one.
Optional argument HORIZONTAL non-nil means return non-nil if and
only if WINDOW is horizontally combined."
- (setq window (normalize-any-window window))
+ (setq window (window-normalize-any-window window))
(let ((parent (window-parent window)))
(and parent (window-iso-combination-p parent horizontal))))
WINDOW can be any window and defaults to the selected one.
Optional argument HORIZONTAL non-nil means to return the largest
number of horizontally arranged subwindows of WINDOW."
- (setq window (normalize-any-window window))
+ (setq window (window-normalize-any-window window))
(cond
((window-live-p window)
;; If WINDOW is live, return 1.
This function performs a pre-order, depth-first traversal of the
window tree. If PROC changes the window tree, the result is
unpredictable."
- (let ((walk-window-tree-frame (normalize-live-frame frame)))
+ (let ((walk-window-tree-frame (window-normalize-frame frame)))
(walk-window-tree-1
proc (frame-root-window walk-window-tree-frame) any)))
This function performs a pre-order, depth-first traversal of the
window tree rooted at WINDOW. If PROC changes that window tree,
the result is unpredictable."
- (setq window (normalize-any-window window))
+ (setq window (window-normalize-any-window window))
(walk-window-tree-1 proc window any t))
(defun windows-with-parameter (parameter &optional value frame any values)
"Return root of atomic window WINDOW is a part of.
WINDOW can be any window and defaults to the selected one.
Return nil if WINDOW is not part of a atomic window."
- (setq window (normalize-any-window window))
+ (setq window (window-normalize-any-window window))
(let (root)
(while (and window (window-parameter window 'window-atom))
(setq root window)
(setq window (window-parent window)))
root))
-(defun make-window-atom (window)
+(defun window-make-atom (window)
"Make WINDOW an atomic window.
WINDOW must be an internal window. Return WINDOW."
(if (not (window-child window))
`window-safe-min-width' columns. IGNORE a window means ignore
restrictions for that window only."
(window-min-size-1
- (normalize-any-window window) horizontal ignore))
+ (window-normalize-any-window window) horizontal ignore))
(defun window-min-size-1 (window horizontal ignore)
"Internal function of `window-min-size'."
windows may get as small as `window-safe-min-height' lines and
`window-safe-min-width' columns. IGNORE any window means ignore
restrictions for that window only."
- (setq window (normalize-any-window window))
+ (setq window (window-normalize-any-window window))
(cond
((< delta 0)
(max (- (window-min-size window horizontal ignore)
"Return t if WINDOW can be resized by DELTA lines.
For the meaning of the arguments of this function see the
doc-string of `window-sizable'."
- (setq window (normalize-any-window window))
+ (setq window (window-normalize-any-window window))
(if (> delta 0)
(>= (window-sizable window delta horizontal ignore) delta)
(<= (window-sizable window delta horizontal ignore) delta)))
WINDOW can be resized in the desired direction. The functions
`window-resizable' and `window-resizable-p' will tell that."
(window-size-fixed-1
- (normalize-any-window window) horizontal))
+ (window-normalize-any-window window) horizontal))
(defun window-min-delta-1 (window delta &optional horizontal ignore trail noup)
"Internal function for `window-min-delta'."
Optional argument NODOWN non-nil means don't check whether WINDOW
itself \(and its subwindows) can be shrunk; check only whether at
least one other windows can be enlarged appropriately."
- (setq window (normalize-any-window window))
+ (setq window (window-normalize-any-window window))
(let ((size (window-total-size window horizontal))
(minimum (window-min-size window horizontal ignore)))
(cond
Optional argument NODOWN non-nil means do not check whether
WINDOW itself \(and its subwindows) can be enlarged; check only
whether other windows can be shrunk appropriately."
- (setq window (normalize-any-window window))
+ (setq window (window-normalize-any-window window))
(if (and (not (window-size-ignore window ignore))
(not nodown) (window-size-fixed-p window horizontal))
;; With IGNORE and NOWDON nil return zero if WINDOW has fixed
Optional argument NODOWN non-nil means don't check whether WINDOW
and its subwindows can be resized."
- (setq window (normalize-any-window window))
+ (setq window (window-normalize-any-window window))
(cond
((< delta 0)
(max (- (window-min-delta window horizontal ignore trail noup nodown))
"Return t if WINDOW can be resized vertically by DELTA lines.
For the meaning of the arguments of this function see the
doc-string of `window-resizable'."
- (setq window (normalize-any-window window))
+ (setq window (window-normalize-any-window window))
(if (> delta 0)
(>= (window-resizable window delta horizontal ignore trail noup nodown)
delta)
WINDOW equals the total height of the root window of WINDOW's
frame. WINDOW can be any window and defaults to the selected
one."
- (setq window (normalize-any-window window))
+ (setq window (window-normalize-any-window window))
(= (window-total-size window)
(window-total-size (frame-root-window window))))
More precisely, return t if and only if the total width of WINDOW
equals the total width of the root window of WINDOW's frame.
WINDOW can be any window and defaults to the selected one."
- (setq window (normalize-any-window window))
+ (setq window (window-normalize-any-window window))
(= (window-total-size window t)
(window-total-size (frame-root-window window) t)))
Unlike `window-scroll-bars', this function reports the scroll bar
type actually used, once frame defaults and `scroll-bar-mode' are
taken into account."
- (setq window (normalize-live-window window))
+ (setq window (window-normalize-live-window window))
(let ((vert (nth 2 (window-scroll-bars window)))
(hor nil))
(when (or (eq vert t) (eq hor t))
WINDOW must be a live window and defaults to the selected one.
IGNORE, when non-nil means a window can be returned even if its
`no-other-window' parameter is non-nil."
- (setq window (normalize-live-window window))
+ (setq window (window-normalize-live-window window))
(unless (memq direction '(above below left right))
(error "Wrong direction %s" direction))
(let* ((frame (window-frame window))
Anything else means consider all windows on the selected frame
and no others."
- (let ((buffer (normalize-live-buffer buffer-or-name))
+ (let ((buffer (window-normalize-buffer buffer-or-name))
windows)
(dolist (window (window-list-1 (selected-window) minibuf all-frames))
(when (eq (window-buffer window) buffer)
(length (window-list-1 nil minibuf)))
\f
;;; Resizing windows.
-(defun window-resize-reset (&optional frame horizontal)
+(defun window--resize-reset (&optional frame horizontal)
"Reset resize values for all windows on FRAME.
FRAME defaults to the selected frame.
with argument HORIZONTAL in the new total size of all windows on
FRAME. It also resets the new normal size of each of these
windows."
- (window-resize-reset-1
- (frame-root-window (normalize-live-frame frame)) horizontal))
+ (window--resize-reset-1
+ (frame-root-window (window-normalize-frame frame)) horizontal))
-(defun window-resize-reset-1 (window horizontal)
- "Internal function of `window-resize-reset'."
+(defun window--resize-reset-1 (window horizontal)
+ "Internal function of `window--resize-reset'."
;; Register old size in the new total size.
(set-window-new-total window (window-total-size window horizontal))
;; Reset new normal size.
(set-window-new-normal window)
(when (window-child window)
- (window-resize-reset-1 (window-child window) horizontal))
+ (window--resize-reset-1 (window-child window) horizontal))
(when (window-right window)
- (window-resize-reset-1 (window-right window) horizontal)))
+ (window--resize-reset-1 (window-right window) horizontal)))
;; The following routine is used to manually resize the minibuffer
;; window and is currently used, for example, by ispell.el.
-(defun resize-mini-window (window delta)
+(defun window--resize-mini-window (window delta)
"Resize minibuffer window WINDOW by DELTA lines.
If WINDOW cannot be resized by DELTA lines make it as large \(or
as small) as possible but don't signal an error."
(setq delta min-delta)))
;; Resize now.
- (window-resize-reset frame)
+ (window--resize-reset frame)
;; Ideally we should be able to resize just the last subwindow of
;; root here. See the comment in `resize-root-window-vertically'
;; for why we do not do that.
- (resize-this-window root (- delta) nil nil t)
+ (window--resize-this-window root (- delta) nil nil t)
(set-window-new-total window (+ height delta))
;; The following routine catches the case where we want to resize
;; a minibuffer-only frame.
deletes any windows. If you want to move only the low (right)
edge of WINDOW consider using `adjust-window-trailing-edge'
instead."
- (setq window (normalize-any-window window))
+ (setq window (window-normalize-any-window window))
(let* ((frame (window-frame window))
sibling)
(cond
((eq window (frame-root-window frame))
(error "Cannot resize the root window of a frame"))
((window-minibuffer-p window)
- (resize-mini-window window delta))
+ (window--resize-mini-window window delta))
((window-resizable-p window delta horizontal ignore)
- (window-resize-reset frame horizontal)
- (resize-this-window window delta horizontal ignore t)
+ (window--resize-reset frame horizontal)
+ (window--resize-this-window window delta horizontal ignore t)
(if (and (not (window-splits window))
(window-iso-combined-p window horizontal)
(setq sibling (or (window-right window) (window-left window)))
(let ((normal-delta
(/ (float delta)
(window-total-size (window-parent window) horizontal))))
- (resize-this-window sibling (- delta) horizontal nil t)
+ (window--resize-this-window sibling (- delta) horizontal nil t)
(set-window-new-normal
window (+ (window-normal-size window horizontal)
normal-delta))
sibling (- (window-normal-size sibling horizontal)
normal-delta)))
;; Otherwise, resize all other windows in the same combination.
- (resize-other-windows window delta horizontal ignore))
+ (window--resize-siblings window delta horizontal ignore))
(window-resize-apply frame horizontal))
(t
(error "Cannot resize window %s" window)))))
-(defsubst resize-subwindows-skip-p (window)
+(defsubst window--resize-subwindows-skip-p (window)
"Return non-nil if WINDOW shall be skipped by resizing routines."
(memq (window-new-normal window) '(ignore stuck skip)))
-(defun resize-subwindows-normal (parent horizontal window this-delta &optional trail other-delta)
+(defun window--resize-subwindows-normal (parent horizontal window this-delta &optional trail other-delta)
"Set the new normal height of subwindows of window PARENT.
HORIZONTAL non-nil means set the new normal width of these
windows. WINDOW specifies a subwindow of PARENT that has been
;; Don't get larger than 1 or smaller than 0.
(min 1.0 (max (- 1.0 sum) 0.0))))))
-(defun resize-subwindows (parent delta &optional horizontal window ignore trail edge)
+(defun window--resize-subwindows (parent delta &optional horizontal window ignore trail edge)
"Resize subwindows of window PARENT vertically by DELTA lines.
PARENT must be a vertically combined internal window.
(setq sub first)
(while (and (window-right sub)
(or (and (eq trail 'before)
- (not (resize-subwindows-skip-p
+ (not (window--resize-subwindows-skip-p
(window-right sub))))
(and (eq trail 'after)
- (resize-subwindows-skip-p sub))))
+ (window--resize-subwindows-skip-p sub))))
(setq sub (window-right sub)))
sub)
(if horizontal
(window-sizable-p sub delta horizontal ignore))
;; Resize only windows adjacent to EDGE.
(progn
- (resize-this-window sub delta horizontal ignore t trail edge)
+ (window--resize-this-window
+ sub delta horizontal ignore t trail edge)
(if (and window (eq (window-parent sub) parent))
(progn
;; Assign new normal sizes.
window (- (window-normal-size window horizontal)
(- (window-new-normal sub)
(window-normal-size sub horizontal)))))
- (resize-subwindows-normal parent horizontal sub 0 trail delta))
- ;; Return 'normalized to notify `resize-other-windows' that
+ (window--resize-subwindows-normal
+ parent horizontal sub 0 trail delta))
+ ;; Return 'normalized to notify `window--resize-siblings' that
;; normal sizes have been already set.
'normalized)
;; Resize all windows proportionally.
(setq sub first)
(while sub
(cond
- ((or (resize-subwindows-skip-p sub)
+ ((or (window--resize-subwindows-skip-p sub)
;; Ignore windows to skip and fixed-size subwindows - in
;; the latter case make it a window to skip.
(and (not ignore)
(unless (and (zerop delta) (not trail))
;; For the TRAIL non-nil case we have to resize SUB
;; recursively even if it's size does not change.
- (resize-this-window
+ (window--resize-this-window
sub delta horizontal ignore nil trail edge))))
(setq sub (window-right sub)))))))
-(defun resize-other-windows (window delta &optional horizontal ignore trail edge)
+(defun window--resize-siblings (window delta &optional horizontal ignore trail edge)
"Resize other windows when WINDOW is resized vertically by DELTA lines.
Optional argument HORIZONTAL non-nil means resize other windows
when WINDOW is resized horizontally by DELTA columns. WINDOW
(if (zerop this-delta)
;; We haven't got anything from WINDOW's siblings but we
;; must update the normal sizes to respect other-delta.
- (resize-subwindows-normal
+ (window--resize-subwindows-normal
parent horizontal window this-delta trail other-delta)
;; We did get something from WINDOW's siblings which means
;; we have to resize their subwindows.
- (unless (eq (resize-subwindows parent (- this-delta) horizontal
- window ignore trail edge)
- ;; `resize-subwindows' returning 'normalized,
- ;; means it has set the normal sizes already.
+ (unless (eq (window--resize-subwindows
+ parent (- this-delta) horizontal
+ window ignore trail edge)
+ ;; If `window--resize-subwindows' returns
+ ;; 'normalized, this means it has set the
+ ;; normal sizes already.
'normalized)
;; Set the normal sizes.
- (resize-subwindows-normal
+ (window--resize-subwindows-normal
parent horizontal window this-delta trail other-delta))
;; Set DELTA to what we still have to get from ancestor
;; windows.
(set-window-new-total parent delta 'add)
(while sub
(unless (eq sub window)
- (resize-this-window sub delta horizontal ignore t))
+ (window--resize-this-window sub delta horizontal ignore t))
(setq sub (window-right sub))))
(unless (zerop delta)
;; "Go up."
- (resize-other-windows parent delta horizontal ignore trail edge)))))
+ (window--resize-siblings
+ parent delta horizontal ignore trail edge)))))
-(defun resize-this-window (window delta &optional horizontal ignore add trail edge)
+(defun window--resize-this-window (window delta &optional horizontal ignore add trail edge)
"Resize WINDOW vertically by DELTA lines.
Optional argument HORIZONTAL non-nil means resize WINDOW
horizontally by DELTA columns.
((window-iso-combined-p sub horizontal)
;; In an iso-combination resize subwindows according to their
;; normal sizes.
- (resize-subwindows window delta horizontal nil ignore trail edge))
+ (window--resize-subwindows
+ window delta horizontal nil ignore trail edge))
;; In an ortho-combination resize each subwindow by DELTA.
(t
(while sub
- (resize-this-window sub delta horizontal ignore t trail edge)
+ (window--resize-this-window
+ sub delta horizontal ignore t trail edge)
(setq sub (window-right sub)))))))
-(defun resize-root-window (window delta horizontal ignore)
+(defun window--resize-root-window (window delta horizontal ignore)
"Resize root window WINDOW vertically by DELTA lines.
HORIZONTAL non-nil means resize root window WINDOW horizontally
by DELTA columns.
resizes windows proportionally and never deletes any windows."
(when (and (windowp window) (numberp delta)
(window-sizable-p window delta horizontal ignore))
- (window-resize-reset (window-frame window) horizontal)
- (resize-this-window window delta horizontal ignore t)))
+ (window--resize-reset (window-frame window) horizontal)
+ (window--resize-this-window window delta horizontal ignore t)))
-(defun resize-root-window-vertically (window delta)
+(defun window--resize-root-window-vertically (window delta)
"Resize root window WINDOW vertically by DELTA lines.
If DELTA is less than zero and we can't shrink WINDOW by DELTA
lines, shrink it as much as possible. If DELTA is greater than
(unless (window-sizable window delta)
(setq ignore t))))
- (window-resize-reset (window-frame window))
+ (window--resize-reset (window-frame window))
;; Ideally, we would resize just the last window in a combination
;; but that's not feasible for the following reason: If we grow
;; the minibuffer window and the last window cannot be shrunk any
;; So, in practice, we'd need a history variable to record how to
;; proceed. But I'm not sure how such a variable could work with
;; repeated minibuffer window growing steps.
- (resize-this-window window delta nil ignore t)
+ (window--resize-this-window window delta nil ignore t)
delta)))
(defun adjust-window-trailing-edge (window delta &optional horizontal)
right. If DELTA is less than zero, move the edge upwards or to
the left. If the edge can't be moved by DELTA lines or columns,
move it as far as possible in the desired direction."
- (setq window (normalize-any-window window))
+ (setq window (window-normalize-any-window window))
(let ((frame (window-frame window))
(right window)
left this-delta min-delta max-delta failed)
(cond
((and (not right) (not horizontal) (not resize-mini-windows)
(eq (window-frame (minibuffer-window frame)) frame))
- (resize-mini-window (minibuffer-window frame) (- delta)))
+ (window--resize-mini-window (minibuffer-window frame) (- delta)))
((or (not (setq left right)) (not (setq right (window-right right))))
(if horizontal
(error "No window on the right of this one")
(setq delta (min max-delta (- min-delta))))
(unless (zerop delta)
;; Start resizing.
- (window-resize-reset frame horizontal)
+ (window--resize-reset frame horizontal)
;; Try to enlarge LEFT first.
(setq this-delta (window-resizable left delta horizontal))
(unless (zerop this-delta)
- (resize-this-window
+ (window--resize-this-window
left this-delta horizontal nil t 'before
(if horizontal
(+ (window-left-column left) (window-total-size left t))
(+ (window-top-line left) (window-total-size left)))))
;; Shrink windows on right of LEFT.
- (resize-other-windows
+ (window--resize-siblings
left delta horizontal nil 'after
(if horizontal
(window-left-column right)
(setq delta (max (- max-delta) min-delta)))
(unless (zerop delta)
;; Start resizing.
- (window-resize-reset frame horizontal)
+ (window--resize-reset frame horizontal)
;; Try to enlarge RIGHT.
(setq this-delta (window-resizable right (- delta) horizontal))
(unless (zerop this-delta)
- (resize-this-window
+ (window--resize-this-window
right this-delta horizontal nil t 'after
(if horizontal
(window-left-column right)
(window-top-line right))))
;; Shrink windows on left of RIGHT.
- (resize-other-windows
+ (window--resize-siblings
right (- delta) horizontal nil 'before
(if horizontal
(+ (window-left-column left) (window-total-size left t))
Make WINDOW as large as possible without deleting any windows.
WINDOW can be any window and defaults to the selected window."
(interactive)
- (setq window (normalize-any-window window))
+ (setq window (window-normalize-any-window window))
(window-resize window (window-max-delta window))
(window-resize window (window-max-delta window t) t))
Make WINDOW as small as possible without deleting any windows.
WINDOW can be any window and defaults to the selected window."
(interactive)
- (setq window (normalize-any-window window))
+ (setq window (window-normalize-any-window window))
(window-resize window (- (window-min-delta window)))
(window-resize window (- (window-min-delta window t)) t))
\f
Each of the subwindows may again be a window or a list
representing a window split, and so on. EDGES is a list \(LEFT
TOP RIGHT BOTTOM) as returned by `window-edges'."
- (setq frame (normalize-live-frame frame))
+ (setq frame (window-normalize-frame frame))
(window-tree-1 (frame-root-window frame) t))
\f
(defun other-window (count &optional all-frames)
"Return t if WINDOW can be safely deleted from its frame.
Return `frame' if deleting WINDOW should delete its frame
instead."
- (setq window (normalize-any-window window))
+ (setq window (window-normalize-any-window window))
(unless ignore-window-parameters
;; Handle atomicity.
(when (window-parameter window 'window-atom)
argument. If WINDOW is the only window on its frame or the last
non-side window, signal an error."
(interactive)
- (setq window (normalize-any-window window))
+ (setq window (window-normalize-any-window window))
(let* ((frame (window-frame window))
(function (window-parameter window 'delete-window))
(parent (window-parent window))
;; Emacs 23 preferably gives WINDOW's space to its left
;; sibling.
(sibling (or (window-left window) (window-right window))))
- (window-resize-reset frame horizontal)
+ (window--resize-reset frame horizontal)
(cond
((and (not (window-splits window))
sibling (window-sizable-p sibling size))
;; Resize WINDOW's sibling.
- (resize-this-window sibling size horizontal nil t)
+ (window--resize-this-window sibling size horizontal nil t)
(set-window-new-normal
sibling (+ (window-normal-size sibling horizontal)
(window-normal-size window horizontal))))
((window-resizable-p window (- size) horizontal nil nil nil t)
;; Can do without resizing fixed-size windows.
- (resize-other-windows window (- size) horizontal))
+ (window--resize-siblings window (- size) horizontal))
(t
;; Can't do without resizing fixed-size windows.
- (resize-other-windows window (- size) horizontal t)))
+ (window--resize-siblings window (- size) horizontal t)))
;; Actually delete WINDOW.
(delete-window-internal window)
(when (and frame-selected
on the frame. Side windows are not deleted. If WINDOW is a side
window signal an error."
(interactive)
- (setq window (normalize-any-window window))
+ (setq window (window-normalize-any-window window))
(let* ((frame (window-frame window))
(function (window-parameter window 'delete-other-windows))
(window-side (window-parameter window 'window-side))
(defun record-window-buffer (&optional window)
"Record WINDOW's buffer.
WINDOW must be a live window and defaults to the selected one."
- (let* ((window (normalize-live-window window))
+ (let* ((window (window-normalize-live-window window))
(buffer (window-buffer window))
(entry (assq buffer (window-prev-buffers window))))
;; Reset WINDOW's next buffers. If needed, they are resurrected by
WINDOW must be a live window and defaults to the selected one.
BUFFER must be a live buffer and defaults to the buffer of
WINDOW."
- (let* ((window (normalize-live-window window))
+ (let* ((window (window-normalize-live-window window))
(buffer (or buffer (window-buffer window))))
(set-window-prev-buffers
window (assq-delete-all buffer (window-prev-buffers window)))
shown in WINDOW is about to be buried or killed and consequently
shall not be switched to in future invocations of this command."
(interactive)
- (let* ((window (normalize-live-window window))
+ (let* ((window (window-normalize-live-window window))
(old-buffer (window-buffer window))
;; Save this since it's destroyed by `set-window-buffer'.
(next-buffers (window-next-buffers window))
"In WINDOW switch to next buffer.
WINDOW must be a live window and defaults to the selected one."
(interactive)
- (let* ((window (normalize-live-window window))
+ (let* ((window (window-normalize-live-window window))
(old-buffer (window-buffer window))
(next-buffers (window-next-buffers window))
new-buffer entry killed-buffers visible)
remove the current buffer from the selected window if it is
displayed there."
(interactive)
- (let* ((buffer (normalize-live-buffer buffer-or-name)))
+ (let* ((buffer (window-normalize-buffer buffer-or-name)))
;; If `buffer-or-name' is not on the selected frame we unrecord it
;; although it's not "here" (call it a feature).
(unrecord-buffer buffer)
((or buffer-or-name (not (eq buffer (window-buffer)))))
((not (window-dedicated-p))
(switch-to-prev-buffer nil 'bury))
- ((frame-root-window-p (selected-window))
+ ((and (frame-root-window-p (selected-window))
+ ;; Don't iconify if it's the only frame.
+ (not (eq (next-frame nil 0) (selected-frame))))
(iconify-frame (window-frame (selected-window))))
((window-deletable-p)
(delete-window)))
window of its frame, that frame is deleted when there are other
frames left."
(interactive "BDelete windows on (buffer):\nP")
- (let ((buffer (normalize-live-buffer buffer-or-name))
+ (let ((buffer (window-normalize-buffer buffer-or-name))
;; Handle the "inverted" meaning of the FRAME argument wrt other
;; `window-list-1' based function.
(all-frames (cond ((not frame) t) ((eq frame t) nil) (t frame))))
This function removes the buffer denoted by BUFFER-OR-NAME from
all window-local buffer lists."
- (let ((buffer (normalize-live-buffer buffer-or-name)))
+ (let ((buffer (window-normalize-buffer buffer-or-name)))
(dolist (window (window-list-1 nil nil t))
(if (eq (window-buffer window) buffer)
(let ((deletable (window-deletable-p window)))
buffer. If KILL is nil, put WINDOW's buffer at the end of the
buffer list. Interactively, KILL is the prefix argument."
(interactive "i\nP")
- (setq window (normalize-live-window window))
+ (setq window (window-normalize-live-window window))
(let ((buffer (window-buffer window))
(quit-restore (window-parameter window 'quit-restore))
deletable resize)
new window are inherited from the window selected on WINDOW's
frame. The selected window is not changed by this function."
(interactive "i")
- (setq window (normalize-any-window window))
+ (setq window (window-normalize-any-window window))
(let* ((side (cond
((not side) 'below)
((memq side '(below above right left)) side)
;; SIZE specification violates minimum size restrictions.
(error "Window %s too small for splitting" window)))
- (window-resize-reset frame horizontal)
+ (window--resize-reset frame horizontal)
(setq new-parent
;; Make new-parent non-nil if we need a new parent window;
;; we won't be able to return space to those windows when we
;; delete the one we create here. Hence we do not go up.
(progn
- (resize-subwindows parent (- new-size) horizontal)
+ (window--resize-subwindows parent (- new-size) horizontal)
(let* ((normal (- 1.0 new-normal))
(sub (window-child parent)))
(while sub
(setq sub (window-right sub)))))
;; Get entire space from WINDOW.
(set-window-new-total window (- old-size new-size))
- (resize-this-window window (- new-size) horizontal)
+ (window--resize-this-window window (- new-size) horizontal)
(set-window-new-normal
window (- (if new-parent 1.0 (window-normal-size window horizontal))
new-normal)))
;;; Balancing windows.
;; The following routine uses the recycled code from an old version of
-;; `resize-subwindows'. It's not very pretty, but coding it the way the
-;; new `resize-subwindows' code does would hardly make it any shorter or
+;; `window--resize-subwindows'. It's not very pretty, but coding it the way the
+;; new `window--resize-subwindows' code does would hardly make it any shorter or
;; more readable (FWIW we'd need three loops - one to calculate the
;; minimum sizes per window, one to enlarge or shrink windows until the
;; new parent-size matches, and one where we shrink the largest/enlarge
(setq sub first)
(while (and sub (not failed))
;; Ignore subwindows that should be ignored or are stuck.
- (unless (resize-subwindows-skip-p sub)
+ (unless (window--resize-subwindows-skip-p sub)
(setq found t)
(setq sub-total (window-total-size sub horizontal))
(setq sub-delta (- size sub-total))
;; (column) until `rest' is zero.
(setq sub first)
(while (and sub (> rest 0))
- (unless (resize-subwindows-skip-p window)
+ (unless (window--resize-subwindows-skip-p window)
(set-window-new-total sub 1 t)
(setq rest (1- rest)))
(setq sub (window-right sub)))
(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))))))))
(error "Not a window or frame %s" window-or-frame))))
(frame (window-frame window)))
;; Balance vertically.
- (window-resize-reset (window-frame window))
+ (window--resize-reset (window-frame window))
(balance-windows-1 window)
(window-resize-apply frame)
;; Balance horizontally.
- (window-resize-reset (window-frame window) t)
+ (window--resize-reset (window-frame window) t)
(balance-windows-1 window t)
(window-resize-apply frame t)))
(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.
sizes and fixed size restrictions. IGNORE equal `safe' means
subwindows can get as small as `window-safe-min-height' and
`window-safe-min-width'."
- (setq window (normalize-live-window window))
+ (setq window (window-normalize-live-window window))
(let* ((frame (window-frame window))
(head (car state))
;; We check here (1) whether the total sizes of root window of
Display specifiers are either symbols, cons cells, or lists.
Five specifiers have been reserved to indicate the basic method
for displaying the buffer: `reuse-window', `pop-up-window',
-`pop-up-frame', `use-side-window', and `fun-with-args'.
+`pop-up-frame', `use-side-window', and `function'.
A list whose car is the symbol `reuse-window' indicates that an
existing window shall be reused for displaying the buffer. The
`pop-up-window-min-height', `pop-up-window-min-width',
`pop-up-window-set-height' and `pop-up-window-set-width'.
-A list whose car is the symbol `fun-with-args' specifies that the
+A list whose car is the symbol `function' specifies that the
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
;; Function with argument specifiers.
(list
:tag "Function with arguments"
- :value (fun-with-args (fun-with-args 'ignore))
+ :value (function (function 'ignore))
:format "%t\n%v"
:inline t
;; For customization purposes only.
- (const :format "" fun-with-args)
+ (const :format "" function)
(set
:format "%v"
:inline t
(list
:format "%v"
- :value (fun-with-args 'ignore)
- (const :format "" fun-with-args)
+ :value (function 'ignore)
+ (const :format "" function)
(function :tag "Function" :format "%t: %v\n" :size 25)
(list
:format "%v"
SPECIFIERS must be a list of buffer display specifiers, see the
documentation of `display-buffer-alist' for a description."
- (setq buffer (normalize-live-buffer buffer))
- (setq window (normalize-live-window window))
+ (setq buffer (window-normalize-buffer buffer))
+ (setq window (window-normalize-live-window window))
(let* ((old-frame (selected-frame))
(new-frame (window-frame window))
(dedicated (cdr (assq 'dedicated specifiers)))
(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.
(set-window-parameter window 'window-slot slot))
(display-buffer-in-window buffer window specifiers)))))
-(defun normalize-buffer-to-display (buffer-or-name)
+(defun window-normalize-buffer-to-display (buffer-or-name)
"Normalize BUFFER-OR-NAME argument for buffer display functions.
If BUFFER-OR-NAME is nil, return the curent buffer. Else, if a
buffer specified by BUFFER-OR-NAME exists, return that buffer.
The calculation of the return value is exclusively based on the
user preferences expressed in `display-buffer-alist'."
- (let* ((buffer (normalize-live-buffer buffer-or-name))
+ (let* ((buffer (window-normalize-buffer buffer-or-name))
(list (display-buffer-normalize-alist (buffer-name buffer) label))
(value (assq 'other-window-means-other-frame
(or (car list) (cdr list)))))
;; `special-display-function'.
(setq pars (with-no-warnings
(special-display-p buffer-name))))
- (list (list 'fun-with-args
+ (list (list 'function
(with-no-warnings special-display-function)
(when (listp pars) pars)))
;; Pop up another frame.
compatibility layer for the now obsolete Emacs 23 buffer display
options."
(with-no-warnings
- (let* ((buffer (normalize-live-buffer buffer-or-name))
+ (let* ((buffer (window-normalize-buffer buffer-or-name))
(buffer-name (buffer-name buffer))
(use-pop-up-frames
(or (and (eq pop-up-frames 'graphic-only)
(let ((pars (special-display-p buffer-name)))
(when pars
(setq specifiers
- (cons (list 'fun-with-args special-display-function
+ (cons (list 'function special-display-function
(when (listp pars) pars))
specifiers)))))
(defun display-buffer-frame (&optional frame)
"Return FRAME if it is live and not a minibuffer-only frame.
Return the value of `last-nonminibuffer-frame' otherwise."
- (setq frame (normalize-live-frame frame))
+ (setq frame (window-normalize-frame frame))
(if (and (frame-live-p frame)
;; A not very nice way to get that information.
(not (window-minibuffer-p (frame-root-window frame))))
`display-buffer-function' is non-nil, call it with the buffer and
this list as arguments."
(interactive "BDisplay buffer:\nP")
- (let* ((buffer (normalize-buffer-to-display buffer-or-name))
+ (let* ((buffer (window-normalize-buffer-to-display buffer-or-name))
(buffer-name (buffer-name buffer))
(normalized
;; Normalize specifiers.
((eq method 'use-side-window)
(display-buffer-in-side-window
buffer (nth 1 specifier) (nth 2 specifier) normalized))
- ((eq method 'fun-with-args)
- (apply (nth 1 specifier) buffer (nth 2 specifier))))))
+ ((eq method 'function)
+ (funcall (nth 1 specifier) buffer (nth 2 specifier))))))
;; If we don't have a window yet, try a fallback method. All
;; specifiers have been used up by now.
(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
documentations of `display-buffer' and `display-buffer-alist' for
additional information."
(interactive "BPop to buffer:\nP")
- (let ((buffer (normalize-buffer-to-display buffer-or-name))
+ (let ((buffer (window-normalize-buffer-to-display buffer-or-name))
(old-window (selected-window))
(old-frame (selected-frame))
new-window new-frame)
(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
(read-buffer prompt (other-buffer (current-buffer))
(confirm-nonexistent-file-or-buffer)))))
-(defun normalize-buffer-to-switch-to (buffer-or-name)
+(defun window-normalize-buffer-to-switch-to (buffer-or-name)
"Normalize BUFFER-OR-NAME argument of buffer switching functions.
If BUFFER-OR-NAME is nil, return the buffer returned by
`other-buffer'. Else, if a buffer specified by BUFFER-OR-NAME
functions should call `pop-to-buffer-same-window' instead."
(interactive
(list (read-buffer-to-switch "Switch to buffer: ")))
- (let ((buffer (normalize-buffer-to-switch-to buffer-or-name)))
- (if (and (or (window-minibuffer-p) (eq (window-dedicated-p) t))
- (not (eq buffer (window-buffer))))
- ;; Cannot switch to another buffer in a minibuffer or strongly
- ;; dedicated window that does not show the buffer already. Call
- ;; `pop-to-buffer' instead.
- (pop-to-buffer buffer 'same-window norecord)
- (unless (eq buffer (window-buffer))
- ;; I'm not sure why we should NOT call `set-window-buffer' here,
- ;; but let's keep things as they are (otherwise we could always
- ;; call `pop-to-buffer-same-window' here).
- (set-window-buffer nil buffer))
- (unless norecord
- (select-window (selected-window)))
- (set-buffer buffer))))
+ (let ((buffer (window-normalize-buffer-to-switch-to buffer-or-name)))
+ (cond
+ ;; Don't call set-window-buffer if it's not needed since it
+ ;; might signal an error (e.g. if the window is dedicated).
+ ((eq buffer (window-buffer)) nil)
+ ((window-minibuffer-p)
+ (error "Cannot switch buffers in minibuffer window"))
+ ((eq (window-dedicated-p) t)
+ (error "Cannot switch buffers in a dedicated window"))
+ (t (set-window-buffer nil buffer)))
+ (unless norecord
+ (select-window (selected-window)))
+ (set-buffer buffer)))
(defun switch-to-buffer-same-frame (buffer-or-name &optional norecord)
"Switch to buffer BUFFER-OR-NAME in a window on the selected frame.
functions should call `pop-to-buffer-same-frame' instead."
(interactive
(list (read-buffer-to-switch "Switch to buffer in other window: ")))
- (let ((buffer (normalize-buffer-to-switch-to buffer-or-name)))
+ (let ((buffer (window-normalize-buffer-to-switch-to buffer-or-name)))
(pop-to-buffer buffer 'same-frame norecord)))
(defun switch-to-buffer-other-window (buffer-or-name &optional norecord)
functions should call `pop-to-buffer-other-window' instead."
(interactive
(list (read-buffer-to-switch "Switch to buffer in other window: ")))
- (let ((buffer (normalize-buffer-to-switch-to buffer-or-name)))
+ (let ((buffer (window-normalize-buffer-to-switch-to buffer-or-name)))
(pop-to-buffer buffer 'other-window norecord)))
(defun switch-to-buffer-other-window-same-frame (buffer-or-name &optional norecord)
instead."
(interactive
(list (read-buffer-to-switch "Switch to buffer in other window: ")))
- (let ((buffer (normalize-buffer-to-switch-to buffer-or-name)))
+ (let ((buffer (window-normalize-buffer-to-switch-to buffer-or-name)))
(pop-to-buffer buffer 'same-frame-other-window norecord)))
(defun switch-to-buffer-other-frame (buffer-or-name &optional norecord)
functions should call `pop-to-buffer-other-frame' instead."
(interactive
(list (read-buffer-to-switch "Switch to buffer in other frame: ")))
- (let ((buffer (normalize-buffer-to-switch-to buffer-or-name)))
+ (let ((buffer (window-normalize-buffer-to-switch-to buffer-or-name)))
(pop-to-buffer buffer 'other-frame norecord)))
;;; Obsolete definitions of `display-buffer' below.
See also `same-window-regexps'."
:type '(repeat (string :format "%v"))
:group 'windows)
-(make-obsolete-variable
- 'same-window-buffer-names
- "use 2nd arg of `display-buffer' instead." "24.1")
+;; (make-obsolete-variable
+ ;; 'same-window-buffer-names
+ ;; "use 2nd arg of `display-buffer' instead." "24.1")
(defcustom same-window-regexps nil
"List of regexps saying which buffers should appear in the \"same\" window.
See also `same-window-buffer-names'."
:type '(repeat (regexp :format "%v"))
:group 'windows)
-(make-obsolete-variable
- 'same-window-regexps
- "use 2nd arg of `display-buffer' instead." "24.1")
+;; (make-obsolete-variable
+ ;; 'same-window-regexps
+ ;; "use 2nd arg of `display-buffer' instead." "24.1")
(defun same-window-p (buffer-name)
"Return non-nil if a buffer named BUFFER-NAME would be shown in the \"same\" window.
(and (consp regexp) (stringp (car regexp))
(string-match-p (car regexp) buffer-name)))
(throw 'found t))))))))
-(make-obsolete
- 'same-window-p "pass argument to buffer display function instead." "24.1")
+;; (make-obsolete
+ ;; 'same-window-p "pass argument to buffer display function instead." "24.1")
(defcustom special-display-frame-alist
'((height . 14) (width . 80) (unsplittable . t))
(symbol :tag "Parameter")
(sexp :tag "Value")))
:group 'frames)
-(make-obsolete-variable
- 'special-display-frame-alist
- "use 2nd arg of `display-buffer' instead." "24.1")
+;; (make-obsolete-variable
+ ;; 'special-display-frame-alist
+ ;; "use 2nd arg of `display-buffer' instead." "24.1")
(defun special-display-popup-frame (buffer &optional args)
"Display BUFFER in a special frame and return the window chosen.
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)))
(set-window-buffer (frame-selected-window frame) buffer)
(set-window-dedicated-p (frame-selected-window frame) t)
(frame-selected-window frame))))))
-(make-obsolete
- 'special-display-popup-frame
- "use 2nd arg of `display-buffer' instead." "24.1")
+;; (make-obsolete
+ ;; 'special-display-popup-frame
+ ;; "use 2nd arg of `display-buffer' instead." "24.1")
(defcustom special-display-function 'special-display-popup-frame
"Function to call for displaying special buffers.
:type 'function
:group 'windows
:group 'frames)
-(make-obsolete-variable
- 'special-display-function
- "use 2nd arg of `display-buffer' instead." "24.1")
+;; (make-obsolete-variable
+ ;; 'special-display-function
+ ;; "use 2nd arg of `display-buffer' instead." "24.1")
(defcustom special-display-buffer-names nil
"List of names of buffers that should be displayed specially.
(repeat :tag "Arguments" (sexp)))))
:group 'windows
:group 'frames)
-(make-obsolete-variable
- 'special-display-buffer-names
- "use 2nd arg of `display-buffer' instead." "24.1")
+;; (make-obsolete-variable
+ ;; 'special-display-buffer-names
+ ;; "use 2nd arg of `display-buffer' instead." "24.1")
;;;###autoload
(put 'special-display-buffer-names 'risky-local-variable t)
(repeat :tag "Arguments" (sexp)))))
:group 'windows
:group 'frames)
-(make-obsolete-variable
- 'special-display-regexps
- "use 2nd arg of `display-buffer' instead." "24.1")
+;; (make-obsolete-variable
+ ;; 'special-display-regexps
+ ;; "use 2nd arg of `display-buffer' instead." "24.1")
(defun special-display-p (buffer-name)
"Return non-nil if a buffer named BUFFER-NAME gets a special frame.
((and (consp regexp) (stringp (car regexp))
(string-match-p (car regexp) buffer-name))
(throw 'found (cdr regexp))))))))))
-(make-obsolete
- 'special-display-p
- "pass argument to buffer display function instead." "24.1")
+;; (make-obsolete
+ ;; 'special-display-p
+ ;; "pass argument to buffer display function instead." "24.1")
(defcustom pop-up-frame-alist nil
"Alist of parameters for automatically generated new frames.
(symbol :tag "Parameter")
(sexp :tag "Value")))
:group 'frames)
-(make-obsolete-variable
- 'pop-up-frame-alist
- "use 2nd arg of `display-buffer' instead." "24.1")
+;; (make-obsolete-variable
+ ;; 'pop-up-frame-alist
+ ;; "use 2nd arg of `display-buffer' instead." "24.1")
(defcustom pop-up-frame-function
(lambda () (make-frame pop-up-frame-alist))
`pop-up-frame-alist'."
:type 'function
:group 'frames)
-(make-obsolete-variable
- 'pop-up-frame-function
- "use 2nd arg of `display-buffer' instead." "24.1")
+;; (make-obsolete-variable
+ ;; 'pop-up-frame-function
+ ;; "use 2nd arg of `display-buffer' instead." "24.1")
(defcustom pop-up-frames nil
"Whether `display-buffer' should make a separate frame.
(const :tag "Always" t))
:group 'windows
:group 'frames)
-(make-obsolete-variable
- 'pop-up-frames
- "use 2nd arg of `display-buffer' instead." "24.1")
+;; (make-obsolete-variable
+ ;; 'pop-up-frames
+ ;; "use 2nd arg of `display-buffer' instead." "24.1")
(defcustom display-buffer-reuse-frames nil
"Set and non-nil means `display-buffer' should reuse frames.
:version "21.1"
:group 'windows
:group 'frames)
-(make-obsolete-variable
- 'display-buffer-reuse-frames
- "use 2nd arg of `display-buffer' instead." "24.1")
+;; (make-obsolete-variable
+ ;; 'display-buffer-reuse-frames
+ ;; "use 2nd arg of `display-buffer' instead." "24.1")
(defcustom pop-up-windows 'unset ; t
"Set and non-nil means `display-buffer' should make a new window."
:type 'boolean
:version "24.1"
:group 'windows)
-(make-obsolete-variable
- 'pop-up-windows
- "use 2nd arg of `display-buffer' instead." "24.1")
+;; (make-obsolete-variable
+ ;; 'pop-up-windows
+ ;; "use 2nd arg of `display-buffer' instead." "24.1")
(defcustom split-window-preferred-function 'split-window-sensibly
"Function called by `display-buffer' to split a window.
:type 'function
:version "23.1"
:group 'windows)
-(make-obsolete-variable
- 'split-window-preferred-function
- "use 2nd arg of `display-buffer' instead." "24.1")
+;; (make-obsolete-variable
+ ;; 'split-window-preferred-function
+ ;; "use 2nd arg of `display-buffer' instead." "24.1")
(defcustom split-height-threshold 80
"Minimum height for splitting a window to display a buffer.
:type '(choice (const nil) (integer :tag "lines"))
:version "23.1"
:group 'windows)
-(make-obsolete-variable
- 'split-height-threshold
- "use 2nd arg of `display-buffer' instead." "24.1")
+;; (make-obsolete-variable
+ ;; 'split-height-threshold
+ ;; "use 2nd arg of `display-buffer' instead." "24.1")
(defcustom split-width-threshold 160
"Minimum width for splitting a window to display a buffer.
:type '(choice (const nil) (integer :tag "columns"))
:version "23.1"
:group 'windows)
-(make-obsolete-variable
- 'split-width-threshold
- "use 2nd arg of `display-buffer' instead." "24.1")
+;; (make-obsolete-variable
+ ;; 'split-width-threshold
+ ;; "use 2nd arg of `display-buffer' instead." "24.1")
(defcustom even-window-heights 'unset ; t
"If set and non-nil `display-buffer' will try to even window heights.
:type 'boolean
:version "24.1"
:group 'windows)
-(make-obsolete-variable
- 'even-window-heights
- "use 2nd arg of `display-buffer' instead." "24.1")
+;; (make-obsolete-variable
+ ;; 'even-window-heights
+ ;; "use 2nd arg of `display-buffer' instead." "24.1")
(defvar display-buffer-mark-dedicated nil
"Non-nil means `display-buffer' marks the windows it creates as dedicated.
The actual non-nil value of this variable will be copied to the
`window-dedicated-p' flag.")
-(make-obsolete-variable
- 'display-buffer-mark-dedicated
- "use 2nd arg of `display-buffer' instead." "24.1")
+;; (make-obsolete-variable
+ ;; 'display-buffer-mark-dedicated
+ ;; "use 2nd arg of `display-buffer' instead." "24.1")
(defun window-splittable-p (window &optional horizontal)
"Return non-nil if `split-window-sensibly' may split WINDOW.
(max split-height-threshold
(* 2 (max window-min-height
(if mode-line-format 2 1))))))))))
-(make-obsolete
- 'window-splittable-p "use 2nd arg of `display-buffer' instead." "24.1")
+;; (make-obsolete
+ ;; 'window-splittable-p "use 2nd arg of `display-buffer' instead." "24.1")
(defun split-window-sensibly (window)
"Split WINDOW in a way suitable for `display-buffer'.
(when (with-no-warnings (window-splittable-p window))
(with-selected-window window
(split-window-vertically)))))))
-(make-obsolete
- 'split-window-sensibly "use 2nd arg of `display-buffer' instead." "24.1")
+;; (make-obsolete
+ ;; 'split-window-sensibly "use 2nd arg of `display-buffer' instead." "24.1")
;; Functions for converting Emacs 23 buffer display options to buffer
;; display specifiers.
(display-buffer-alist-add
`((regexp . ,entry))
(list
- 'fun-with-args
- (list 'fun-with-args special-display-function
+ 'function
+ (list 'function special-display-function
special-display-frame-alist))
no-custom))
((consp entry)
(display-buffer-alist-add
`((name . ,name))
(list
- 'fun-with-args
+ 'function
;; Weary.
- (list 'fun-with-args (car rest) (cadr rest)))
+ (list 'function (car rest) (cadr rest)))
no-custom))
((listp rest)
;; A list of parameters.
(display-buffer-alist-add
`((name . ,name))
(list
- 'fun-with-args
- (list 'fun-with-args special-display-function
+ 'function
+ (list 'function special-display-function
special-display-frame-alist))
no-custom)))))))))
(display-buffer-alist-add
`((name . ,entry))
(list
- 'fun-with-args
- (list 'fun-with-args special-display-function
+ 'function
+ (list 'function special-display-function
special-display-frame-alist))
no-custom))
((consp entry)
(display-buffer-alist-add
`((name . ,name))
(list
- 'fun-with-args
+ 'function
;; Weary.
- (list 'fun-with-args (car rest) (cadr rest)))
+ (list 'function (car rest) (cadr rest)))
no-custom))
((listp rest)
;; A list of parameters.
(display-buffer-alist-add
`((name . ,name))
(list
- 'fun-with-args
- (list 'fun-with-args special-display-function
+ 'function
+ (list 'function special-display-function
special-display-frame-alist))
no-custom)))))))))
always set the height exactly, but attempts to be conservative,
by allocating more lines than are actually needed in the case
where some error may be present."
- (setq window (normalize-live-window window))
+ (setq window (window-normalize-live-window window))
(let ((delta (- height (window-text-height window))))
(unless (zerop delta)
;; Setting window-min-height to a value like 1 can lead to very
(interactive)
;; Do all the work in WINDOW and its buffer and restore the selected
;; window and the current buffer when we're done.
- (setq window (normalize-live-window window))
+ (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
;; `window-iso-combined-p' instead should handle that.
(or (= (nth 2 edges) (nth 2 (window-edges (previous-window))))
(= (nth 0 edges) (nth 0 (window-edges (next-window))))))))
-(make-obsolete
- 'window-safely-shrinkable-p "use `window-iso-combined-p' instead." "24.1")
+;; (make-obsolete
+ ;; 'window-safely-shrinkable-p "use `window-iso-combined-p' instead." "24.1")
(defun shrink-window-if-larger-than-buffer (&optional window)
"Shrink height of WINDOW if its buffer doesn't need so many lines.
Return non-nil if the window was shrunk, nil otherwise."
(interactive)
- (setq window (normalize-live-window window))
+ (setq window (window-normalize-live-window window))
;; Make sure that WINDOW is vertically combined and `point-min' is
;; visible (for whatever reason that's needed). The remaining issues
;; should be taken care of by `fit-window-to-buffer'.