aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMartin Rudalics2019-07-22 09:19:18 +0200
committerMartin Rudalics2019-07-22 09:19:18 +0200
commit8e0ebb9a3cb9beef2f5ff50436fef1c54a3e3c92 (patch)
treeacabc59171db5611552b1a45aeea2149beefe689 /doc
parent5ccaee4bbc184c53b262021361bd216af17e80f5 (diff)
downloademacs-8e0ebb9a3cb9beef2f5ff50436fef1c54a3e3c92.tar.gz
emacs-8e0ebb9a3cb9beef2f5ff50436fef1c54a3e3c92.zip
Handle persistence of windows' scroll bar and fringes settings (Bug#36193)
* doc/lispref/display.texi (Fringe Size/Pos): Document new argument PERSISTENT of 'set-window-fringes'. (Scroll Bars): Document new argument PERSISTENT of 'set-window-scroll-bars'. Mention that HORIZONTAL-TYPE must be 'bottom' to show a horizontal scroll bar on mini windows. * lisp/window.el (window-min-pixel-height): For mini windows the minimum height is one line. (window--min-size-1): Use value returned by 'window-min-pixel-height' when dealing with mini windows. (window--resize-mini-window): Try to handle horizontal scroll bars and size restrictions more accurately. (window--state-put-2): Handle persistence of scroll bar settings. * src/frame.c (make_frame): Allow horizontal scroll bars in mini windows. (adjust_frame_size): Drop PIXELWISE argument in 'resize_frame_windows' calls. * src/window.c (set_window_buffer): Don't override WINDOW's scroll bar and fringe settings when marked as persistent. (resize_frame_windows): Drop fourth argument PIXELWISE - SIZE is always specified in terms of pixels. Try to handle height of mini windows more accurately. (grow_mini_window, shrink_mini_window): Use body height of mini window when calculating expected height change. Take horizontal scroll bars into account. (struct saved_window): Two new members to handle persistence of window fringes and scroll bars. (Fset_window_configuration, save_window_save): Handle persistence of fringes and scroll bars. (set_window_fringes, set_window_scroll_bars): New arguments PERSISTENT. Make dimension checks more accurate. (Fset_window_fringes): New argument PERSISTENT. (Fwindow_fringes, Fwindow_scroll_bars): Add PERSISTENT to return values. (Fset_window_scroll_bars): New argument PERSISTENT. In doc-string mention that 'bottom' must be specified to get a horizontal scroll bar in mini windows. (compare_window_configurations): Add checks for persistence of fringes and scroll bars. * src/window.h (struct window): New boolean slots 'fringes_persistent' and 'scroll_bars_persistent'. (WINDOW_HAS_HORIZONTAL_SCROLL_BAR): Allow horizontal scroll bars for mini windows. (resize_frame_windows): Remove fourth argument of 'resize_frame_windows' in external declaration. * src/xdisp.c (resize_mini_window): Use box text height to tell whether mini window height changed. (set_horizontal_scroll_bar): Set mini window's horizontal scroll bar when its type is specified as 'bottom'. * etc/NEWS: Mention new options for 'set-window-fringes' and 'set-window-scroll-bars'.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/display.texi40
1 files changed, 28 insertions, 12 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
3959each affected window. You can also use @code{set-window-fringes} to 3959each affected window. You can also use @code{set-window-fringes} to
3960control the fringe display in individual windows. 3960control 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
3963This function sets the fringe widths of window @var{window}. 3963This function sets the fringe widths of window @var{window}.
3964If @var{window} is @code{nil}, the selected window is used. 3964If @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
3975The values specified here may be later overridden by invoking 3975The 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}
3977with its @var{keep-margins} argument @code{nil} or omitted. 3977with its @var{keep-margins} argument @code{nil} or omitted. However,
3978if the optional fifth argument @var{persistent} is non-@code{nil} and
3979the other arguments are processed successfully, the values specified
3980here 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
3981This function returns information about the fringes of a window 3985This 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
3983window is used. The value has the form @code{(@var{left-width} 3987window 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
4375You can override the frame specific settings for individual windows by 4379You can override the frame specific settings for individual windows by
4376using the following function: 4380using 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
4379This function sets the width and/or height and the types of scroll bars 4383This function sets the width and/or height and the types of scroll bars
4380for window @var{window}. If @var{window} is @code{nil}, the selected 4384for window @var{window}. If @var{window} is @code{nil}, the selected
4381window is used. 4385window 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
4388vertical scroll bar. 4392vertical 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). 4395pixels (@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
4393The possible values are @code{bottom}, @code{t}, which means to use the 4397bar. The possible values are @code{bottom}, @code{t}, which means to
4394frame's default, and @code{nil} for no horizontal scroll bar. 4398use the frame's default, and @code{nil} for no horizontal scroll bar.
4399Note 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
4401explicitly specify @code{bottom} in order to show a horizontal scroll
4402bar in a mini window.
4395 4403
4396If @var{window} is not large enough to accommodate a scroll bar of the 4404If @var{window} is not large enough to accommodate a scroll bar of the
4397desired dimension, this leaves the corresponding scroll bar unchanged. 4405desired dimension, this leaves the corresponding scroll bar unchanged.
4398 4406
4399The values specified here may be later overridden by invoking 4407The 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}
4401with its @var{keep-margins} argument @code{nil} or omitted. 4409with its @var{keep-margins} argument @code{nil} or omitted. However,
4410if the optional fifth argument @var{persistent} is non-@code{nil} and
4411the other arguments are processed successfully, the values specified
4412here unconditionally survive subsequent invocations of
4413@code{set-window-buffer}.
4402@end defun 4414@end defun
4403 4415
4404The following four functions take as argument a live window which 4416The 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
4408This function returns a list of the form @code{(@var{width} 4420This 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
4412The value @var{width} is the value that was specified for the width of 4424The value @var{width} is the value that was specified for the width of
4413the vertical scroll bar (which may be @code{nil}); @var{columns} is the 4425the 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
4418the horizontal scroll bar (which may be @code{nil}); @var{lines} is the 4430the 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
4420actually occupies. 4432actually occupies.
4433
4434The value of @var{persistent} is the value specified for @var{window}
4435with 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
4438scrollbar. 4454scrollbar.
4439@end defun 4455@end defun
4440 4456
4441If you don't specify these values for a window with 4457If 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