diff options
| -rw-r--r-- | doc/lispref/display.texi | 40 | ||||
| -rw-r--r-- | etc/NEWS | 6 | ||||
| -rw-r--r-- | lisp/window.el | 39 | ||||
| -rw-r--r-- | src/frame.c | 18 | ||||
| -rw-r--r-- | src/window.c | 432 | ||||
| -rw-r--r-- | src/window.h | 14 | ||||
| -rw-r--r-- | src/xdisp.c | 9 |
7 files changed, 307 insertions, 251 deletions
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 4b10788862e..3c91092906c 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -3959,7 +3959,7 @@ showing the buffer, unless you call @code{set-window-buffer} again in | |||
| 3959 | each affected window. You can also use @code{set-window-fringes} to | 3959 | each affected window. You can also use @code{set-window-fringes} to |
| 3960 | control the fringe display in individual windows. | 3960 | control the fringe display in individual windows. |
| 3961 | 3961 | ||
| 3962 | @defun set-window-fringes window left &optional right outside-margins | 3962 | @defun set-window-fringes window left &optional right outside-margins persistent |
| 3963 | This function sets the fringe widths of window @var{window}. | 3963 | This function sets the fringe widths of window @var{window}. |
| 3964 | If @var{window} is @code{nil}, the selected window is used. | 3964 | If @var{window} is @code{nil}, the selected window is used. |
| 3965 | 3965 | ||
| @@ -3974,14 +3974,18 @@ desired width, this leaves the fringes of @var{window} unchanged. | |||
| 3974 | 3974 | ||
| 3975 | The values specified here may be later overridden by invoking | 3975 | The values specified here may be later overridden by invoking |
| 3976 | @code{set-window-buffer} (@pxref{Buffers and Windows}) on @var{window} | 3976 | @code{set-window-buffer} (@pxref{Buffers and Windows}) on @var{window} |
| 3977 | with its @var{keep-margins} argument @code{nil} or omitted. | 3977 | with its @var{keep-margins} argument @code{nil} or omitted. However, |
| 3978 | if the optional fifth argument @var{persistent} is non-@code{nil} and | ||
| 3979 | the other arguments are processed successfully, the values specified | ||
| 3980 | here unconditionally survive subsequent invocations of | ||
| 3981 | @code{set-window-buffer}. | ||
| 3978 | @end defun | 3982 | @end defun |
| 3979 | 3983 | ||
| 3980 | @defun window-fringes &optional window | 3984 | @defun window-fringes &optional window |
| 3981 | This function returns information about the fringes of a window | 3985 | This function returns information about the fringes of a window |
| 3982 | @var{window}. If @var{window} is omitted or @code{nil}, the selected | 3986 | @var{window}. If @var{window} is omitted or @code{nil}, the selected |
| 3983 | window is used. The value has the form @code{(@var{left-width} | 3987 | window is used. The value has the form @code{(@var{left-width} |
| 3984 | @var{right-width} @var{outside-margins})}. | 3988 | @var{right-width} @var{outside-margins} @var{persistent})}. |
| 3985 | @end defun | 3989 | @end defun |
| 3986 | 3990 | ||
| 3987 | 3991 | ||
| @@ -4375,7 +4379,7 @@ This function returns the height of horizontal scroll bars of | |||
| 4375 | You can override the frame specific settings for individual windows by | 4379 | You can override the frame specific settings for individual windows by |
| 4376 | using the following function: | 4380 | using the following function: |
| 4377 | 4381 | ||
| 4378 | @defun set-window-scroll-bars window &optional width vertical-type height horizontal-type | 4382 | @defun set-window-scroll-bars window &optional width vertical-type height horizontal-type persistent |
| 4379 | This function sets the width and/or height and the types of scroll bars | 4383 | This function sets the width and/or height and the types of scroll bars |
| 4380 | for window @var{window}. If @var{window} is @code{nil}, the selected | 4384 | for window @var{window}. If @var{window} is @code{nil}, the selected |
| 4381 | window is used. | 4385 | window is used. |
| @@ -4387,18 +4391,26 @@ if so, where. The possible values are @code{left}, @code{right}, | |||
| 4387 | @code{t}, which means to use the frame's default, and @code{nil} for no | 4391 | @code{t}, which means to use the frame's default, and @code{nil} for no |
| 4388 | vertical scroll bar. | 4392 | vertical scroll bar. |
| 4389 | 4393 | ||
| 4390 | @var{height} specifies the height of the horizontal scroll bar in pixels | 4394 | @var{height} specifies the height of the horizontal scroll bar in |
| 4391 | (@code{nil} means use the height specified for the frame). | 4395 | pixels (@code{nil} means use the height specified for the frame). |
| 4392 | @var{horizontal-type} specifies whether to have a horizontal scroll bar. | 4396 | @var{horizontal-type} specifies whether to have a horizontal scroll |
| 4393 | The possible values are @code{bottom}, @code{t}, which means to use the | 4397 | bar. The possible values are @code{bottom}, @code{t}, which means to |
| 4394 | frame's default, and @code{nil} for no horizontal scroll bar. | 4398 | use the frame's default, and @code{nil} for no horizontal scroll bar. |
| 4399 | Note that for a mini window the value @code{t} has the same meaning as | ||
| 4400 | @code{nil}, namely to not show a horizontal scroll bar. You have to | ||
| 4401 | explicitly specify @code{bottom} in order to show a horizontal scroll | ||
| 4402 | bar in a mini window. | ||
| 4395 | 4403 | ||
| 4396 | If @var{window} is not large enough to accommodate a scroll bar of the | 4404 | If @var{window} is not large enough to accommodate a scroll bar of the |
| 4397 | desired dimension, this leaves the corresponding scroll bar unchanged. | 4405 | desired dimension, this leaves the corresponding scroll bar unchanged. |
| 4398 | 4406 | ||
| 4399 | The values specified here may be later overridden by invoking | 4407 | The values specified here may be later overridden by invoking |
| 4400 | @code{set-window-buffer} (@pxref{Buffers and Windows}) on @var{window} | 4408 | @code{set-window-buffer} (@pxref{Buffers and Windows}) on @var{window} |
| 4401 | with its @var{keep-margins} argument @code{nil} or omitted. | 4409 | with its @var{keep-margins} argument @code{nil} or omitted. However, |
| 4410 | if the optional fifth argument @var{persistent} is non-@code{nil} and | ||
| 4411 | the other arguments are processed successfully, the values specified | ||
| 4412 | here unconditionally survive subsequent invocations of | ||
| 4413 | @code{set-window-buffer}. | ||
| 4402 | @end defun | 4414 | @end defun |
| 4403 | 4415 | ||
| 4404 | The following four functions take as argument a live window which | 4416 | The following four functions take as argument a live window which |
| @@ -4407,7 +4419,7 @@ defaults to the selected one. | |||
| 4407 | @defun window-scroll-bars &optional window | 4419 | @defun window-scroll-bars &optional window |
| 4408 | This function returns a list of the form @code{(@var{width} | 4420 | This function returns a list of the form @code{(@var{width} |
| 4409 | @var{columns} @var{vertical-type} @var{height} @var{lines} | 4421 | @var{columns} @var{vertical-type} @var{height} @var{lines} |
| 4410 | @var{horizontal-type})}. | 4422 | @var{horizontal-type} @var{persistent})}. |
| 4411 | 4423 | ||
| 4412 | The value @var{width} is the value that was specified for the width of | 4424 | The value @var{width} is the value that was specified for the width of |
| 4413 | the vertical scroll bar (which may be @code{nil}); @var{columns} is the | 4425 | the vertical scroll bar (which may be @code{nil}); @var{columns} is the |
| @@ -4418,6 +4430,10 @@ The value @var{height} is the value that was specified for the height of | |||
| 4418 | the horizontal scroll bar (which may be @code{nil}); @var{lines} is the | 4430 | the horizontal scroll bar (which may be @code{nil}); @var{lines} is the |
| 4419 | (possibly rounded) number of lines that the horizontally scroll bar | 4431 | (possibly rounded) number of lines that the horizontally scroll bar |
| 4420 | actually occupies. | 4432 | actually occupies. |
| 4433 | |||
| 4434 | The value of @var{persistent} is the value specified for @var{window} | ||
| 4435 | with the last successful invocation of @code{set-window-scroll-bars}, | ||
| 4436 | @code{nil} if there never was one. | ||
| 4421 | @end defun | 4437 | @end defun |
| 4422 | 4438 | ||
| 4423 | @defun window-current-scroll-bars &optional window | 4439 | @defun window-current-scroll-bars &optional window |
| @@ -4438,7 +4454,7 @@ This function returns the height in pixels of @var{window}'s horizontal | |||
| 4438 | scrollbar. | 4454 | scrollbar. |
| 4439 | @end defun | 4455 | @end defun |
| 4440 | 4456 | ||
| 4441 | If you don't specify these values for a window with | 4457 | If you do not specify a window's scroll bar settings via |
| 4442 | @code{set-window-scroll-bars}, the buffer-local variables | 4458 | @code{set-window-scroll-bars}, the buffer-local variables |
| 4443 | @code{vertical-scroll-bar}, @code{horizontal-scroll-bar}, | 4459 | @code{vertical-scroll-bar}, @code{horizontal-scroll-bar}, |
| 4444 | @code{scroll-bar-width} and @code{scroll-bar-height} in the buffer being | 4460 | @code{scroll-bar-width} and @code{scroll-bar-height} in the buffer being |
| @@ -2076,6 +2076,12 @@ See the section "(elisp) Window Hooks" in the Elisp manual for a | |||
| 2076 | detailed explanation of the new behavior. | 2076 | detailed explanation of the new behavior. |
| 2077 | 2077 | ||
| 2078 | +++ | 2078 | +++ |
| 2079 | ** Making scroll bar and fringe settings persistent for windows. | ||
| 2080 | The functions 'set-window-scroll-bars' and 'set-window-fringes' now | ||
| 2081 | have a new optional argument that makes the settings they produce | ||
| 2082 | reliably survive subsequent invocations of 'set-window-buffer'. | ||
| 2083 | |||
| 2084 | +++ | ||
| 2079 | ** New option 'resize-mini-frames'. | 2085 | ** New option 'resize-mini-frames'. |
| 2080 | This option allows to automatically resize minibuffer-only frames | 2086 | This option allows to automatically resize minibuffer-only frames |
| 2081 | similarly to how minibuffer windows are resized on "normal" frames. | 2087 | similarly to how minibuffer windows are resized on "normal" frames. |
diff --git a/lisp/window.el b/lisp/window.el index 8cb9670ae47..8597f870a5b 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -434,7 +434,8 @@ shorter, explicitly specify the SIZE argument of that function." | |||
| 434 | 434 | ||
| 435 | (defun window-min-pixel-height (&optional window) | 435 | (defun window-min-pixel-height (&optional window) |
| 436 | "Return the minimum pixel height of window WINDOW." | 436 | "Return the minimum pixel height of window WINDOW." |
| 437 | (* (max window-min-height window-safe-min-height) | 437 | (* (max (if (window-minibuffer-p window) 1 window-min-height) |
| 438 | window-safe-min-height) | ||
| 438 | (frame-char-size window))) | 439 | (frame-char-size window))) |
| 439 | 440 | ||
| 440 | ;; This must go to C, finally (or get removed). | 441 | ;; This must go to C, finally (or get removed). |
| @@ -1603,8 +1604,6 @@ return the minimum pixel-size of WINDOW." | |||
| 1603 | value) | 1604 | value) |
| 1604 | (with-current-buffer (window-buffer window) | 1605 | (with-current-buffer (window-buffer window) |
| 1605 | (cond | 1606 | (cond |
| 1606 | ((window-minibuffer-p window) | ||
| 1607 | (if pixelwise (frame-char-height (window-frame window)) 1)) | ||
| 1608 | ((window-size-fixed-p window horizontal ignore) | 1607 | ((window-size-fixed-p window horizontal ignore) |
| 1609 | ;; The minimum size of a fixed size window is its size. | 1608 | ;; The minimum size of a fixed size window is its size. |
| 1610 | (window-size window horizontal pixelwise)) | 1609 | (window-size window horizontal pixelwise)) |
| @@ -2739,30 +2738,32 @@ windows." | |||
| 2739 | (when (window-right window) | 2738 | (when (window-right window) |
| 2740 | (window--resize-reset-1 (window-right window) horizontal))) | 2739 | (window--resize-reset-1 (window-right window) horizontal))) |
| 2741 | 2740 | ||
| 2741 | ;; The following is the internal function used when resizing mini | ||
| 2742 | ;; windows "manually", for example, when dragging a divider between | ||
| 2743 | ;; root and mini window. The routines for automatic minibuffer window | ||
| 2744 | ;; resizing call `window--resize-root-window-vertically' instead. | ||
| 2742 | (defun window--resize-mini-window (window delta) | 2745 | (defun window--resize-mini-window (window delta) |
| 2743 | "Resize minibuffer window WINDOW by DELTA pixels. | 2746 | "Change height of mini window WINDOW by DELTA pixels. |
| 2744 | If WINDOW cannot be resized by DELTA pixels make it as large (or | 2747 | If WINDOW cannot be resized by DELTA pixels make it as large (or |
| 2745 | as small) as possible, but don't signal an error." | 2748 | as small) as possible, but don't signal an error." |
| 2746 | (when (window-minibuffer-p window) | 2749 | (when (window-minibuffer-p window) |
| 2747 | (let* ((frame (window-frame window)) | 2750 | (let* ((frame (window-frame window)) |
| 2748 | (root (frame-root-window frame)) | 2751 | (root (frame-root-window frame)) |
| 2749 | (height (window-pixel-height window)) | 2752 | (height (window-pixel-height window)) |
| 2750 | (min-delta | 2753 | (min-height (+ (frame-char-height frame) |
| 2751 | (- (window-pixel-height root) | 2754 | (- (window-pixel-height window) |
| 2752 | (window-min-size root nil nil t)))) | 2755 | (window-body-height window t)))) |
| 2753 | ;; Sanitize DELTA. | 2756 | (max-delta (- (window-pixel-height root) |
| 2754 | (cond | 2757 | (window-min-size root nil nil t)))) |
| 2755 | ((<= (+ height delta) 0) | 2758 | ;; Don't make mini window too small. |
| 2756 | (setq delta (- (frame-char-height frame) height))) | 2759 | (when (< (+ height delta) min-height) |
| 2757 | ((> delta min-delta) | 2760 | (setq delta (- min-height height))) |
| 2758 | (setq delta min-delta))) | 2761 | ;; Don't make root window too small. |
| 2762 | (when (> delta max-delta) | ||
| 2763 | (setq delta max-delta)) | ||
| 2759 | 2764 | ||
| 2760 | (unless (zerop delta) | 2765 | (unless (zerop delta) |
| 2761 | ;; Resize now. | ||
| 2762 | (window--resize-reset frame) | 2766 | (window--resize-reset frame) |
| 2763 | ;; Ideally we should be able to resize just the last child of root | ||
| 2764 | ;; here. See the comment in `resize-root-window-vertically' for | ||
| 2765 | ;; why we do not do that. | ||
| 2766 | (window--resize-this-window root (- delta) nil nil t) | 2767 | (window--resize-this-window root (- delta) nil nil t) |
| 2767 | (set-window-new-pixel window (+ height delta)) | 2768 | (set-window-new-pixel window (+ height delta)) |
| 2768 | ;; The following routine catches the case where we want to resize | 2769 | ;; The following routine catches the case where we want to resize |
| @@ -5881,7 +5882,7 @@ value can be also stored on disk and read back in a new session." | |||
| 5881 | (let ((scroll-bars (cdr (assq 'scroll-bars state)))) | 5882 | (let ((scroll-bars (cdr (assq 'scroll-bars state)))) |
| 5882 | (set-window-scroll-bars | 5883 | (set-window-scroll-bars |
| 5883 | window (car scroll-bars) (nth 2 scroll-bars) | 5884 | window (car scroll-bars) (nth 2 scroll-bars) |
| 5884 | (nth 3 scroll-bars) (nth 5 scroll-bars))) | 5885 | (nth 3 scroll-bars) (nth 5 scroll-bars) (nth 6 scroll-bars))) |
| 5885 | (set-window-vscroll window (cdr (assq 'vscroll state))) | 5886 | (set-window-vscroll window (cdr (assq 'vscroll state))) |
| 5886 | ;; Adjust vertically. | 5887 | ;; Adjust vertically. |
| 5887 | (if (or (memq window-size-fixed '(t height)) | 5888 | (if (or (memq window-size-fixed '(t height)) |
| @@ -8497,7 +8498,7 @@ parameters of FRAME." | |||
| 8497 | (if parent | 8498 | (if parent |
| 8498 | (frame-native-height parent) | 8499 | (frame-native-height parent) |
| 8499 | (- (nth 3 geometry) (nth 1 geometry)))) | 8500 | (- (nth 3 geometry) (nth 1 geometry)))) |
| 8500 | ;; FRAME'S parent or workarea sizes. Used when no margins | 8501 | ;; FRAME's parent or workarea sizes. Used when no margins |
| 8501 | ;; are specified. | 8502 | ;; are specified. |
| 8502 | (parent-or-workarea | 8503 | (parent-or-workarea |
| 8503 | (if parent | 8504 | (if parent |
diff --git a/src/frame.c b/src/frame.c index 6363a873684..d94de417e4d 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -712,7 +712,7 @@ adjust_frame_size (struct frame *f, int new_width, int new_height, int inhibit, | |||
| 712 | 712 | ||
| 713 | if (new_windows_width != old_windows_width) | 713 | if (new_windows_width != old_windows_width) |
| 714 | { | 714 | { |
| 715 | resize_frame_windows (f, new_windows_width, 1, 1); | 715 | resize_frame_windows (f, new_windows_width, true); |
| 716 | 716 | ||
| 717 | /* MSDOS frames cannot PRETEND, as they change frame size by | 717 | /* MSDOS frames cannot PRETEND, as they change frame size by |
| 718 | manipulating video hardware. */ | 718 | manipulating video hardware. */ |
| @@ -737,7 +737,7 @@ adjust_frame_size (struct frame *f, int new_width, int new_height, int inhibit, | |||
| 737 | left edges. */ | 737 | left edges. */ |
| 738 | || WINDOW_TOP_PIXEL_EDGE (r) != FRAME_TOP_MARGIN_HEIGHT (f)) | 738 | || WINDOW_TOP_PIXEL_EDGE (r) != FRAME_TOP_MARGIN_HEIGHT (f)) |
| 739 | { | 739 | { |
| 740 | resize_frame_windows (f, new_windows_height, 0, 1); | 740 | resize_frame_windows (f, new_windows_height, false); |
| 741 | 741 | ||
| 742 | /* MSDOS frames cannot PRETEND, as they change frame size by | 742 | /* MSDOS frames cannot PRETEND, as they change frame size by |
| 743 | manipulating video hardware. */ | 743 | manipulating video hardware. */ |
| @@ -931,15 +931,11 @@ make_frame (bool mini_p) | |||
| 931 | } | 931 | } |
| 932 | 932 | ||
| 933 | if (mini_p) | 933 | if (mini_p) |
| 934 | { | 934 | set_window_buffer (mini_window, |
| 935 | set_window_buffer (mini_window, | 935 | (NILP (Vminibuffer_list) |
| 936 | (NILP (Vminibuffer_list) | 936 | ? get_minibuffer (0) |
| 937 | ? get_minibuffer (0) | 937 | : Fcar (Vminibuffer_list)), |
| 938 | : Fcar (Vminibuffer_list)), | 938 | 0, 0); |
| 939 | 0, 0); | ||
| 940 | /* No horizontal scroll bars in minibuffers. */ | ||
| 941 | wset_horizontal_scroll_bar (mw, Qnil); | ||
| 942 | } | ||
| 943 | 939 | ||
| 944 | fset_root_window (f, root_window); | 940 | fset_root_window (f, root_window); |
| 945 | fset_selected_window (f, root_window); | 941 | fset_selected_window (f, root_window); |
diff --git a/src/window.c b/src/window.c index 1b205367275..9a0a9a115c2 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -59,12 +59,13 @@ static void select_window_1 (Lisp_Object, bool); | |||
| 59 | static void run_window_configuration_change_hook (struct frame *); | 59 | static void run_window_configuration_change_hook (struct frame *); |
| 60 | 60 | ||
| 61 | static struct window *set_window_fringes (struct window *, Lisp_Object, | 61 | static struct window *set_window_fringes (struct window *, Lisp_Object, |
| 62 | Lisp_Object, Lisp_Object); | 62 | Lisp_Object, Lisp_Object, |
| 63 | Lisp_Object); | ||
| 63 | static struct window *set_window_margins (struct window *, Lisp_Object, | 64 | static struct window *set_window_margins (struct window *, Lisp_Object, |
| 64 | Lisp_Object); | 65 | Lisp_Object); |
| 65 | static struct window *set_window_scroll_bars (struct window *, Lisp_Object, | 66 | static struct window *set_window_scroll_bars (struct window *, Lisp_Object, |
| 66 | Lisp_Object, Lisp_Object, | 67 | Lisp_Object, Lisp_Object, |
| 67 | Lisp_Object); | 68 | Lisp_Object, Lisp_Object); |
| 68 | static void apply_window_adjustment (struct window *); | 69 | static void apply_window_adjustment (struct window *); |
| 69 | 70 | ||
| 70 | /* This is the window in which the terminal's cursor should | 71 | /* This is the window in which the terminal's cursor should |
| @@ -3983,14 +3984,18 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, | |||
| 3983 | 3984 | ||
| 3984 | if (!keep_margins_p) | 3985 | if (!keep_margins_p) |
| 3985 | { | 3986 | { |
| 3986 | /* Set left and right marginal area width etc. from buffer. */ | 3987 | /* Set fringes and scroll bars from buffer unless they have been |
| 3987 | set_window_fringes (w, BVAR (b, left_fringe_width), | 3988 | declared as persistent. */ |
| 3988 | BVAR (b, right_fringe_width), | 3989 | if (!w->fringes_persistent) |
| 3989 | BVAR (b, fringes_outside_margins)); | 3990 | set_window_fringes (w, BVAR (b, left_fringe_width), |
| 3990 | set_window_scroll_bars (w, BVAR (b, scroll_bar_width), | 3991 | BVAR (b, right_fringe_width), |
| 3991 | BVAR (b, vertical_scroll_bar_type), | 3992 | BVAR (b, fringes_outside_margins), Qnil); |
| 3992 | BVAR (b, scroll_bar_height), | 3993 | if (!w->scroll_bars_persistent) |
| 3993 | BVAR (b, horizontal_scroll_bar_type)); | 3994 | set_window_scroll_bars (w, BVAR (b, scroll_bar_width), |
| 3995 | BVAR (b, vertical_scroll_bar_type), | ||
| 3996 | BVAR (b, scroll_bar_height), | ||
| 3997 | BVAR (b, horizontal_scroll_bar_type), Qnil); | ||
| 3998 | /* Set left and right marginal area width from buffer. */ | ||
| 3994 | set_window_margins (w, BVAR (b, left_margin_cols), | 3999 | set_window_margins (w, BVAR (b, left_margin_cols), |
| 3995 | BVAR (b, right_margin_cols)); | 4000 | BVAR (b, right_margin_cols)); |
| 3996 | apply_window_adjustment (w); | 4001 | apply_window_adjustment (w); |
| @@ -4661,78 +4666,49 @@ values. */) | |||
| 4661 | } | 4666 | } |
| 4662 | 4667 | ||
| 4663 | 4668 | ||
| 4664 | /* Resize frame F's windows when F's width or height is set to SIZE. | 4669 | /** |
| 4665 | If HORFLAG is zero, F's width was set to SIZE, otherwise its height | 4670 | Resize frame F's windows when F's inner height (inner width if HORFLAG |
| 4666 | was set. SIZE is interpreted in F's canonical character units | 4671 | is true) has been set to SIZE pixels. */ |
| 4667 | (a.k.a. "columns" or "lines"), unless PIXELWISE is non-zero, which | ||
| 4668 | means to interpret SIZE in pixel units. */ | ||
| 4669 | void | 4672 | void |
| 4670 | resize_frame_windows (struct frame *f, int size, bool horflag, bool pixelwise) | 4673 | resize_frame_windows (struct frame *f, int size, bool horflag) |
| 4671 | { | 4674 | { |
| 4672 | Lisp_Object root = f->root_window; | 4675 | Lisp_Object root = f->root_window; |
| 4673 | struct window *r = XWINDOW (root); | 4676 | struct window *r = XWINDOW (root); |
| 4674 | Lisp_Object mini = f->minibuffer_window; | ||
| 4675 | struct window *m; | ||
| 4676 | /* old_size is the old size of the frame's root window. */ | ||
| 4677 | int old_size = horflag ? r->total_cols : r->total_lines; | ||
| 4678 | int old_pixel_size = horflag ? r->pixel_width : r->pixel_height; | 4677 | int old_pixel_size = horflag ? r->pixel_width : r->pixel_height; |
| 4679 | /* new_size is the new size of the frame's root window. */ | ||
| 4680 | int new_size, new_pixel_size; | 4678 | int new_size, new_pixel_size; |
| 4681 | int unit = horflag ? FRAME_COLUMN_WIDTH (f) : FRAME_LINE_HEIGHT (f); | 4679 | int unit = horflag ? FRAME_COLUMN_WIDTH (f) : FRAME_LINE_HEIGHT (f); |
| 4680 | Lisp_Object mini = f->minibuffer_window; | ||
| 4681 | struct window *m = WINDOWP (mini) ? XWINDOW (mini) : NULL; | ||
| 4682 | int mini_height = ((FRAME_HAS_MINIBUF_P (f) && !FRAME_MINIBUF_ONLY_P (f)) | ||
| 4683 | ? unit + m->pixel_height - window_body_height (m, true) | ||
| 4684 | : 0); | ||
| 4682 | 4685 | ||
| 4683 | /* Don't let the size drop below one unit. This is more comforting | 4686 | new_pixel_size = max (horflag ? size : size - mini_height, unit); |
| 4684 | when we are called from *_set_tool_bar_lines since the latter may | 4687 | new_size = new_pixel_size / unit; |
| 4685 | have implicitly given us a zero or negative height. */ | ||
| 4686 | if (pixelwise) | ||
| 4687 | { | ||
| 4688 | /* Note: This does not include the size for internal borders | ||
| 4689 | since these are not part of the frame's text area. */ | ||
| 4690 | new_pixel_size = max (horflag | ||
| 4691 | ? size | ||
| 4692 | : (size | ||
| 4693 | - ((FRAME_HAS_MINIBUF_P (f) | ||
| 4694 | && !FRAME_MINIBUF_ONLY_P (f)) | ||
| 4695 | ? FRAME_LINE_HEIGHT (f) : 0)), | ||
| 4696 | unit); | ||
| 4697 | new_size = new_pixel_size / unit; | ||
| 4698 | } | ||
| 4699 | else | ||
| 4700 | { | ||
| 4701 | new_size = max (size - (!horflag | ||
| 4702 | && FRAME_HAS_MINIBUF_P (f) | ||
| 4703 | && !FRAME_MINIBUF_ONLY_P (f)), | ||
| 4704 | 1); | ||
| 4705 | new_pixel_size = new_size * unit; | ||
| 4706 | } | ||
| 4707 | 4688 | ||
| 4708 | if (new_pixel_size == old_pixel_size | 4689 | if (new_pixel_size == old_pixel_size |
| 4709 | && (horflag || r->pixel_top == FRAME_TOP_MARGIN_HEIGHT (f))) | 4690 | && (horflag || r->pixel_top == FRAME_TOP_MARGIN_HEIGHT (f))) |
| 4710 | ; | 4691 | ; |
| 4711 | else if (WINDOW_LEAF_P (r)) | 4692 | else if (WINDOW_LEAF_P (r)) |
| 4712 | /* For a leaf root window just set the size. */ | 4693 | { |
| 4713 | if (horflag) | 4694 | /* For a leaf root window just set the size. */ |
| 4714 | { | 4695 | if (horflag) |
| 4715 | bool changed = r->pixel_width != new_pixel_size; | 4696 | { |
| 4716 | 4697 | r->total_cols = new_size; | |
| 4717 | r->total_cols = new_size; | 4698 | r->pixel_width = new_pixel_size; |
| 4718 | r->pixel_width = new_pixel_size; | 4699 | } |
| 4719 | 4700 | else | |
| 4720 | if (changed && !WINDOW_PSEUDO_P (r)) | 4701 | { |
| 4721 | FRAME_WINDOW_CHANGE (f) = true; | 4702 | r->top_line = FRAME_TOP_MARGIN (f); |
| 4722 | } | 4703 | r->pixel_top = FRAME_TOP_MARGIN_HEIGHT (f); |
| 4723 | else | ||
| 4724 | { | ||
| 4725 | bool changed = r->pixel_height != new_pixel_size; | ||
| 4726 | |||
| 4727 | r->top_line = FRAME_TOP_MARGIN (f); | ||
| 4728 | r->pixel_top = FRAME_TOP_MARGIN_HEIGHT (f); | ||
| 4729 | 4704 | ||
| 4730 | r->total_lines = new_size; | 4705 | r->total_lines = new_size; |
| 4731 | r->pixel_height = new_pixel_size; | 4706 | r->pixel_height = new_pixel_size; |
| 4707 | } | ||
| 4732 | 4708 | ||
| 4733 | if (changed && !WINDOW_PSEUDO_P (r)) | 4709 | FRAME_WINDOW_CHANGE (f) |
| 4734 | FRAME_WINDOW_CHANGE (f) = true; | 4710 | = !WINDOW_PSEUDO_P (r) && new_pixel_size != old_pixel_size; |
| 4735 | } | 4711 | } |
| 4736 | else | 4712 | else |
| 4737 | { | 4713 | { |
| 4738 | Lisp_Object delta; | 4714 | Lisp_Object delta; |
| @@ -4743,14 +4719,10 @@ resize_frame_windows (struct frame *f, int size, bool horflag, bool pixelwise) | |||
| 4743 | r->pixel_top = FRAME_TOP_MARGIN_HEIGHT (f); | 4719 | r->pixel_top = FRAME_TOP_MARGIN_HEIGHT (f); |
| 4744 | } | 4720 | } |
| 4745 | 4721 | ||
| 4746 | if (pixelwise) | 4722 | XSETINT (delta, new_pixel_size - old_pixel_size); |
| 4747 | XSETINT (delta, new_pixel_size - old_pixel_size); | ||
| 4748 | else | ||
| 4749 | XSETINT (delta, new_size - old_size); | ||
| 4750 | 4723 | ||
| 4751 | /* Try a "normal" resize first. */ | 4724 | /* Try a "normal" resize first. */ |
| 4752 | resize_root_window (root, delta, horflag ? Qt : Qnil, Qnil, | 4725 | resize_root_window (root, delta, horflag ? Qt : Qnil, Qnil, Qt); |
| 4753 | pixelwise ? Qt : Qnil); | ||
| 4754 | if (window_resize_check (r, horflag) | 4726 | if (window_resize_check (r, horflag) |
| 4755 | && new_pixel_size == XFIXNUM (r->new_pixel)) | 4727 | && new_pixel_size == XFIXNUM (r->new_pixel)) |
| 4756 | { | 4728 | { |
| @@ -4760,8 +4732,7 @@ resize_frame_windows (struct frame *f, int size, bool horflag, bool pixelwise) | |||
| 4760 | else | 4732 | else |
| 4761 | { | 4733 | { |
| 4762 | /* Try with "reasonable" minimum sizes next. */ | 4734 | /* Try with "reasonable" minimum sizes next. */ |
| 4763 | resize_root_window (root, delta, horflag ? Qt : Qnil, Qt, | 4735 | resize_root_window (root, delta, horflag ? Qt : Qnil, Qt, Qt); |
| 4764 | pixelwise ? Qt : Qnil); | ||
| 4765 | if (window_resize_check (r, horflag) | 4736 | if (window_resize_check (r, horflag) |
| 4766 | && new_pixel_size == XFIXNUM (r->new_pixel)) | 4737 | && new_pixel_size == XFIXNUM (r->new_pixel)) |
| 4767 | { | 4738 | { |
| @@ -4781,9 +4752,8 @@ resize_frame_windows (struct frame *f, int size, bool horflag, bool pixelwise) | |||
| 4781 | } | 4752 | } |
| 4782 | else | 4753 | else |
| 4783 | { | 4754 | { |
| 4784 | /* Are we sure we always want 1 line here? */ | 4755 | m->total_lines = mini_height / unit; |
| 4785 | m->total_lines = 1; | 4756 | m->pixel_height = mini_height; |
| 4786 | m->pixel_height = FRAME_LINE_HEIGHT (f); | ||
| 4787 | m->top_line = r->top_line + r->total_lines; | 4757 | m->top_line = r->top_line + r->total_lines; |
| 4788 | m->pixel_top = r->pixel_top + r->pixel_height; | 4758 | m->pixel_top = r->pixel_top + r->pixel_height; |
| 4789 | } | 4759 | } |
| @@ -5211,17 +5181,11 @@ void | |||
| 5211 | grow_mini_window (struct window *w, int delta) | 5181 | grow_mini_window (struct window *w, int delta) |
| 5212 | { | 5182 | { |
| 5213 | struct frame *f = XFRAME (w->frame); | 5183 | struct frame *f = XFRAME (w->frame); |
| 5214 | int old_height = WINDOW_PIXEL_HEIGHT (w); | 5184 | int old_height = window_body_height (w, true); |
| 5215 | int min_height = FRAME_LINE_HEIGHT (f); | ||
| 5216 | 5185 | ||
| 5217 | eassert (MINI_WINDOW_P (w)); | 5186 | eassert (MINI_WINDOW_P (w)); |
| 5218 | 5187 | ||
| 5219 | if (old_height + delta < min_height) | 5188 | if ((delta != 0) && (old_height + delta >= FRAME_LINE_HEIGHT (f))) |
| 5220 | /* Never shrink mini-window to less than its minimum | ||
| 5221 | height. */ | ||
| 5222 | delta = old_height > min_height ? min_height - old_height : 0; | ||
| 5223 | |||
| 5224 | if (delta != 0) | ||
| 5225 | { | 5189 | { |
| 5226 | Lisp_Object root = FRAME_ROOT_WINDOW (f); | 5190 | Lisp_Object root = FRAME_ROOT_WINDOW (f); |
| 5227 | struct window *r = XWINDOW (root); | 5191 | struct window *r = XWINDOW (root); |
| @@ -5246,7 +5210,7 @@ void | |||
| 5246 | shrink_mini_window (struct window *w) | 5210 | shrink_mini_window (struct window *w) |
| 5247 | { | 5211 | { |
| 5248 | struct frame *f = XFRAME (w->frame); | 5212 | struct frame *f = XFRAME (w->frame); |
| 5249 | int delta = WINDOW_PIXEL_HEIGHT (w) - FRAME_LINE_HEIGHT (f); | 5213 | int delta = window_body_height (w, true) - FRAME_LINE_HEIGHT (f); |
| 5250 | 5214 | ||
| 5251 | eassert (MINI_WINDOW_P (w)); | 5215 | eassert (MINI_WINDOW_P (w)); |
| 5252 | 5216 | ||
| @@ -5263,6 +5227,11 @@ shrink_mini_window (struct window *w) | |||
| 5263 | if (FIXNUMP (grow) && window_resize_check (r, false)) | 5227 | if (FIXNUMP (grow) && window_resize_check (r, false)) |
| 5264 | resize_mini_window_apply (w, -XFIXNUM (grow)); | 5228 | resize_mini_window_apply (w, -XFIXNUM (grow)); |
| 5265 | } | 5229 | } |
| 5230 | else if (delta < 0) | ||
| 5231 | /* delta can be less than zero after adding horizontal scroll | ||
| 5232 | bar. */ | ||
| 5233 | grow_mini_window (w, -delta); | ||
| 5234 | |||
| 5266 | } | 5235 | } |
| 5267 | 5236 | ||
| 5268 | DEFUN ("resize-mini-window-internal", Fresize_mini_window_internal, | 5237 | DEFUN ("resize-mini-window-internal", Fresize_mini_window_internal, |
| @@ -6740,9 +6709,11 @@ struct saved_window | |||
| 6740 | Lisp_Object start_at_line_beg; | 6709 | Lisp_Object start_at_line_beg; |
| 6741 | Lisp_Object display_table; | 6710 | Lisp_Object display_table; |
| 6742 | Lisp_Object left_margin_cols, right_margin_cols; | 6711 | Lisp_Object left_margin_cols, right_margin_cols; |
| 6743 | Lisp_Object left_fringe_width, right_fringe_width, fringes_outside_margins; | 6712 | Lisp_Object left_fringe_width, right_fringe_width; |
| 6744 | Lisp_Object scroll_bar_width, vertical_scroll_bar_type, dedicated; | 6713 | Lisp_Object fringes_outside_margins, fringes_persistent; |
| 6714 | Lisp_Object scroll_bar_width, vertical_scroll_bar_type; | ||
| 6745 | Lisp_Object scroll_bar_height, horizontal_scroll_bar_type; | 6715 | Lisp_Object scroll_bar_height, horizontal_scroll_bar_type; |
| 6716 | Lisp_Object scroll_bars_persistent, dedicated; | ||
| 6746 | Lisp_Object combination_limit, window_parameters; | 6717 | Lisp_Object combination_limit, window_parameters; |
| 6747 | }; | 6718 | }; |
| 6748 | 6719 | ||
| @@ -6957,8 +6928,10 @@ the return value is nil. Otherwise the value is t. */) | |||
| 6957 | w->left_fringe_width = XFIXNUM (p->left_fringe_width); | 6928 | w->left_fringe_width = XFIXNUM (p->left_fringe_width); |
| 6958 | w->right_fringe_width = XFIXNUM (p->right_fringe_width); | 6929 | w->right_fringe_width = XFIXNUM (p->right_fringe_width); |
| 6959 | w->fringes_outside_margins = !NILP (p->fringes_outside_margins); | 6930 | w->fringes_outside_margins = !NILP (p->fringes_outside_margins); |
| 6931 | w->fringes_persistent = !NILP (p->fringes_persistent); | ||
| 6960 | w->scroll_bar_width = XFIXNUM (p->scroll_bar_width); | 6932 | w->scroll_bar_width = XFIXNUM (p->scroll_bar_width); |
| 6961 | w->scroll_bar_height = XFIXNUM (p->scroll_bar_height); | 6933 | w->scroll_bar_height = XFIXNUM (p->scroll_bar_height); |
| 6934 | w->scroll_bars_persistent = !NILP (p->scroll_bars_persistent); | ||
| 6962 | wset_vertical_scroll_bar_type (w, p->vertical_scroll_bar_type); | 6935 | wset_vertical_scroll_bar_type (w, p->vertical_scroll_bar_type); |
| 6963 | wset_horizontal_scroll_bar_type (w, p->horizontal_scroll_bar_type); | 6936 | wset_horizontal_scroll_bar_type (w, p->horizontal_scroll_bar_type); |
| 6964 | wset_dedicated (w, p->dedicated); | 6937 | wset_dedicated (w, p->dedicated); |
| @@ -7279,8 +7252,10 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, ptrdiff_t i) | |||
| 7279 | p->left_fringe_width = make_fixnum (w->left_fringe_width); | 7252 | p->left_fringe_width = make_fixnum (w->left_fringe_width); |
| 7280 | p->right_fringe_width = make_fixnum (w->right_fringe_width); | 7253 | p->right_fringe_width = make_fixnum (w->right_fringe_width); |
| 7281 | p->fringes_outside_margins = w->fringes_outside_margins ? Qt : Qnil; | 7254 | p->fringes_outside_margins = w->fringes_outside_margins ? Qt : Qnil; |
| 7255 | p->fringes_persistent = w->fringes_persistent ? Qt : Qnil; | ||
| 7282 | p->scroll_bar_width = make_fixnum (w->scroll_bar_width); | 7256 | p->scroll_bar_width = make_fixnum (w->scroll_bar_width); |
| 7283 | p->scroll_bar_height = make_fixnum (w->scroll_bar_height); | 7257 | p->scroll_bar_height = make_fixnum (w->scroll_bar_height); |
| 7258 | p->scroll_bars_persistent = w->scroll_bars_persistent ? Qt : Qnil; | ||
| 7284 | p->vertical_scroll_bar_type = w->vertical_scroll_bar_type; | 7259 | p->vertical_scroll_bar_type = w->vertical_scroll_bar_type; |
| 7285 | p->horizontal_scroll_bar_type = w->horizontal_scroll_bar_type; | 7260 | p->horizontal_scroll_bar_type = w->horizontal_scroll_bar_type; |
| 7286 | p->dedicated = w->dedicated; | 7261 | p->dedicated = w->dedicated; |
| @@ -7516,49 +7491,71 @@ as nil. */) | |||
| 7516 | ***********************************************************************/ | 7491 | ***********************************************************************/ |
| 7517 | 7492 | ||
| 7518 | static struct window * | 7493 | static struct window * |
| 7519 | set_window_fringes (struct window *w, Lisp_Object left_width, | 7494 | set_window_fringes (struct window *w, |
| 7520 | Lisp_Object right_width, Lisp_Object outside_margins) | 7495 | Lisp_Object left_width, Lisp_Object right_width, |
| 7496 | Lisp_Object outside_margins, Lisp_Object persistent) | ||
| 7521 | { | 7497 | { |
| 7522 | bool outside = !NILP (outside_margins); | 7498 | /* Do nothing on a tty. */ |
| 7523 | int left = extract_dimension (left_width); | 7499 | if (!FRAME_WINDOW_P (WINDOW_XFRAME (w))) |
| 7524 | int right = extract_dimension (right_width); | 7500 | return NULL; |
| 7525 | 7501 | else | |
| 7526 | /* Do nothing on a tty or if nothing to actually change. */ | ||
| 7527 | if (FRAME_WINDOW_P (WINDOW_XFRAME (w)) | ||
| 7528 | && (w->left_fringe_width != left | ||
| 7529 | || w->right_fringe_width != right | ||
| 7530 | || w->fringes_outside_margins != outside)) | ||
| 7531 | { | 7502 | { |
| 7532 | if (left > 0 || right > 0) | 7503 | struct frame *f = XFRAME (WINDOW_FRAME (w)); |
| 7504 | int old_left = WINDOW_LEFT_FRINGE_WIDTH (w); | ||
| 7505 | int old_right = WINDOW_RIGHT_FRINGE_WIDTH (w); | ||
| 7506 | int new_left = extract_dimension (left_width); | ||
| 7507 | int new_right = extract_dimension (right_width); | ||
| 7508 | bool outside = !NILP (outside_margins); | ||
| 7509 | bool changed = false; | ||
| 7510 | bool failed = false; | ||
| 7511 | |||
| 7512 | /* Check dimensions of new fringes. Make changes only if they | ||
| 7513 | fit the window's dimensions. */ | ||
| 7514 | if ((WINDOW_PIXEL_WIDTH (w) | ||
| 7515 | - WINDOW_MARGINS_WIDTH (w) | ||
| 7516 | - WINDOW_SCROLL_BAR_AREA_WIDTH (w) | ||
| 7517 | - WINDOW_RIGHT_DIVIDER_WIDTH (w) | ||
| 7518 | - (new_left == -1 ? FRAME_LEFT_FRINGE_WIDTH (f) : new_left) | ||
| 7519 | - (new_right == -1 ? FRAME_RIGHT_FRINGE_WIDTH (f) : new_right)) | ||
| 7520 | >= MIN_SAFE_WINDOW_PIXEL_WIDTH (w)) | ||
| 7521 | { | ||
| 7522 | w->left_fringe_width = new_left; | ||
| 7523 | w->right_fringe_width = new_right; | ||
| 7524 | changed = new_left != old_left || new_right != old_right; | ||
| 7525 | } | ||
| 7526 | else | ||
| 7527 | failed = true; | ||
| 7528 | |||
| 7529 | /* Placing fringes ouside margins. */ | ||
| 7530 | if (outside != w->fringes_outside_margins) | ||
| 7533 | { | 7531 | { |
| 7534 | /* Don't change anything if new fringes don't fit. */ | 7532 | w->fringes_outside_margins = outside; |
| 7535 | if ((WINDOW_PIXEL_WIDTH (w) | 7533 | changed = true; |
| 7536 | - WINDOW_MARGINS_WIDTH (w) | ||
| 7537 | - WINDOW_SCROLL_BAR_AREA_WIDTH (w) | ||
| 7538 | - max (left, 0) - max (right, 0)) | ||
| 7539 | < MIN_SAFE_WINDOW_PIXEL_WIDTH (w)) | ||
| 7540 | return NULL; | ||
| 7541 | } | 7534 | } |
| 7542 | 7535 | ||
| 7543 | w->left_fringe_width = left; | 7536 | /* Make settings persistent unless we failed to apply some |
| 7544 | w->right_fringe_width = right; | 7537 | changes. */ |
| 7545 | w->fringes_outside_margins = outside; | 7538 | if (!failed) |
| 7539 | w->fringes_persistent = !NILP (persistent); | ||
| 7546 | 7540 | ||
| 7547 | /* This is needed to trigger immediate redisplay of the window | 7541 | /* This is needed to trigger immediate redisplay of the window |
| 7548 | when its fringes are changed, because fringes are redrawn | 7542 | when its fringes are changed, because fringes are redrawn |
| 7549 | only if update_window is called, so we must trigger that even | 7543 | only if update_window is called, so we must trigger that even |
| 7550 | if the window's glyph matrices did not change at all. */ | 7544 | if the window's glyph matrices did not change at all. */ |
| 7551 | windows_or_buffers_changed = 35; | 7545 | if (changed) |
| 7552 | return w; | 7546 | { |
| 7547 | windows_or_buffers_changed = 35; | ||
| 7548 | return w; | ||
| 7549 | } | ||
| 7550 | else | ||
| 7551 | return NULL; | ||
| 7553 | } | 7552 | } |
| 7554 | else | ||
| 7555 | return NULL; | ||
| 7556 | } | 7553 | } |
| 7557 | 7554 | ||
| 7558 | DEFUN ("set-window-fringes", Fset_window_fringes, Sset_window_fringes, | 7555 | DEFUN ("set-window-fringes", Fset_window_fringes, Sset_window_fringes, |
| 7559 | 2, 4, 0, | 7556 | 2, 5, 0, |
| 7560 | doc: /* Set the fringe widths of window WINDOW. | 7557 | doc: /* Set fringes of specified WINDOW. |
| 7561 | WINDOW must be a live window and defaults to the selected one. | 7558 | WINDOW must specify a live window and defaults to the selected one. |
| 7562 | 7559 | ||
| 7563 | Second arg LEFT-WIDTH specifies the number of pixels to reserve for | 7560 | Second arg LEFT-WIDTH specifies the number of pixels to reserve for |
| 7564 | the left fringe. Optional third arg RIGHT-WIDTH specifies the right | 7561 | the left fringe. Optional third arg RIGHT-WIDTH specifies the right |
| @@ -7570,32 +7567,40 @@ If optional fourth arg OUTSIDE-MARGINS is non-nil, draw the fringes | |||
| 7570 | outside of the display margins. By default, fringes are drawn between | 7567 | outside of the display margins. By default, fringes are drawn between |
| 7571 | display marginal areas and the text area. | 7568 | display marginal areas and the text area. |
| 7572 | 7569 | ||
| 7570 | Optional fifth argument PERSISTENT non-nil means that fringe settings | ||
| 7571 | for WINDOW are persistent, i.e., remain unchanged when another buffer | ||
| 7572 | is shown in WINDOW. PERSISTENT nil means that fringes are reset from | ||
| 7573 | buffer local values when 'set-window-buffer' is called on WINDOW with | ||
| 7574 | the argument KEEP-MARGINS nil. | ||
| 7575 | |||
| 7573 | Leave fringes unchanged if WINDOW is not large enough to accommodate | 7576 | Leave fringes unchanged if WINDOW is not large enough to accommodate |
| 7574 | fringes of the desired width. Return t if any fringe was actually | 7577 | fringes of the desired width. Return t if any fringe was actually |
| 7575 | changed and nil otherwise. */) | 7578 | changed and nil otherwise. */) |
| 7576 | (Lisp_Object window, Lisp_Object left_width, | 7579 | (Lisp_Object window, Lisp_Object left_width, Lisp_Object right_width, |
| 7577 | Lisp_Object right_width, Lisp_Object outside_margins) | 7580 | Lisp_Object outside_margins, Lisp_Object persistent) |
| 7578 | { | 7581 | { |
| 7579 | struct window *w | 7582 | struct window *w |
| 7580 | = set_window_fringes (decode_live_window (window), | 7583 | = set_window_fringes (decode_live_window (window), left_width, |
| 7581 | left_width, right_width, outside_margins); | 7584 | right_width, outside_margins, persistent); |
| 7582 | return w ? (apply_window_adjustment (w), Qt) : Qnil; | 7585 | return w ? (apply_window_adjustment (w), Qt) : Qnil; |
| 7583 | } | 7586 | } |
| 7584 | 7587 | ||
| 7585 | 7588 | ||
| 7586 | DEFUN ("window-fringes", Fwindow_fringes, Swindow_fringes, | 7589 | DEFUN ("window-fringes", Fwindow_fringes, Swindow_fringes, |
| 7587 | 0, 1, 0, | 7590 | 0, 1, 0, |
| 7588 | doc: /* Get width of fringes of window WINDOW. | 7591 | doc: /* Return fringe settings for specified WINDOW. |
| 7589 | WINDOW must be a live window and defaults to the selected one. | 7592 | WINDOW must be a live window and defaults to the selected one. |
| 7590 | 7593 | ||
| 7591 | Value is a list of the form (LEFT-WIDTH RIGHT-WIDTH OUTSIDE-MARGINS). */) | 7594 | Value is a list of the form (LEFT-WIDTH RIGHT-WIDTH OUTSIDE-MARGINS |
| 7595 | PERSISTENT), see `set-window-fringes'. */) | ||
| 7592 | (Lisp_Object window) | 7596 | (Lisp_Object window) |
| 7593 | { | 7597 | { |
| 7594 | struct window *w = decode_live_window (window); | 7598 | struct window *w = decode_live_window (window); |
| 7595 | 7599 | ||
| 7596 | return list3 (make_fixnum (WINDOW_LEFT_FRINGE_WIDTH (w)), | 7600 | return list4 (make_fixnum (WINDOW_LEFT_FRINGE_WIDTH (w)), |
| 7597 | make_fixnum (WINDOW_RIGHT_FRINGE_WIDTH (w)), | 7601 | make_fixnum (WINDOW_RIGHT_FRINGE_WIDTH (w)), |
| 7598 | WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w) ? Qt : Qnil); | 7602 | WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w) ? Qt : Qnil, |
| 7603 | w->fringes_persistent ? Qt : Qnil); | ||
| 7599 | } | 7604 | } |
| 7600 | 7605 | ||
| 7601 | 7606 | ||
| @@ -7607,105 +7612,127 @@ Value is a list of the form (LEFT-WIDTH RIGHT-WIDTH OUTSIDE-MARGINS). */) | |||
| 7607 | static struct window * | 7612 | static struct window * |
| 7608 | set_window_scroll_bars (struct window *w, Lisp_Object width, | 7613 | set_window_scroll_bars (struct window *w, Lisp_Object width, |
| 7609 | Lisp_Object vertical_type, Lisp_Object height, | 7614 | Lisp_Object vertical_type, Lisp_Object height, |
| 7610 | Lisp_Object horizontal_type) | 7615 | Lisp_Object horizontal_type, Lisp_Object persistent) |
| 7611 | { | 7616 | { |
| 7612 | int iwidth = extract_dimension (width); | 7617 | /* Do nothing on a tty. */ |
| 7613 | bool changed = false; | 7618 | if (!FRAME_WINDOW_P (WINDOW_XFRAME (w))) |
| 7614 | 7619 | return NULL; | |
| 7615 | if (iwidth == 0) | 7620 | else |
| 7616 | vertical_type = Qnil; | ||
| 7617 | |||
| 7618 | if (!(NILP (vertical_type) | ||
| 7619 | || EQ (vertical_type, Qleft) | ||
| 7620 | || EQ (vertical_type, Qright) | ||
| 7621 | || EQ (vertical_type, Qt))) | ||
| 7622 | error ("Invalid type of vertical scroll bar"); | ||
| 7623 | |||
| 7624 | if (w->scroll_bar_width != iwidth | ||
| 7625 | || !EQ (w->vertical_scroll_bar_type, vertical_type)) | ||
| 7626 | { | 7621 | { |
| 7627 | /* Don't change anything if new scroll bar won't fit. */ | 7622 | struct frame *f = XFRAME (WINDOW_FRAME (w)); |
| 7623 | int new_width = extract_dimension (width); | ||
| 7624 | bool changed = false; | ||
| 7625 | bool failed = false; | ||
| 7626 | |||
| 7627 | if (new_width == 0) | ||
| 7628 | vertical_type = Qnil; | ||
| 7629 | else if (!(NILP (vertical_type) | ||
| 7630 | || EQ (vertical_type, Qleft) | ||
| 7631 | || EQ (vertical_type, Qright) | ||
| 7632 | || EQ (vertical_type, Qt))) | ||
| 7633 | error ("Invalid type of vertical scroll bar"); | ||
| 7634 | |||
| 7635 | /* Check dimension of new scroll bar. Make changes only if it | ||
| 7636 | fit the window's dimensions. */ | ||
| 7628 | if ((WINDOW_PIXEL_WIDTH (w) | 7637 | if ((WINDOW_PIXEL_WIDTH (w) |
| 7629 | - WINDOW_MARGINS_WIDTH (w) | 7638 | - WINDOW_MARGINS_WIDTH (w) |
| 7630 | - WINDOW_FRINGES_WIDTH (w) | 7639 | - WINDOW_FRINGES_WIDTH (w) |
| 7631 | - max (iwidth, 0)) | 7640 | - WINDOW_RIGHT_DIVIDER_WIDTH (w) |
| 7641 | - (new_width == -1 ? FRAME_SCROLL_BAR_AREA_WIDTH (f) : new_width)) | ||
| 7632 | >= MIN_SAFE_WINDOW_PIXEL_WIDTH (w)) | 7642 | >= MIN_SAFE_WINDOW_PIXEL_WIDTH (w)) |
| 7633 | { | 7643 | { |
| 7634 | w->scroll_bar_width = iwidth; | 7644 | changed = (!EQ (vertical_type, w->vertical_scroll_bar_type) |
| 7645 | || new_width != WINDOW_SCROLL_BAR_AREA_WIDTH (w)); | ||
| 7635 | wset_vertical_scroll_bar_type (w, vertical_type); | 7646 | wset_vertical_scroll_bar_type (w, vertical_type); |
| 7636 | changed = true; | 7647 | w->scroll_bar_width = new_width; |
| 7637 | } | 7648 | } |
| 7638 | } | 7649 | else |
| 7650 | failed = true; | ||
| 7639 | 7651 | ||
| 7640 | #if USE_HORIZONTAL_SCROLL_BARS | 7652 | #if USE_HORIZONTAL_SCROLL_BARS |
| 7641 | { | 7653 | int new_height = extract_dimension (height); |
| 7642 | int iheight = extract_dimension (height); | ||
| 7643 | 7654 | ||
| 7644 | if (MINI_WINDOW_P (w) || iheight == 0) | 7655 | if ((MINI_WINDOW_P (w) && !EQ (horizontal_type, Qbottom)) |
| 7645 | horizontal_type = Qnil; | 7656 | || new_height == 0) |
| 7657 | horizontal_type = Qnil; | ||
| 7646 | 7658 | ||
| 7647 | if (!(NILP (horizontal_type) | 7659 | if (!(NILP (horizontal_type) |
| 7648 | || EQ (horizontal_type, Qbottom) | 7660 | || EQ (horizontal_type, Qbottom) |
| 7649 | || EQ (horizontal_type, Qt))) | 7661 | || EQ (horizontal_type, Qt))) |
| 7650 | error ("Invalid type of horizontal scroll bar"); | 7662 | error ("Invalid type of horizontal scroll bar"); |
| 7651 | 7663 | ||
| 7652 | if (w->scroll_bar_height != iheight | 7664 | /* Don't change anything if new scroll bar won't fit. */ |
| 7653 | || !EQ (w->horizontal_scroll_bar_type, horizontal_type)) | 7665 | if ((WINDOW_PIXEL_HEIGHT (w) |
| 7654 | { | 7666 | - WINDOW_HEADER_LINE_HEIGHT (w) |
| 7655 | /* Don't change anything if new scroll bar won't fit. */ | 7667 | - WINDOW_MODE_LINE_HEIGHT (w) |
| 7656 | if ((WINDOW_PIXEL_HEIGHT (w) | 7668 | - (new_height == -1 ? FRAME_SCROLL_BAR_AREA_HEIGHT (f) : new_height)) |
| 7657 | - WINDOW_HEADER_LINE_HEIGHT (w) | 7669 | >= MIN_SAFE_WINDOW_PIXEL_HEIGHT (w)) |
| 7658 | - WINDOW_MODE_LINE_HEIGHT (w) | 7670 | { |
| 7659 | - max (iheight, 0)) | 7671 | changed = (changed |
| 7660 | >= MIN_SAFE_WINDOW_PIXEL_HEIGHT (w)) | 7672 | || !EQ (horizontal_type, w->horizontal_scroll_bar_type) |
| 7661 | { | 7673 | || new_height != WINDOW_SCROLL_BAR_AREA_HEIGHT (w)); |
| 7662 | w->scroll_bar_height = iheight; | 7674 | wset_horizontal_scroll_bar_type (w, horizontal_type); |
| 7663 | wset_horizontal_scroll_bar_type (w, horizontal_type); | 7675 | w->scroll_bar_height = new_height; |
| 7664 | changed = true; | 7676 | } |
| 7665 | } | 7677 | else |
| 7666 | } | 7678 | failed = true; |
| 7667 | } | ||
| 7668 | #else | 7679 | #else |
| 7669 | wset_horizontal_scroll_bar_type (w, Qnil); | 7680 | wset_horizontal_scroll_bar_type (w, Qnil); |
| 7670 | #endif | 7681 | #endif |
| 7671 | 7682 | ||
| 7672 | /* This is needed to trigger immediate redisplay of the window when | 7683 | /* Make settings persistent unless we failed to apply some |
| 7673 | scroll bars are changed, because scroll bars are redisplayed only | 7684 | changes. */ |
| 7674 | if more than a single window needs to be considered, see | 7685 | if (!failed) |
| 7675 | redisplay_internal. */ | 7686 | w->scroll_bars_persistent = !NILP (persistent); |
| 7676 | if (changed) | 7687 | |
| 7677 | windows_or_buffers_changed = 31; | 7688 | /* This is needed to trigger immediate redisplay of the window when |
| 7678 | return changed ? w : NULL; | 7689 | scroll bars are changed, because scroll bars are redisplayed only |
| 7690 | if more than a single window needs to be considered, see | ||
| 7691 | redisplay_internal. */ | ||
| 7692 | if (changed) | ||
| 7693 | windows_or_buffers_changed = 31; | ||
| 7694 | |||
| 7695 | return changed ? w : NULL; | ||
| 7696 | } | ||
| 7679 | } | 7697 | } |
| 7680 | 7698 | ||
| 7681 | DEFUN ("set-window-scroll-bars", Fset_window_scroll_bars, | 7699 | DEFUN ("set-window-scroll-bars", Fset_window_scroll_bars, |
| 7682 | Sset_window_scroll_bars, 1, 5, 0, | 7700 | Sset_window_scroll_bars, 1, 6, 0, |
| 7683 | doc: /* Set width and type of scroll bars of window WINDOW. | 7701 | doc: /* Set width and type of scroll bars of specified WINDOW. |
| 7684 | WINDOW must be a live window and defaults to the selected one. | 7702 | WINDOW must specify a live window and defaults to the selected one. |
| 7685 | 7703 | ||
| 7686 | Second parameter WIDTH specifies the pixel width for the vertical scroll | 7704 | Second argument WIDTH specifies the pixel width for the vertical scroll |
| 7687 | bar. If WIDTH is nil, use the scroll bar width of WINDOW's frame. | 7705 | bar. If WIDTH is nil, use the scroll bar width of WINDOW's frame. |
| 7688 | Third parameter VERTICAL-TYPE specifies the type of the vertical scroll | 7706 | Third argument VERTICAL-TYPE specifies the type of the vertical scroll |
| 7689 | bar: left, right, nil or t where nil means to not display a vertical | 7707 | bar: left, right, nil or t where nil means to not display a vertical |
| 7690 | scroll bar on WINDOW and t means to use WINDOW frame's vertical scroll | 7708 | scroll bar on WINDOW and t means to use WINDOW frame's vertical scroll |
| 7691 | bar type. | 7709 | bar type. |
| 7692 | 7710 | ||
| 7693 | Fourth parameter HEIGHT specifies the pixel height for the horizontal | 7711 | Fourth argument HEIGHT specifies the pixel height for the horizontal |
| 7694 | scroll bar. If HEIGHT is nil, use the scroll bar height of WINDOW's | 7712 | scroll bar. If HEIGHT is nil, use the scroll bar height of WINDOW's |
| 7695 | frame. Fifth parameter HORIZONTAL-TYPE specifies the type of the | 7713 | frame. Fifth argument HORIZONTAL-TYPE specifies the type of the |
| 7696 | horizontal scroll bar: bottom, nil, or t where nil means to not display | 7714 | horizontal scroll bar: bottom, nil, or t where nil means to not |
| 7697 | a horizontal scroll bar on WINDOW and t means to use WINDOW frame's | 7715 | display a horizontal scroll bar on WINDOW and t means to use WINDOW |
| 7698 | horizontal scroll bar type. | 7716 | frame's horizontal scroll bar type. If WINDOW is a mini window, t |
| 7717 | effectively behaves like nil. HORIZONTAL-TYPE must equal bottom in | ||
| 7718 | order to show a scroll bar for mini windows. | ||
| 7719 | |||
| 7720 | Optional sixth argument PERSISTENT non-nil means that scroll bar | ||
| 7721 | settings for WINDOW are persistent, i.e., remain unchanged when | ||
| 7722 | another buffer is shown in WINDOW. PERSISTENT nil means that scroll | ||
| 7723 | bars are reset from buffer local values when 'set-window-buffer' is | ||
| 7724 | called on WINDOW with the argument KEEP-MARGINS nil. | ||
| 7699 | 7725 | ||
| 7700 | If WINDOW is not large enough to accommodate a scroll bar of the | 7726 | If WINDOW is not large enough to accommodate a scroll bar of the |
| 7701 | desired dimension, leave the corresponding scroll bar unchanged. | 7727 | desired dimension, leave the corresponding scroll bar unchanged. |
| 7702 | Return t if scroll bars were actually changed and nil otherwise. */) | 7728 | Return t if scroll bars were actually changed and nil otherwise. */) |
| 7703 | (Lisp_Object window, Lisp_Object width, Lisp_Object vertical_type, | 7729 | (Lisp_Object window, Lisp_Object width, Lisp_Object vertical_type, |
| 7704 | Lisp_Object height, Lisp_Object horizontal_type) | 7730 | Lisp_Object height, Lisp_Object horizontal_type, Lisp_Object persistent) |
| 7705 | { | 7731 | { |
| 7706 | struct window *w | 7732 | struct window *w |
| 7707 | = set_window_scroll_bars (decode_live_window (window), | 7733 | = set_window_scroll_bars (decode_live_window (window), |
| 7708 | width, vertical_type, height, horizontal_type); | 7734 | width, vertical_type, height, |
| 7735 | horizontal_type, persistent); | ||
| 7709 | return w ? (apply_window_adjustment (w), Qt) : Qnil; | 7736 | return w ? (apply_window_adjustment (w), Qt) : Qnil; |
| 7710 | } | 7737 | } |
| 7711 | 7738 | ||
| @@ -7716,9 +7743,9 @@ DEFUN ("window-scroll-bars", Fwindow_scroll_bars, Swindow_scroll_bars, | |||
| 7716 | WINDOW must be a live window and defaults to the selected one. | 7743 | WINDOW must be a live window and defaults to the selected one. |
| 7717 | 7744 | ||
| 7718 | Value is a list of the form (WIDTH COLUMNS VERTICAL-TYPE HEIGHT LINES | 7745 | Value is a list of the form (WIDTH COLUMNS VERTICAL-TYPE HEIGHT LINES |
| 7719 | HORIZONTAL-TYPE). If WIDTH or HEIGHT is nil or VERTICAL-TYPE or | 7746 | HORIZONTAL-TYPE PERSISTENT), see `set-window-scroll-bars'. If WIDTH |
| 7720 | HORIZONTAL-TYPE is t, the window is using the frame's corresponding | 7747 | or HEIGHT is nil or VERTICAL-TYPE or HORIZONTAL-TYPE is t, WINDOW is |
| 7721 | value. */) | 7748 | using the frame's corresponding value. */) |
| 7722 | (Lisp_Object window) | 7749 | (Lisp_Object window) |
| 7723 | { | 7750 | { |
| 7724 | struct window *w = decode_live_window (window); | 7751 | struct window *w = decode_live_window (window); |
| @@ -7726,13 +7753,14 @@ value. */) | |||
| 7726 | return Fcons (((w->scroll_bar_width >= 0) | 7753 | return Fcons (((w->scroll_bar_width >= 0) |
| 7727 | ? make_fixnum (w->scroll_bar_width) | 7754 | ? make_fixnum (w->scroll_bar_width) |
| 7728 | : Qnil), | 7755 | : Qnil), |
| 7729 | list5 (make_fixnum (WINDOW_SCROLL_BAR_COLS (w)), | 7756 | Fcons (make_fixnum (WINDOW_SCROLL_BAR_COLS (w)), |
| 7730 | w->vertical_scroll_bar_type, | 7757 | list5 (w->vertical_scroll_bar_type, |
| 7731 | ((w->scroll_bar_height >= 0) | 7758 | ((w->scroll_bar_height >= 0) |
| 7732 | ? make_fixnum (w->scroll_bar_height) | 7759 | ? make_fixnum (w->scroll_bar_height) |
| 7733 | : Qnil), | 7760 | : Qnil), |
| 7734 | make_fixnum (WINDOW_SCROLL_BAR_LINES (w)), | 7761 | make_fixnum (WINDOW_SCROLL_BAR_LINES (w)), |
| 7735 | w->horizontal_scroll_bar_type)); | 7762 | w->horizontal_scroll_bar_type, |
| 7763 | w->scroll_bars_persistent ? Qt : Qnil))); | ||
| 7736 | } | 7764 | } |
| 7737 | 7765 | ||
| 7738 | /*********************************************************************** | 7766 | /*********************************************************************** |
| @@ -7927,10 +7955,12 @@ compare_window_configurations (Lisp_Object configuration1, | |||
| 7927 | || !EQ (sw1->left_fringe_width, sw2->left_fringe_width) | 7955 | || !EQ (sw1->left_fringe_width, sw2->left_fringe_width) |
| 7928 | || !EQ (sw1->right_fringe_width, sw2->right_fringe_width) | 7956 | || !EQ (sw1->right_fringe_width, sw2->right_fringe_width) |
| 7929 | || !EQ (sw1->fringes_outside_margins, sw2->fringes_outside_margins) | 7957 | || !EQ (sw1->fringes_outside_margins, sw2->fringes_outside_margins) |
| 7958 | || !EQ (sw1->fringes_persistent, sw2->fringes_persistent) | ||
| 7930 | || !EQ (sw1->scroll_bar_width, sw2->scroll_bar_width) | 7959 | || !EQ (sw1->scroll_bar_width, sw2->scroll_bar_width) |
| 7931 | || !EQ (sw1->scroll_bar_height, sw2->scroll_bar_height) | 7960 | || !EQ (sw1->scroll_bar_height, sw2->scroll_bar_height) |
| 7932 | || !EQ (sw1->vertical_scroll_bar_type, sw2->vertical_scroll_bar_type) | 7961 | || !EQ (sw1->vertical_scroll_bar_type, sw2->vertical_scroll_bar_type) |
| 7933 | || !EQ (sw1->horizontal_scroll_bar_type, sw2->horizontal_scroll_bar_type)) | 7962 | || !EQ (sw1->horizontal_scroll_bar_type, sw2->horizontal_scroll_bar_type) |
| 7963 | || !EQ (sw1->scroll_bars_persistent, sw2->scroll_bars_persistent)) | ||
| 7934 | return false; | 7964 | return false; |
| 7935 | } | 7965 | } |
| 7936 | 7966 | ||
diff --git a/src/window.h b/src/window.h index 6b0f0e5d07c..dfbc6385312 100644 --- a/src/window.h +++ b/src/window.h | |||
| @@ -422,6 +422,14 @@ struct window | |||
| 422 | Otherwise draw them between margin areas and text. */ | 422 | Otherwise draw them between margin areas and text. */ |
| 423 | bool_bf fringes_outside_margins : 1; | 423 | bool_bf fringes_outside_margins : 1; |
| 424 | 424 | ||
| 425 | /* True if this window's fringe specifications are persistent, | ||
| 426 | i.e., always survive Fset_window_buffer. */ | ||
| 427 | bool_bf fringes_persistent : 1; | ||
| 428 | |||
| 429 | /* True if this window's croll bar specifications are persistent, | ||
| 430 | i.e., always survive Fset_window_buffer. */ | ||
| 431 | bool_bf scroll_bars_persistent : 1; | ||
| 432 | |||
| 425 | /* True if window_end_pos and window_end_vpos are truly valid. | 433 | /* True if window_end_pos and window_end_vpos are truly valid. |
| 426 | This is false if nontrivial redisplay is preempted since in that case | 434 | This is false if nontrivial redisplay is preempted since in that case |
| 427 | the frame image that window_end_pos did not get onto the frame. */ | 435 | the frame image that window_end_pos did not get onto the frame. */ |
| @@ -860,7 +868,9 @@ wset_next_buffers (struct window *w, Lisp_Object val) | |||
| 860 | W. Horizontal scrollbars exist for toolkit versions only. */ | 868 | W. Horizontal scrollbars exist for toolkit versions only. */ |
| 861 | #if USE_HORIZONTAL_SCROLL_BARS | 869 | #if USE_HORIZONTAL_SCROLL_BARS |
| 862 | #define WINDOW_HAS_HORIZONTAL_SCROLL_BAR(W) \ | 870 | #define WINDOW_HAS_HORIZONTAL_SCROLL_BAR(W) \ |
| 863 | ((WINDOW_PSEUDO_P (W) || MINI_NON_ONLY_WINDOW_P (W)) \ | 871 | ((WINDOW_PSEUDO_P (W) \ |
| 872 | || (MINI_WINDOW_P (W) \ | ||
| 873 | && !EQ (W->horizontal_scroll_bar_type, Qbottom))) \ | ||
| 864 | ? false \ | 874 | ? false \ |
| 865 | : EQ (W->horizontal_scroll_bar_type, Qt) \ | 875 | : EQ (W->horizontal_scroll_bar_type, Qt) \ |
| 866 | ? FRAME_HAS_HORIZONTAL_SCROLL_BARS (WINDOW_XFRAME (W)) \ | 876 | ? FRAME_HAS_HORIZONTAL_SCROLL_BARS (WINDOW_XFRAME (W)) \ |
| @@ -1059,7 +1069,7 @@ extern Lisp_Object minibuf_selected_window; | |||
| 1059 | extern Lisp_Object make_window (void); | 1069 | extern Lisp_Object make_window (void); |
| 1060 | extern Lisp_Object window_from_coordinates (struct frame *, int, int, | 1070 | extern Lisp_Object window_from_coordinates (struct frame *, int, int, |
| 1061 | enum window_part *, bool); | 1071 | enum window_part *, bool); |
| 1062 | extern void resize_frame_windows (struct frame *, int, bool, bool); | 1072 | extern void resize_frame_windows (struct frame *, int, bool); |
| 1063 | extern void restore_window_configuration (Lisp_Object); | 1073 | extern void restore_window_configuration (Lisp_Object); |
| 1064 | extern void delete_all_child_windows (Lisp_Object); | 1074 | extern void delete_all_child_windows (Lisp_Object); |
| 1065 | extern void grow_mini_window (struct window *, int); | 1075 | extern void grow_mini_window (struct window *, int); |
diff --git a/src/xdisp.c b/src/xdisp.c index 50f6443f6b2..1bb5f5e0f2a 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -11368,7 +11368,7 @@ bool | |||
| 11368 | resize_mini_window (struct window *w, bool exact_p) | 11368 | resize_mini_window (struct window *w, bool exact_p) |
| 11369 | { | 11369 | { |
| 11370 | struct frame *f = XFRAME (w->frame); | 11370 | struct frame *f = XFRAME (w->frame); |
| 11371 | int old_height = WINDOW_PIXEL_HEIGHT (w); | 11371 | int old_height = WINDOW_BOX_TEXT_HEIGHT (w); |
| 11372 | 11372 | ||
| 11373 | eassert (MINI_WINDOW_P (w)); | 11373 | eassert (MINI_WINDOW_P (w)); |
| 11374 | 11374 | ||
| @@ -11400,7 +11400,6 @@ resize_mini_window (struct window *w, bool exact_p) | |||
| 11400 | else | 11400 | else |
| 11401 | { | 11401 | { |
| 11402 | struct it it; | 11402 | struct it it; |
| 11403 | int old_height = WINDOW_PIXEL_HEIGHT (w); | ||
| 11404 | int unit = FRAME_LINE_HEIGHT (f); | 11403 | int unit = FRAME_LINE_HEIGHT (f); |
| 11405 | int height, max_height; | 11404 | int height, max_height; |
| 11406 | struct text_pos start; | 11405 | struct text_pos start; |
| @@ -11470,7 +11469,7 @@ resize_mini_window (struct window *w, bool exact_p) | |||
| 11470 | set_buffer_internal (old_current_buffer); | 11469 | set_buffer_internal (old_current_buffer); |
| 11471 | } | 11470 | } |
| 11472 | 11471 | ||
| 11473 | return WINDOW_PIXEL_HEIGHT (w) != old_height; | 11472 | return WINDOW_BOX_TEXT_HEIGHT (w) != old_height; |
| 11474 | } | 11473 | } |
| 11475 | 11474 | ||
| 11476 | 11475 | ||
| @@ -16679,9 +16678,7 @@ set_horizontal_scroll_bar (struct window *w) | |||
| 16679 | { | 16678 | { |
| 16680 | int start, end, whole, portion; | 16679 | int start, end, whole, portion; |
| 16681 | 16680 | ||
| 16682 | if (!MINI_WINDOW_P (w) | 16681 | if (!MINI_WINDOW_P (w) || EQ (w->horizontal_scroll_bar_type, Qbottom)) |
| 16683 | || (w == XWINDOW (minibuf_window) | ||
| 16684 | && NILP (echo_area_buffer[0]))) | ||
| 16685 | { | 16682 | { |
| 16686 | struct buffer *b = XBUFFER (w->contents); | 16683 | struct buffer *b = XBUFFER (w->contents); |
| 16687 | struct buffer *old_buffer = NULL; | 16684 | struct buffer *old_buffer = NULL; |