From: Martin Rudalics Date: Mon, 27 Jun 2011 18:32:56 +0000 (+0200) Subject: Use window- prefix more consistently. Fix two buffer display bugs. X-Git-Tag: emacs-pretest-24.0.90~104^2~152^2~360 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d615d6d2887f159f1a7337be7bd175ce22013e1f;p=emacs.git Use window- prefix more consistently. Fix two buffer display bugs. * window.c (resize_window_check): Rename to window_resize_check. (resize_window_apply): Rename to window_resize_apply. (Fresize_window_apply): Rename to Fwindow_resize_apply. (Fdelete_other_windows_internal, resize_frame_windows) (Fsplit_window_internal, Fdelete_window_internal) (grow_mini_window, shrink_mini_window) (Fresize_mini_window_internal): Fix callers accordingly. * window.el (resize-window-reset): Rename to window-resize-reset. (resize-window-reset-1): Rename to window-resize-reset-1. (resize-window): Rename to window-resize. (window-min-height, window-min-width) (resize-mini-window, resize-this-window, resize-root-window) (resize-root-window-vertically, adjust-window-trailing-edge) (enlarge-window, shrink-window, maximize-window) (minimize-window, delete-window, quit-restore-window) (split-window, balance-windows, balance-windows-area-adjust) (balance-windows-area, window-state-put-2) (display-buffer-even-window-sizes, display-buffer-set-height) (display-buffer-set-width, set-window-text-height) (fit-window-to-buffer): Rename all "resize-window" prefixed calls to use the "window-resize" prefix convention. (display-buffer-alist): Fix symbol for label specifier. (display-buffer-reuse-window): Set reuse-dedicated to cdr of corresponding specifier. Reported by Juanma Barranquero . --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b53365d7d35..8fe51fc341b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -9,6 +9,24 @@ window-next and window-prev are now called window-top-child, window-left-child, window-next-sibling and window-prev-sibling respectively. + (resize-window-reset): Rename to window-resize-reset. + (resize-window-reset-1): Rename to window-resize-reset-1. + (resize-window): Rename to window-resize. + (window-min-height, window-min-width) + (resize-mini-window, resize-this-window, resize-root-window) + (resize-root-window-vertically, adjust-window-trailing-edge) + (enlarge-window, shrink-window, maximize-window) + (minimize-window, delete-window, quit-restore-window) + (split-window, balance-windows, balance-windows-area-adjust) + (balance-windows-area, window-state-put-2) + (display-buffer-even-window-sizes, display-buffer-set-height) + (display-buffer-set-width, set-window-text-height) + (fit-window-to-buffer): Rename all "resize-window" prefixed + calls to use the "window-resize" prefix convention. + (display-buffer-alist): Fix symbol for label specifier. + (display-buffer-reuse-window): Set reuse-dedicated to cdr of + corresponding specifier. + Reported by Juanma Barranquero . 2011-06-27 Vincent Belaïche diff --git a/lisp/window.el b/lisp/window.el index 3d65acd22a6..f693077f753 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -170,7 +170,7 @@ of this variable is honored when windows are resized or split. Applications should never rebind this variable. To resize a window to a height less than the one specified here, an -application should instead call `resize-window' with a non-nil +application should instead call `window-resize' with a non-nil IGNORE argument. In order to have `split-window' make a window shorter, explictly specify the SIZE argument of that function." :type 'integer @@ -190,7 +190,7 @@ split. Applications should never rebind this variable. To resize a window to a width less than the one specified here, an -application should instead call `resize-window' with a non-nil +application should instead call `window-resize' with a non-nil IGNORE argument. In order to have `split-window' make a window narrower, explictly specify the SIZE argument of that function." :type 'integer @@ -1353,7 +1353,7 @@ meaning of this argument." (length (window-list-1 nil minibuf))) ;;; Resizing windows. -(defun resize-window-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. @@ -1361,19 +1361,19 @@ This function stores the current value of `window-total-size' applied 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." - (resize-window-reset-1 + (window-resize-reset-1 (frame-root-window (normalize-live-frame frame)) horizontal)) -(defun resize-window-reset-1 (window horizontal) - "Internal function of `resize-window-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) - (resize-window-reset-1 (window-child window) horizontal)) + (window-resize-reset-1 (window-child window) horizontal)) (when (window-right window) - (resize-window-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. @@ -1396,7 +1396,7 @@ as small) as possible but don't signal an error." (setq delta min-delta))) ;; Resize now. - (resize-window-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. @@ -1406,7 +1406,7 @@ as small) as possible but don't signal an error." ;; a minibuffer-only frame. (resize-mini-window-internal window)))) -(defun resize-window (window delta &optional horizontal ignore) +(defun window-resize (window delta &optional horizontal ignore) "Resize WINDOW vertically by DELTA lines. WINDOW can be an arbitrary window and defaults to the selected one. An attempt to resize the root window of a frame will raise @@ -1441,7 +1441,7 @@ instead." ((window-minibuffer-p window) (resize-mini-window window delta)) ((window-resizable-p window delta horizontal ignore) - (resize-window-reset frame horizontal) + (window-resize-reset frame horizontal) (resize-this-window window delta horizontal ignore t) (if (and (not (window-splits window)) (window-iso-combined-p window horizontal) @@ -1462,7 +1462,7 @@ instead." normal-delta))) ;; Otherwise, resize all other windows in the same combination. (resize-other-windows window delta horizontal ignore)) - (resize-window-apply frame horizontal)) + (window-resize-apply frame horizontal)) (t (error "Cannot resize window %s" window))))) @@ -1726,7 +1726,7 @@ already set by this routine." (while sub (when (or (consp (window-new-normal sub)) (numberp (window-new-normal sub))) - ;; Reset new normal size fields so `resize-window-apply' + ;; Reset new normal size fields so `window-resize-apply' ;; won't use them to apply new sizes. (set-window-new-normal sub)) @@ -1867,7 +1867,7 @@ This function recursively resizes WINDOW's subwindows to fit the new size. Make sure that WINDOW is `window-resizable' before calling this function. Note that this function does not resize siblings of WINDOW or WINDOW's parent window. You have to -eventually call `resize-window-apply' in order to make resizing +eventually call `window-resize-apply' in order to make resizing actually take effect." (when add ;; Add DELTA to the new total size of WINDOW. @@ -1898,7 +1898,7 @@ This function is only called by the frame resizing routines. It resizes windows proportionally and never deletes any windows." (when (and (windowp window) (numberp delta) (window-sizable-p window delta horizontal ignore)) - (resize-window-reset (window-frame window) horizontal) + (window-resize-reset (window-frame window) horizontal) (resize-this-window window delta horizontal ignore t))) (defun resize-root-window-vertically (window delta) @@ -1922,7 +1922,7 @@ any windows." (unless (window-sizable window delta) (setq ignore t)))) - (resize-window-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 @@ -2000,7 +2000,7 @@ move it as far as possible in the desired direction." (setq delta (min max-delta (- min-delta)))) (unless (zerop delta) ;; Start resizing. - (resize-window-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) @@ -2023,7 +2023,7 @@ move it as far as possible in the desired direction." (setq delta (max (- max-delta) min-delta))) (unless (zerop delta) ;; Start resizing. - (resize-window-reset frame horizontal) + (window-resize-reset frame horizontal) ;; Try to enlarge RIGHT. (setq this-delta (window-resizable right (- delta) horizontal)) (unless (zerop this-delta) @@ -2040,7 +2040,7 @@ move it as far as possible in the desired direction." (+ (window-top-line left) (window-total-size left))))))) (unless (zerop delta) ;; Don't report an error in the standard case. - (unless (resize-window-apply frame horizontal) + (unless (window-resize-apply frame horizontal) ;; But do report an error if applying the changes fails. (error "Failed adjusting window %s" window))))))) @@ -2057,9 +2057,9 @@ Return nil." ((window-size-fixed-p nil horizontal) (error "Selected window has fixed size")) ((window-resizable-p nil delta horizontal) - (resize-window nil delta horizontal)) + (window-resize nil delta horizontal)) (t - (resize-window + (window-resize nil (if (> delta 0) (window-max-delta nil horizontal) (- (window-min-delta nil horizontal))) @@ -2078,9 +2078,9 @@ Return nil." ((window-size-fixed-p nil horizontal) (error "Selected window has fixed size")) ((window-resizable-p nil (- delta) horizontal) - (resize-window nil (- delta) horizontal)) + (window-resize nil (- delta) horizontal)) (t - (resize-window + (window-resize nil (if (> delta 0) (- (window-min-delta nil horizontal)) (window-max-delta nil horizontal)) @@ -2092,8 +2092,8 @@ 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)) - (resize-window window (window-max-delta window)) - (resize-window window (window-max-delta window t) t)) + (window-resize window (window-max-delta window)) + (window-resize window (window-max-delta window t) t)) (defun minimize-window (&optional window) "Minimize WINDOW. @@ -2101,8 +2101,8 @@ 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)) - (resize-window window (- (window-min-delta window))) - (resize-window window (- (window-min-delta window t)) t)) + (window-resize window (- (window-min-delta window))) + (window-resize window (- (window-min-delta window t)) t)) (defsubst frame-root-window-p (window) "Return non-nil if WINDOW is the root window of its frame." @@ -2371,7 +2371,7 @@ non-side window, signal an error." ;; Emacs 23 preferably gives WINDOW's space to its left ;; sibling. (sibling (or (window-left window) (window-right window)))) - (resize-window-reset frame horizontal) + (window-resize-reset frame horizontal) (cond ((and (not (window-splits window)) sibling (window-sizable-p sibling size)) @@ -2945,7 +2945,7 @@ buffer list. Interactively, KILL is the prefix argument." (set-window-start window (nth 1 quit-restore)) (set-window-point window (nth 2 quit-restore)) (when (and resize (/= (nth 4 quit-restore) (window-total-size window))) - (resize-window + (window-resize window (- (nth 4 quit-restore) (window-total-size window)))) ;; Reset the quit-restore parameter. (set-window-parameter window 'quit-restore nil) @@ -3141,7 +3141,7 @@ frame. The selected window is not changed by this function." ;; SIZE specification violates minimum size restrictions. (error "Window %s too small for splitting" window))) - (resize-window-reset frame horizontal) + (window-resize-reset frame horizontal) (setq new-parent ;; Make new-parent non-nil if we need a new parent window; @@ -3396,13 +3396,13 @@ window." (error "Not a window or frame %s" window-or-frame)))) (frame (window-frame window))) ;; Balance vertically. - (resize-window-reset (window-frame window)) + (window-resize-reset (window-frame window)) (balance-windows-1 window) - (resize-window-apply frame) + (window-resize-apply frame) ;; Balance horizontally. - (resize-window-reset (window-frame window) t) + (window-resize-reset (window-frame window) t) (balance-windows-1 window t) - (resize-window-apply frame t))) + (window-resize-apply frame t))) (defun window-fixed-size-p (&optional window direction) "Return t if WINDOW cannot be resized in DIRECTION. @@ -3422,13 +3422,13 @@ Changing this globally has no effect.") (make-variable-buffer-local 'window-area-factor) (defun balance-windows-area-adjust (window delta horizontal) - "Wrapper around `resize-window' with error checking. + "Wrapper around `window-resize' with error checking. Arguments WINDOW, DELTA and HORIZONTAL are passed on to that function." - ;; `resize-window' may fail if delta is too large. + ;; `window-resize' may fail if delta is too large. (while (>= (abs delta) 1) (condition-case nil (progn - (resize-window window delta horizontal) + (window-resize window delta horizontal) (setq delta 0)) (error ;;(message "adjust: %s" (error-message-string err)) @@ -3496,7 +3496,7 @@ specific buffers." ;; become significant. (setq carry (+ carry areadiff)) ;; This used `adjust-window-trailing-edge' before and uses - ;; `resize-window' now. Error wrapping is still needed. + ;; `window-resize' now. Error wrapping is still needed. (balance-windows-area-adjust win diff horiz) ;; (sit-for 0.5) (let ((change (cons win (window-edges win)))) @@ -3721,13 +3721,13 @@ value can be also stored on disk and read back in a new session." (window-total-height window))) window-size-fixed) (when (window-resizable-p window delta) - (resize-window window delta))) + (window-resize window delta))) ;; Else check whether the window is not high enough. (let* ((min-size (window-min-size window nil ignore)) (delta (- min-size (window-total-size window)))) (when (and (> delta 0) (window-resizable-p window delta nil ignore)) - (resize-window window delta nil ignore)))) + (window-resize window delta nil ignore)))) ;; Adjust horizontally. (if (memq window-size-fixed '(t width)) ;; A fixed width window, try to restore the original size. @@ -3735,13 +3735,13 @@ value can be also stored on disk and read back in a new session." (window-total-width window))) window-size-fixed) (when (window-resizable-p window delta) - (resize-window window delta))) + (window-resize window delta))) ;; Else check whether the window is not wide enough. (let* ((min-size (window-min-size window t ignore)) (delta (- min-size (window-total-size window t)))) (when (and (> delta 0) (window-resizable-p window delta t ignore)) - (resize-window window delta t ignore)))) + (window-resize window delta t ignore)))) ;; Set dedicated status. (set-window-dedicated-p window (cdr (assq 'dedicated state))) ;; Install positions (maybe we should do this after all windows @@ -4183,7 +4183,7 @@ using the location specifiers `same-window' or `other-frame'." :tag "Label" :format "%v" :help-echo "A symbol equalling the buffer display label." - (const :format "" symbol) + (const :format "" label) (symbol :format "Label: %v\n" :size 32)))) ;; Display specifiers. @@ -4678,7 +4678,7 @@ larger than WINDOW." ;; WINDOW and the selected one. But for a simple two windows ;; configuration the present behavior is good enough so why care? (ignore-errors - (resize-window + (window-resize window (/ (- (window-total-height) (window-total-height window)) 2)))) ((and (window-iso-combined-p window t) @@ -4687,7 +4687,7 @@ larger than WINDOW." ;; Don't throw an error if we can't even window widths, see ;; comment above. (ignore-errors - (resize-window + (window-resize window (/ (- (window-total-width) (window-total-width window)) 2) t))))) @@ -4706,7 +4706,7 @@ documentation of `display-buffer-alist' for a description." (delta (- height (window-total-size window)))) (when (and (window-resizable-p window delta nil 'safe) (window-iso-combined-p window)) - (resize-window window delta nil 'safe)))) + (window-resize window delta nil 'safe)))) ((functionp set-height) (ignore-errors (funcall set-height window)))))) @@ -4725,7 +4725,7 @@ documentation of `display-buffer-alist' for a description." (delta (- width (window-total-size window t)))) (when (and (window-resizable-p window delta t 'safe) (window-iso-combined-p window t)) - (resize-window window delta t 'safe)))) + (window-resize window delta t 'safe)))) ((functionp set-width) (ignore-errors (funcall set-width window)))))) @@ -4781,7 +4781,7 @@ none was found." (let* ((method-window (nth 0 method)) (method-buffer (nth 1 method)) (method-frame (nth 2 method)) - (reuse-dedicated (assq 'reuse-window-dedicated specifiers)) + (reuse-dedicated (cdr (assq 'reuse-window-dedicated specifiers))) windows other-frame dedicated time best-window best-time) (when (eq method-frame 'other) ;; `other' is not handled by `window-list-1'. @@ -6807,7 +6807,7 @@ where some error may be present." ;; windows 1-line tall, which means that there's no more space for ;; the modeline. (let ((window-min-height (min 2 height))) ; One text line plus a modeline. - (resize-window window delta))))) + (window-resize window delta))))) (defun enlarge-window-horizontally (delta) "Make selected window DELTA columns wider. @@ -6950,8 +6950,8 @@ WINDOW was scrolled." ;; It's silly to put `point' at the end of the previous ;; line and so maybe force horizontal scrolling. (set-window-point window (line-beginning-position 0))) - ;; Call `resize-window' with OVERRIDE argument equal WINDOW. - (resize-window window delta nil window) + ;; Call `window-resize' with OVERRIDE argument equal WINDOW. + (window-resize window delta nil window) ;; Check if the last line is surely fully visible. If ;; not, enlarge the window. (let ((end (save-excursion @@ -6974,7 +6974,7 @@ WINDOW was scrolled." (while (and (< desired-height max-height) (= desired-height (window-total-size)) (not (pos-visible-in-window-p end))) - (resize-window window 1 nil window) + (window-resize window 1 nil window) (setq desired-height (1+ desired-height))))) (error (setq delta nil))) delta)))) diff --git a/src/ChangeLog b/src/ChangeLog index c6621cec567..149448fc9de 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -15,6 +15,13 @@ (Fwindow_hchild): Rename to Fwindow_left_child. (Fwindow_next): Rename to Fwindow_next_sibling. (Fwindow_prev): Rename to Fwindow_prev_sibling. + (resize_window_check): Rename to window_resize_check. + (resize_window_apply): Rename to window_resize_apply. + (Fresize_window_apply): Rename to Fwindow_resize_apply. + (Fdelete_other_windows_internal, resize_frame_windows) + (Fsplit_window_internal, Fdelete_window_internal) + (grow_mini_window, shrink_mini_window) + (Fresize_mini_window_internal): Fix callers accordingly. 2011-06-26 Jan Djärv diff --git a/src/window.c b/src/window.c index 19b3edf4c77..6656796b350 100644 --- a/src/window.c +++ b/src/window.c @@ -82,8 +82,8 @@ static int foreach_window_1 (struct window *, int (* fn) (struct window *, void *), void *); static Lisp_Object window_list_1 (Lisp_Object, Lisp_Object, Lisp_Object); -static int resize_window_check (struct window *, int); -static void resize_window_apply (struct window *, int); +static int window_resize_check (struct window *, int); +static void window_resize_apply (struct window *, int); static Lisp_Object select_window (Lisp_Object, Lisp_Object, int); /* This is the window in which the terminal's cursor should @@ -2695,13 +2695,13 @@ window-start value is reasonable when this function is called. */) XSETINT (delta, XINT (r->total_lines) - XINT (w->total_lines)); w->top_line = r->top_line; resize_root_window (window, delta, Qnil, Qnil); - if (resize_window_check (w, 0)) - resize_window_apply (w, 0); + if (window_resize_check (w, 0)) + window_resize_apply (w, 0); else { resize_root_window (window, delta, Qnil, Qt); - if (resize_window_check (w, 0)) - resize_window_apply (w, 0); + if (window_resize_check (w, 0)) + window_resize_apply (w, 0); else resize_failed = 1; } @@ -2713,13 +2713,13 @@ window-start value is reasonable when this function is called. */) XSETINT (delta, XINT (r->total_cols) - XINT (w->total_cols)); w->left_col = r->left_col; resize_root_window (window, delta, Qt, Qnil); - if (resize_window_check (w, 1)) - resize_window_apply (w, 1); + if (window_resize_check (w, 1)) + window_resize_apply (w, 1); else { resize_root_window (window, delta, Qt, Qt); - if (resize_window_check (w, 1)) - resize_window_apply (w, 1); + if (window_resize_check (w, 1)) + window_resize_apply (w, 1); else resize_failed = 1; } @@ -3415,7 +3415,7 @@ Note: This function does not operate on any subwindows of WINDOW. */) `window-min-height' or `window-min-width'. It does check that window sizes do not drop below one line (two columns). */ static int -resize_window_check (struct window *w, int horflag) +window_resize_check (struct window *w, int horflag) { struct window *c; @@ -3429,7 +3429,7 @@ resize_window_check (struct window *w, int horflag) while (c) { if ((XINT (c->new_total) != XINT (w->new_total)) - || !resize_window_check (c, horflag)) + || !window_resize_check (c, horflag)) return 0; c = NILP (c->next) ? 0 : XWINDOW (c->next); } @@ -3442,7 +3442,7 @@ resize_window_check (struct window *w, int horflag) int sum_of_sizes = 0; while (c) { - if (!resize_window_check (c, horflag)) + if (!window_resize_check (c, horflag)) return 0; sum_of_sizes = sum_of_sizes + XINT (c->new_total); c = NILP (c->next) ? 0 : XWINDOW (c->next); @@ -3461,7 +3461,7 @@ resize_window_check (struct window *w, int horflag) int sum_of_sizes = 0; while (c) { - if (!resize_window_check (c, horflag)) + if (!window_resize_check (c, horflag)) return 0; sum_of_sizes = sum_of_sizes + XINT (c->new_total); c = NILP (c->next) ? 0 : XWINDOW (c->next); @@ -3474,7 +3474,7 @@ resize_window_check (struct window *w, int horflag) while (c) { if ((XINT (c->new_total) != XINT (w->new_total)) - || !resize_window_check (c, horflag)) + || !window_resize_check (c, horflag)) return 0; c = NILP (c->next) ? 0 : XWINDOW (c->next); } @@ -3494,9 +3494,9 @@ resize_window_check (struct window *w, int horflag) each of these windows. This function does not perform any error checks. Make sure you have - run resize_window_check on W before applying this function. */ + run window_resize_check on W before applying this function. */ static void -resize_window_apply (struct window *w, int horflag) +window_resize_apply (struct window *w, int horflag) { struct window *c; int pos; @@ -3530,7 +3530,7 @@ resize_window_apply (struct window *w, int horflag) XSETFASTINT (c->left_col, pos); else XSETFASTINT (c->top_line, pos); - resize_window_apply (c, horflag); + window_resize_apply (c, horflag); if (!horflag) pos = pos + XINT (c->total_lines); c = NILP (c->next) ? 0 : XWINDOW (c->next); @@ -3546,7 +3546,7 @@ resize_window_apply (struct window *w, int horflag) XSETFASTINT (c->left_col, pos); else XSETFASTINT (c->top_line, pos); - resize_window_apply (c, horflag); + window_resize_apply (c, horflag); if (horflag) pos = pos + XINT (c->total_cols); c = NILP (c->next) ? 0 : XWINDOW (c->next); @@ -3559,7 +3559,7 @@ resize_window_apply (struct window *w, int horflag) } -DEFUN ("resize-window-apply", Fresize_window_apply, Sresize_window_apply, 1, 2, 0, +DEFUN ("window-resize-apply", Fwindow_resize_apply, Swindow_resize_apply, 1, 2, 0, doc: /* Apply requested size values for window-tree of FRAME. Optional argument HORIZONTAL omitted or nil means apply requested height values. HORIZONTAL non-nil means apply requested width values. @@ -3584,12 +3584,12 @@ be applied on the Elisp level. */) f = XFRAME (frame); r = XWINDOW (FRAME_ROOT_WINDOW (f)); - if (!resize_window_check (r, horflag) + if (!window_resize_check (r, horflag) || ! EQ (r->new_total, (horflag ? r->total_cols : r->total_lines))) return Qnil; BLOCK_INPUT; - resize_window_apply (r, horflag); + window_resize_apply (r, horflag); windows_or_buffers_changed++; FRAME_WINDOW_SIZES_CHANGED (f) = 1; @@ -3641,22 +3641,22 @@ resize_frame_windows (struct frame *f, int size, int horflag) XSETINT (delta, new_size - old_size); /* Try a "normal" resize first. */ resize_root_window (root, delta, horflag ? Qt : Qnil, Qnil); - if (resize_window_check (r, horflag) && new_size == XINT (r->new_total)) - resize_window_apply (r, horflag); + if (window_resize_check (r, horflag) && new_size == XINT (r->new_total)) + window_resize_apply (r, horflag); else { /* Try with "reasonable" minimum sizes next. */ resize_root_window (root, delta, horflag ? Qt : Qnil, Qt); - if (resize_window_check (r, horflag) + if (window_resize_check (r, horflag) && new_size == XINT (r->new_total)) - resize_window_apply (r, horflag); + window_resize_apply (r, horflag); else { /* Finally, try with "safe" minimum sizes. */ resize_root_window (root, delta, horflag ? Qt : Qnil, Qsafe); - if (resize_window_check (r, horflag) + if (window_resize_check (r, horflag) && new_size == XINT (r->new_total)) - resize_window_apply (r, horflag); + window_resize_apply (r, horflag); else { /* We lost. Delete all windows but the frame's @@ -3765,7 +3765,7 @@ set correctly. See the code of `split-window' for how this is done. */) XSETINT (p->new_total, XINT (horflag ? p->total_cols : p->total_lines) - XINT (total_size)); - if (!resize_window_check (p, horflag)) + if (!window_resize_check (p, horflag)) error ("Window sizes don't fit"); else /* Undo the temporary pretension. */ @@ -3773,7 +3773,7 @@ set correctly. See the code of `split-window' for how this is done. */) } else { - if (!resize_window_check (o, horflag)) + if (!window_resize_check (o, horflag)) error ("Resizing old window failed"); else if (XINT (total_size) + XINT (o->new_total) != XINT (horflag ? o->total_cols : o->total_lines)) @@ -3861,13 +3861,13 @@ set correctly. See the code of `split-window' for how this is done. */) n->total_cols = o->total_cols; } - /* Iso-coordinates and sizes are assigned by resize_window_apply, + /* Iso-coordinates and sizes are assigned by window_resize_apply, get them ready here. */ n->new_total = total_size; n->new_normal = normal_size; BLOCK_INPUT; - resize_window_apply (p, horflag); + window_resize_apply (p, horflag); adjust_glyphs (f); /* Set buffer of NEW to buffer of reference window. Don't run any hooks. */ @@ -3945,13 +3945,13 @@ when WINDOW is the only window on its frame. */) XWINDOW (s->next)->prev = sibling; } - if (resize_window_check (r, horflag) + if (window_resize_check (r, horflag) && EQ (r->new_total, (horflag ? r->total_cols : r->total_lines))) /* We can delete WINDOW now. */ { /* Block input. */ BLOCK_INPUT; - resize_window_apply (p, horflag); + window_resize_apply (p, horflag); windows_or_buffers_changed++; Vwindow_list = Qnil; @@ -4074,10 +4074,10 @@ grow_mini_window (struct window *w, int delta) root = FRAME_ROOT_WINDOW (f); r = XWINDOW (root); value = call2 (Qresize_root_window_vertically, root, make_number (- delta)); - if (INTEGERP (value) && resize_window_check (r, 0)) + if (INTEGERP (value) && window_resize_check (r, 0)) { BLOCK_INPUT; - resize_window_apply (r, 0); + window_resize_apply (r, 0); /* Grow the mini-window. */ XSETFASTINT (w->top_line, XFASTINT (r->top_line) + XFASTINT (r->total_lines)); @@ -4109,10 +4109,10 @@ shrink_mini_window (struct window *w) r = XWINDOW (root); value = call2 (Qresize_root_window_vertically, root, make_number (size - 1)); - if (INTEGERP (value) && resize_window_check (r, 0)) + if (INTEGERP (value) && window_resize_check (r, 0)) { BLOCK_INPUT; - resize_window_apply (r, 0); + window_resize_apply (r, 0); /* Shrink the mini-window. */ XSETFASTINT (w->top_line, XFASTINT (r->top_line) + XFASTINT (r->total_lines)); @@ -4150,12 +4150,12 @@ DEFUN ("resize-mini-window-internal", Fresize_mini_window_internal, Sresize_mini r = XWINDOW (FRAME_ROOT_WINDOW (f)); height = XINT (r->total_lines) + XINT (w->total_lines); - if (resize_window_check (r, 0) + if (window_resize_check (r, 0) && XINT (w->new_total) > 0 && height == XINT (r->new_total) + XINT (w->new_total)) { BLOCK_INPUT; - resize_window_apply (r, 0); + window_resize_apply (r, 0); w->total_lines = w->new_total; XSETFASTINT (w->top_line, XINT (r->top_line) + XINT (r->total_lines)); @@ -6615,7 +6615,7 @@ function `window-nest' and altered by the function `set-window-nest'. */); defsubr (&Swindow_new_normal); defsubr (&Sset_window_new_total); defsubr (&Sset_window_new_normal); - defsubr (&Sresize_window_apply); + defsubr (&Swindow_resize_apply); defsubr (&Swindow_body_size); defsubr (&Swindow_hscroll); defsubr (&Sset_window_hscroll);