aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Rudalics2014-10-04 10:20:24 +0200
committerMartin Rudalics2014-10-04 10:20:24 +0200
commit3c6ba8b49bb87ada8a8cca6566ad0b6e3fc4e57d (patch)
treea47c285b071a0821573b19970cb80e1ea7150cc3
parentcebc89eea10104af6a871b8ee78fb60d6c597898 (diff)
downloademacs-3c6ba8b49bb87ada8a8cca6566ad0b6e3fc4e57d.tar.gz
emacs-3c6ba8b49bb87ada8a8cca6566ad0b6e3fc4e57d.zip
Add documentation for horizontal scroll bars and fix some minor issues.
* buffer.c (scroll_bar_width, scroll_bar_height): Fix doc-strings. * window.c (Fset_window_scroll_bars): Fix doc-string. (Fwindow_scroll_bars): Have it return what the doc-string says. * window.el (window-full-height-p): Make it behave correctly for minibuffer window. (window-current-scroll-bars): Fix code. (fit-frame-to-buffer): Use window-scroll-bar-height instead of window-scroll-bars. * frame.el (frame-current-scroll-bars): Fix doc-string. * scroll-bar.el (toggle-horizontal-scroll-bar): New command. * frames.texi (Scroll Bars): Describe use of horizontal scroll bars. * display.texi (Scroll Bars): Add description of horizontal scroll bars and associated functions. * frames.texi (Layout Parameters): Add horizontal scroll bar entries. Remove paragraph on "combined fringe widths". * windows.texi (Window Sizes): Describe affects of horizontal scroll bars on window layout and sizes. Fix description of window-full-height-p. (Resizing Windows): Mention horizontal scroll bar.
-rw-r--r--doc/emacs/ChangeLog5
-rw-r--r--doc/emacs/frames.texi66
-rw-r--r--doc/lispref/ChangeLog11
-rw-r--r--doc/lispref/display.texi194
-rw-r--r--doc/lispref/elisp.texi2
-rw-r--r--doc/lispref/frames.texi20
-rw-r--r--doc/lispref/windows.texi79
-rw-r--r--etc/NEWS14
-rw-r--r--lisp/ChangeLog10
-rw-r--r--lisp/frame.el22
-rw-r--r--lisp/scroll-bar.el19
-rw-r--r--lisp/window.el37
-rw-r--r--src/ChangeLog7
-rw-r--r--src/buffer.c4
-rw-r--r--src/window.c32
15 files changed, 338 insertions, 184 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 9115b514871..4014725adf0 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,8 @@
12014-10-04 Martin Rudalics <rudalics@gmx.at>
2
3 * frames.texi (Scroll Bars): Describe use of horizontal scroll
4 bars.
5
12014-10-04 Glenn Morris <rgm@gnu.org> 62014-10-04 Glenn Morris <rgm@gnu.org>
2 7
3 * cmdargs.texi (Misc X): 8 * cmdargs.texi (Misc X):
diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi
index 8c2289b83de..da0dd8aa6ac 100644
--- a/doc/emacs/frames.texi
+++ b/doc/emacs/frames.texi
@@ -904,10 +904,11 @@ those are drawn by the toolkit and not directly by Emacs.
904@section Scroll Bars 904@section Scroll Bars
905@cindex Scroll Bar mode 905@cindex Scroll Bar mode
906@cindex mode, Scroll Bar 906@cindex mode, Scroll Bar
907@cindex Vertical Scroll Bar
907 908
908 On graphical displays, there is a @dfn{scroll bar} on the side of 909 On graphical displays, there is a @dfn{vertical scroll bar} on the
909each Emacs window. Clicking @kbd{Mouse-1} on the scroll bar's up and 910side of each Emacs window. Clicking @kbd{Mouse-1} on the scroll bar's
910down buttons scrolls the window by one line at a time. Clicking 911up and down buttons scrolls the window by one line at a time. Clicking
911@kbd{Mouse-1} above or below the scroll bar's inner box scrolls the 912@kbd{Mouse-1} above or below the scroll bar's inner box scrolls the
912window by nearly the entire height of the window, like @kbd{M-v} and 913window by nearly the entire height of the window, like @kbd{M-v} and
913@kbd{C-v} respectively (@pxref{Moving Point}). Dragging the inner box 914@kbd{C-v} respectively (@pxref{Moving Point}). Dragging the inner box
@@ -921,23 +922,23 @@ in the scroll bar lets you drag the inner box up and down.
921 922
922@findex scroll-bar-mode 923@findex scroll-bar-mode
923@findex toggle-scroll-bar 924@findex toggle-scroll-bar
924 To toggle the use of scroll bars, type @kbd{M-x scroll-bar-mode}. 925 To toggle the use of vertical scroll bars, type @kbd{M-x
925This command applies to all frames, including frames yet to be 926scroll-bar-mode}. This command applies to all frames, including frames
926created. To toggle scroll bars for just the selected frame, use the 927yet to be created. To toggle vertical scroll bars for just the selected
927command @kbd{M-x toggle-scroll-bar}. 928frame, use the command @kbd{M-x toggle-scroll-bar}.
928 929
929@vindex scroll-bar-mode 930@vindex scroll-bar-mode
930 To control the use of scroll bars at startup, customize the variable 931 To control the use of vertical scroll bars at startup, customize the
931@code{scroll-bar-mode}. Its value should be either @code{right} (put 932variable @code{scroll-bar-mode}. Its value should be either
932scroll bars on the right side of windows), @code{left} (put them on 933@code{right} (put scroll bars on the right side of windows), @code{left}
933the left), or @code{nil} (disable scroll bars). By default, Emacs 934(put them on the left), or @code{nil} (disable vertical scroll bars).
934puts scroll bars on the right if it was compiled with GTK+ support on 935By default, Emacs puts scroll bars on the right if it was compiled with
935the X Window System, and on MS-Windows or Mac OS; Emacs puts scroll 936GTK+ support on the X Window System, and on MS-Windows or Mac OS; Emacs
936bars on the left if compiled on the X Window System without GTK+ 937puts scroll bars on the left if compiled on the X Window System without
937support (following the old convention for X applications). 938GTK+ support (following the old convention for X applications).
938 939
939@vindex scroll-bar-width 940@vindex scroll-bar-width
940@cindex width of the scroll bar 941@cindex width of the vertical scroll bar
941 You can also use the X resource @samp{verticalScrollBars} to enable 942 You can also use the X resource @samp{verticalScrollBars} to enable
942or disable the scroll bars (@pxref{Resources}). To control the scroll 943or disable the scroll bars (@pxref{Resources}). To control the scroll
943bar width, change the @code{scroll-bar-width} frame parameter 944bar width, change the @code{scroll-bar-width} frame parameter
@@ -954,6 +955,39 @@ end of the buffer is shown; if @code{nil}, the thumb will be at the
954bottom when the end of the buffer is shown. You can not over-scroll 955bottom when the end of the buffer is shown. You can not over-scroll
955when the entire buffer is visible. 956when the entire buffer is visible.
956 957
958@cindex Horizontal Scroll Bar
959@cindex Horizontal Scroll Bar mode
960 On graphical displays with toolkit support, Emacs may also supply a
961@dfn{horizontal scroll bar} on the bottom of each window. Clicking
962@kbd{Mouse-1} on the that scroll bar's left and right buttons scrolls
963the window horizontally by one column at a time. Clicking @kbd{Mouse-1}
964on the left or right of the scroll bar's inner box scrolls the window by
965four columns. Dragging the inner box scrolls the window continuously.
966
967 Note that such horizontal scrolling can make the window's position of
968point disappear on the left or the right. Typing a character to insert
969text or moving point with a keyboard command will usually bring it back
970into view.
971
972@findex horizontal-scroll-bar-mode
973 To toggle the use of horizontal scroll bars, type @kbd{M-x
974horizontal-scroll-bar-mode}. This command applies to all frames,
975including frames yet to be created. To toggle horizontal scroll bars
976for just the selected frame, use the command @kbd{M-x
977toggle-horizontal-scroll-bar}.
978
979@vindex horizontal-scroll-bar-mode
980 To control the use of horizontal scroll bars at startup, customize the
981variable @code{horizontal-scroll-bar-mode}.
982
983@vindex scroll-bar-height
984@cindex height of the horizontal scroll bar
985 You can also use the X resource @samp{horizontalScrollBars} to enable
986or disable horizontal scroll bars (@pxref{Resources}). To control the
987scroll bar height, change the @code{scroll-bar-height} frame parameter
988(@pxref{Frame Parameters,,, elisp, The Emacs Lisp Reference Manual}).
989
990
957@node Drag and Drop 991@node Drag and Drop
958@section Drag and Drop 992@section Drag and Drop
959@cindex drag and drop 993@cindex drag and drop
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index f3fce93dd53..510f9e983c3 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,14 @@
12014-10-04 Martin Rudalics <rudalics@gmx.at>
2
3 * display.texi (Scroll Bars): Add description of horizontal scroll
4 bars and associated functions.
5 * frames.texi (Layout Parameters): Add horizontal scroll bar
6 entries. Remove paragraph on "combined fringe widths".
7 * windows.texi (Window Sizes): Describe affects of horizontal
8 scroll bars on window layout and sizes. Fix description of
9 window-full-height-p.
10 (Resizing Windows): Mention horizontal scroll bar.
11
12014-10-04 Glenn Morris <rgm@gnu.org> 122014-10-04 Glenn Morris <rgm@gnu.org>
2 13
3 * commands.texi (Generic Commands): Copyedits. 14 * commands.texi (Generic Commands): Copyedits.
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 46be5ecf3f0..7248aa32a30 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -23,7 +23,7 @@ that Emacs presents to the user.
23* Faces:: A face defines a graphics style for text characters: 23* Faces:: A face defines a graphics style for text characters:
24 font, colors, etc. 24 font, colors, etc.
25* Fringes:: Controlling window fringes. 25* Fringes:: Controlling window fringes.
26* Scroll Bars:: Controlling vertical scroll bars. 26* Scroll Bars:: Controlling scroll bars.
27* Window Dividers:: Separating windows visually. 27* Window Dividers:: Separating windows visually.
28* Display Property:: Enabling special display features. 28* Display Property:: Enabling special display features.
29* Images:: Displaying images in Emacs buffers. 29* Images:: Displaying images in Emacs buffers.
@@ -3866,102 +3866,164 @@ arrow position. If either property is not set, the default
3866@code{overlay-arrow-string} or @code{overlay-arrow} fringe indicator 3866@code{overlay-arrow-string} or @code{overlay-arrow} fringe indicator
3867is used. 3867is used.
3868 3868
3869
3869@node Scroll Bars 3870@node Scroll Bars
3870@section Scroll Bars 3871@section Scroll Bars
3871@cindex scroll bars 3872@cindex scroll bars
3872 3873
3873Normally the frame parameter @code{vertical-scroll-bars} controls 3874Normally the frame parameter @code{vertical-scroll-bars} controls
3874whether the windows in the frame have vertical scroll bars, and 3875whether the windows in the frame have vertical scroll bars, and whether
3875whether they are on the left or right. The frame parameter 3876they are on the left or right. The frame parameter
3876@code{scroll-bar-width} specifies how wide they are (@code{nil} 3877@code{scroll-bar-width} specifies how wide they are (@code{nil} meaning
3877meaning the default). @xref{Layout Parameters}. 3878the default).
3879
3880 The frame parameter @code{horizontal-scroll-bars} controls whether
3881the windows in the frame have horizontal scroll bars. The frame
3882parameter @code{scroll-bar-height} specifies how high they are
3883(@code{nil} meaning the default). @xref{Layout Parameters}.
3884
3885@vindex horizontal-scroll-bars-available-p
3886 Horizontal scroll bars are not available on all platforms. The
3887function @code{horizontal-scroll-bars-available-p} which takes no
3888argument returns non-@code{nil} if they are available on your system.
3889
3890 The following three functions take as argument a live frame which
3891defaults to the selected one.
3878 3892
3879@defun frame-current-scroll-bars &optional frame 3893@defun frame-current-scroll-bars &optional frame
3880This function reports the scroll bar type settings for frame 3894This function reports the scroll bar types for frame @var{frame}. The
3881@var{frame}. The value is a cons cell 3895value is a cons cell @code{(@var{vertical-type} .@:
3882@code{(@var{vertical-type} .@: @var{horizontal-type})}, where 3896@var{horizontal-type})}, where @var{vertical-type} is either
3883@var{vertical-type} is either @code{left}, @code{right}, or @code{nil} 3897@code{left}, @code{right}, or @code{nil} (which means no vertical scroll
3884(which means no scroll bar.) @var{horizontal-type} is meant to 3898bar.) @var{horizontal-type} is either @code{bottom} or @code{nil}
3885specify the horizontal scroll bar type, but since they are not 3899(which means no horizontal scroll bar).
3886implemented, it is always @code{nil}. 3900@end defun
3887@end defun
3888
3889@vindex vertical-scroll-bar
3890 You can enable or disable scroll bars for a particular buffer,
3891by setting the variable @code{vertical-scroll-bar}. This variable
3892automatically becomes buffer-local when set. The possible values are
3893@code{left}, @code{right}, @code{t}, which means to use the
3894frame's default, and @code{nil} for no scroll bar.
3895 3901
3896 You can also control this for individual windows. Call the function 3902@defun frame-scroll-bar-width &optional Lisp_Object &optional frame
3897@code{set-window-scroll-bars} to specify what to do for a specific window: 3903This function returns the width of vertical scroll bars of @var{frame}
3904in pixels.
3905@end defun
3898 3906
3899@defun set-window-scroll-bars window width &optional vertical-type horizontal-type 3907@defun frame-scroll-bar-height &optional Lisp_Object &optional frame
3900This function sets the width and type of scroll bars for window 3908This function returns the height of horizontal scroll bars of
3901@var{window}. 3909@var{frame} in pixels.
3910@end defun
3902 3911
3903@var{width} specifies the scroll bar width in pixels (@code{nil} means 3912You can override the frame specific settings for individual windows by
3904use the width specified for the frame). @var{vertical-type} specifies 3913using the following function:
3905whether to have a vertical scroll bar and, if so, where. The possible
3906values are @code{left}, @code{right} and @code{nil}, just like the
3907values of the @code{vertical-scroll-bars} frame parameter.
3908 3914
3909The argument @var{horizontal-type} is meant to specify whether and 3915@defun set-window-scroll-bars window &optional width vertical-type height horizontal-type
3910where to have horizontal scroll bars, but since they are not 3916This function sets the width and/or height and the types of scroll bars
3911implemented, it has no effect. If @var{window} is @code{nil}, the 3917for window @var{window}.
3912selected window is used. 3918
3919@var{width} specifies the width of the vertical scroll bar in pixels
3920(@code{nil} means use the width specified for the frame).
3921@var{vertical-type} specifies whether to have a vertical scroll bar and,
3922if so, where. The possible values are @code{left}, @code{right},
3923@code{t}, which means to use the frame's default, and @code{nil} for no
3924vertical scroll bar.
3925
3926@var{height} specifies the height of the horizontal scroll bar in pixels
3927(@code{nil} means use the height specified for the frame).
3928@var{horizontal-type} specifies whether to have a horizontal scroll bar.
3929The possible values are @code{bottom}, @code{t}, which means to use the
3930frame's default, and @code{nil} for no horizontal scroll bar.
3931
3932If @var{window} is @code{nil}, the selected window is used.
3913@end defun 3933@end defun
3914 3934
3935The following four functions take as argument a live window which
3936defaults to the selected one.
3937
3915@defun window-scroll-bars &optional window 3938@defun window-scroll-bars &optional window
3916Report the width and type of scroll bars specified for @var{window}. 3939This function returns a list of the form @code{(@var{width}
3917If @var{window} is omitted or @code{nil}, the selected window is used. 3940@var{columns} @var{vertical-type} @var{height} @var{lines}
3918The value is a list of the form @code{(@var{width} 3941@var{horizontal-type})}.
3919@var{cols} @var{vertical-type} @var{horizontal-type})}. The value
3920@var{width} is the value that was specified for the width (which may
3921be @code{nil}); @var{cols} is the number of columns that the scroll
3922bar actually occupies.
3923 3942
3924@var{horizontal-type} is not actually meaningful. 3943The value @var{width} is the value that was specified for the width of
3944the vertical scroll bar (which may be @code{nil}); @var{columns} is the
3945(possibly rounded) number of columns that the vertical scroll bar
3946actually occupies.
3947
3948The value @var{height} is the value that was specified for the height of
3949the horizontal scroll bar (which may be @code{nil}); @var{lines} is the
3950(possibly rounded) number of lines that the horizontally scroll bar
3951actually occupies.
3952@end defun
3953
3954@defun window-current-scroll-bars &optional window
3955This function reports the scroll bar type for window @var{window}. The
3956value is a cons cell @code{(@var{vertical-type} .@:
3957@var{horizontal-type})}. Unlike @code{window-scroll-bars}, this reports
3958the scroll bar type actually used, once frame defaults and
3959@code{scroll-bar-mode} are taken into account.
3925@end defun 3960@end defun
3926 3961
3927@defun window-scroll-bar-width &optional window 3962@defun window-scroll-bar-width &optional window
3928This function returns the width in pixels of @var{window}'s vertical 3963This function returns the width in pixels of @var{window}'s vertical
3929scrollbar. @var{window} must be a live window, and defaults to the 3964scrollbar.
3930selected window. 3965@end defun
3966
3967@defun window-scroll-bar-height &optional window
3968This function returns the height in pixels of @var{window}'s horizontal
3969scrollbar.
3931@end defun 3970@end defun
3932 3971
3933If you don't specify these values for a window with 3972If you don't specify these values for a window with
3934@code{set-window-scroll-bars}, the buffer-local variables 3973@code{set-window-scroll-bars}, the buffer-local variables
3935@code{scroll-bar-mode} and @code{scroll-bar-width} in the buffer being 3974@code{vertical-scroll-bar}, @code{horizontal-scroll-bar},
3936displayed control the window's vertical scroll bars. The function 3975@code{scroll-bar-width} and @code{scroll-bar-height} in the buffer being
3976displayed control the window's scroll bars. The function
3937@code{set-window-buffer} examines these variables. If you change them 3977@code{set-window-buffer} examines these variables. If you change them
3938in a buffer that is already visible in a window, you can make the 3978in a buffer that is already visible in a window, you can make the window
3939window take note of the new values by calling @code{set-window-buffer} 3979take note of the new values by calling @code{set-window-buffer}
3940specifying the same buffer that is already displayed. 3980specifying the same buffer that is already displayed.
3941 3981
3942@defopt scroll-bar-mode 3982You can control the appearance of scroll bars for a particular buffer by
3943This variable, always local in all buffers, controls whether and where 3983setting the following variables which automatically become buffer-local
3944to put scroll bars in windows displaying the buffer. The possible values 3984when set.
3945are @code{nil} for no scroll bar, @code{left} to put a scroll bar on
3946the left, and @code{right} to put a scroll bar on the right.
3947@end defopt
3948 3985
3949@defun window-current-scroll-bars &optional window 3986@defvar vertical-scroll-bar
3950This function reports the scroll bar type for window @var{window}. 3987This variable specifies the location of the vertical scroll bar. The
3951If @var{window} is omitted or @code{nil}, the selected window is used. 3988possible values are @code{left}, @code{right}, @code{t}, which means to
3952The value is a cons cell 3989use the frame's default, and @code{nil} for no scroll bar.
3953@code{(@var{vertical-type} .@: @var{horizontal-type})}. Unlike 3990@end defvar
3954@code{window-scroll-bars}, this reports the scroll bar type actually 3991
3955used, once frame defaults and @code{scroll-bar-mode} are taken into 3992@defvar horizontal-scroll-bar
3956account. 3993This variable specifies the location of the horizontal scroll bar. The
3957@end defun 3994possible values are @code{bottom}, @code{t}, which means to use the
3995frame's default, and @code{nil} for no scroll bar.
3996@end defvar
3958 3997
3959@defvar scroll-bar-width 3998@defvar scroll-bar-width
3960This variable, always local in all buffers, specifies the width of the 3999This variable specifies the width of the buffer's vertical scroll bars,
3961buffer's scroll bars, measured in pixels. A value of @code{nil} means 4000measured in pixels. A value of @code{nil} means to use the value
3962to use the value specified by the frame. 4001specified by the frame.
3963@end defvar 4002@end defvar
3964 4003
4004@defvar scroll-bar-height
4005This variable specifies the height of the buffer's horizontal scroll
4006bar, measured in pixels. A value of @code{nil} means to use the value
4007specified by the frame.
4008@end defvar
4009
4010Finally you can toggle the display of scroll bars on all frames by
4011customizing the variables @code{scroll-bar-mode} and
4012@code{horizontal-scroll-bar-mode}.
4013
4014@defopt scroll-bar-mode
4015This variable controls whether and where to put vertical scroll bars in
4016all frames. The possible values are @code{nil} for no scroll bars,
4017@code{left} to put scroll bars on the left and @code{right} to put
4018scroll bars on the right.
4019@end defopt
4020
4021@defopt horizontal-scroll-bar-mode
4022This variable controls whether to display horizontal scroll bars on all
4023frames.
4024@end defopt
4025
4026
3965@node Window Dividers 4027@node Window Dividers
3966@section Window Dividers 4028@section Window Dividers
3967@cindex window dividers 4029@cindex window dividers
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi
index bb2e4638396..937345f21e4 100644
--- a/doc/lispref/elisp.texi
+++ b/doc/lispref/elisp.texi
@@ -1343,7 +1343,7 @@ Emacs Display
1343* Faces:: A face defines a graphics style 1343* Faces:: A face defines a graphics style
1344 for text characters: font, colors, etc. 1344 for text characters: font, colors, etc.
1345* Fringes:: Controlling window fringes. 1345* Fringes:: Controlling window fringes.
1346* Scroll Bars:: Controlling vertical scroll bars. 1346* Scroll Bars:: Controlling scroll bars.
1347* Window Dividers:: Separating windows visually. 1347* Window Dividers:: Separating windows visually.
1348* Display Property:: Enabling special display features. 1348* Display Property:: Enabling special display features.
1349* Images:: Displaying images in Emacs buffers. 1349* Images:: Displaying images in Emacs buffers.
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index c8e0fff6cd0..464c5fccc4f 100644
--- a/doc/lispref/frames.texi
+++ b/doc/lispref/frames.texi
@@ -709,19 +709,21 @@ Whether the frame has scroll bars for vertical scrolling, and which side
709of the frame they should be on. The possible values are @code{left}, 709of the frame they should be on. The possible values are @code{left},
710@code{right}, and @code{nil} for no scroll bars. 710@code{right}, and @code{nil} for no scroll bars.
711 711
712@ignore
713@vindex horizontal-scroll-bars, a frame parameter 712@vindex horizontal-scroll-bars, a frame parameter
714@item horizontal-scroll-bars 713@item horizontal-scroll-bars
715Whether the frame has scroll bars for horizontal scrolling 714Whether the frame has scroll bars for horizontal scrolling (@code{t} and
716(non-@code{nil} means yes). Horizontal scroll bars are not currently 715@code{bottom} mean yes, @code{nil} means no).
717implemented.
718@end ignore
719 716
720@vindex scroll-bar-width, a frame parameter 717@vindex scroll-bar-width, a frame parameter
721@item scroll-bar-width 718@item scroll-bar-width
722The width of vertical scroll bars, in pixels, or @code{nil} meaning to 719The width of vertical scroll bars, in pixels, or @code{nil} meaning to
723use the default width. 720use the default width.
724 721
722@vindex scroll-bar-height, a frame parameter
723@item scroll-bar-height
724The height of horizontal scroll bars, in pixels, or @code{nil} meaning
725to use the default height.
726
725@vindex left-fringe, a frame parameter 727@vindex left-fringe, a frame parameter
726@vindex right-fringe, a frame parameter 728@vindex right-fringe, a frame parameter
727@item left-fringe 729@item left-fringe
@@ -735,14 +737,6 @@ these two frame parameters, the return value is always an integer.
735When using @code{set-frame-parameter}, passing a @code{nil} value 737When using @code{set-frame-parameter}, passing a @code{nil} value
736imposes an actual default value of 8 pixels. 738imposes an actual default value of 8 pixels.
737 739
738The combined fringe widths must add up to an integral number of
739columns, so the actual default fringe widths for the frame, as
740reported by @code{frame-parameter}, may be larger than what you
741specify. Any extra width is distributed evenly between the left and
742right fringe. However, you can force one fringe or the other to a
743precise width by specifying that width as a negative integer. If both
744widths are negative, only the left fringe gets the specified width.
745
746@vindex right-divider-width, a frame parameter 740@vindex right-divider-width, a frame parameter
747@item right-divider-width 741@item right-divider-width
748The width (thickness) reserved for the right divider (@pxref{Window 742The width (thickness) reserved for the right divider (@pxref{Window
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index f5122a39f8c..5060fef804f 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -394,13 +394,14 @@ internal window). The @var{edges} element is a list @code{(@var{left}
394@group 394@group
395 ____________________________________________ 395 ____________________________________________
396 |______________ Header Line ______________|RD| ^ 396 |______________ Header Line ______________|RD| ^
397 ^ |LS|LF|LM| |RM|RF|RS| | | 397 ^ |LS|LM|LF| |RF|RM|RS| | |
398 | | | | | | | | | | | 398 | | | | | | | | | | |
399Window | | | | Text Area | | | | | Window 399Window | | | | Text Area | | | | | Window
400Body | | | | | (Window Body) | | | | | Total 400Body | | | | | (Window Body) | | | | | Total
401Height | | | | | | | | | Height 401Height | | | | | | | | | Height
402 | | | | |<- Window Body Width ->| | | | | | 402 | | | | |<- Window Body Width ->| | | | | |
403 v |__|__|__|_______________________|__|__|__| | | 403 v |__|__|__|_______________________|__|__|__| | |
404 |_________ Horizontal Scroll Bar _________| | |
404 |_______________ Mode Line _______________|__| | 405 |_______________ Mode Line _______________|__| |
405 |_____________ Bottom Divider _______________| v 406 |_____________ Bottom Divider _______________| v
406 <---------- Window Total Width ------------> 407 <---------- Window Total Width ------------>
@@ -414,15 +415,15 @@ Height | | | | | | | | | Height
414 At the center of the window is the @dfn{text area}, or @dfn{body}, 415 At the center of the window is the @dfn{text area}, or @dfn{body},
415where the buffer text is displayed. The text area can be surrounded by 416where the buffer text is displayed. The text area can be surrounded by
416a series of optional areas. On the left and right, from innermost to 417a series of optional areas. On the left and right, from innermost to
417outermost, these are the left and right margins, denoted by LM and RM in 418outermost, these are the left and right fringes, denoted by LF and RF
418the schematic (@pxref{Display Margins}); the left and right fringes, 419(@pxref{Fringes}); the left and right margins, denoted by LM and RM in
419denoted by LF and RF (@pxref{Fringes}); the left or right scroll bar, 420the schematic (@pxref{Display Margins}); the left or right vertical
420only one of which is present at any time, denoted by LS and RS 421scroll bar, only one of which is present at any time, denoted by LS and
421(@pxref{Scroll Bars}); and the right divider, denoted by RD 422RS (@pxref{Scroll Bars}); and the right divider, denoted by RD
422(@pxref{Window Dividers}). At the top of the window is the header line 423(@pxref{Window Dividers}). At the top of the window is the header line
423(@pxref{Header Lines}); at the bottom of the window is the mode line 424(@pxref{Header Lines}). At the bottom of the window are the horizontal
424(@pxref{Mode Line Format}) followed by the bottom divider (@pxref{Window 425scroll bar (@pxref{Scroll Bars}); the mode line (@pxref{Mode Line
425Dividers}). 426Format}); and the bottom divider (@pxref{Window Dividers}).
426 427
427 Emacs provides miscellaneous functions for finding the height and 428 Emacs provides miscellaneous functions for finding the height and
428width of a window. The return value of many of these functions can be 429width of a window. The return value of many of these functions can be
@@ -439,11 +440,8 @@ displayed within it.
439@cindex height of a window 440@cindex height of a window
440@cindex total height of a window 441@cindex total height of a window
441 The @dfn{total height} of a window is the number of lines comprising 442 The @dfn{total height} of a window is the number of lines comprising
442the window's body, the header line, the mode line and the bottom divider 443the window's body, the header line, the horizontal scroll bar, the mode
443(if any). Note that the height of a frame is not the same as the height 444line and the bottom divider (if any).
444of its root window (@pxref{Windows and Frames}), since a frame may also
445contain an echo area, a menu bar, and a tool bar (@pxref{Size and
446Position}).
447 445
448@defun window-total-height &optional window round 446@defun window-total-height &optional window round
449This function returns the total height, in lines, of the window 447This function returns the total height, in lines, of the window
@@ -457,8 +455,8 @@ rounded internally. This is done in a way such that, if the window is a
457parent window, the sum of the total heights of all its child windows 455parent window, the sum of the total heights of all its child windows
458internally equals the total height of their parent. This means that 456internally equals the total height of their parent. This means that
459although two windows have the same pixel height, their internal total 457although two windows have the same pixel height, their internal total
460heights may differ by one line. This means also, that if this window is 458heights may differ by one line. This means also, that if window is
461vertically combined and has a right sibling, the topmost row of that 459vertically combined and has a next sibling, the topmost row of that
462sibling can be calculated as the sum of this window's topmost row and 460sibling can be calculated as the sum of this window's topmost row and
463total height (@pxref{Coordinates and Windows}) 461total height (@pxref{Coordinates and Windows})
464 462
@@ -490,11 +488,10 @@ window, the sum of the total widths of all its children internally
490equals the total width of their parent. This means that although two 488equals the total width of their parent. This means that although two
491windows have the same pixel width, their internal total widths may 489windows have the same pixel width, their internal total widths may
492differ by one column. This means also, that if this window is 490differ by one column. This means also, that if this window is
493horizontally combined and has a right sibling, the leftmost column of 491horizontally combined and has a next sibling, the leftmost column of
494that sibling can be calculated as the sum of this window's leftmost 492that sibling can be calculated as the sum of this window's leftmost
495column and total width (@pxref{Coordinates and Windows}). The 493column and total width (@pxref{Coordinates and Windows}). The optional
496optional argument @var{round} behaves as it does for 494argument @var{round} behaves as it does for @code{window-total-height}.
497@code{window-total-height}.
498@end defun 495@end defun
499 496
500@defun window-total-size &optional window horizontal round 497@defun window-total-size &optional window horizontal round
@@ -517,9 +514,10 @@ window in units of pixels.
517This function returns the total height of window @var{window} in pixels. 514This function returns the total height of window @var{window} in pixels.
518@var{window} must be a valid window and defaults to the selected one. 515@var{window} must be a valid window and defaults to the selected one.
519 516
520The return value includes mode and header line and a bottom divider, if 517The return value includes mode and header line, a horizontal scroll bar
521any. If @var{window} is an internal window, its pixel height is the 518and a bottom divider, if any. If @var{window} is an internal window,
522pixel height of the screen areas spanned by its children. 519its pixel height is the pixel height of the screen areas spanned by its
520children.
523@end defun 521@end defun
524 522
525@cindex window pixel height 523@cindex window pixel height
@@ -542,10 +540,12 @@ the screen areas spanned by its children.
542window has any adjacent windows. 540window has any adjacent windows.
543 541
544@defun window-full-height-p &optional window 542@defun window-full-height-p &optional window
545This function returns non-@code{nil} if @var{window} has no other 543This function returns non-@code{nil} if @var{window} has no other window
546window above or below it in its frame, i.e., its total height equals 544above or below it in its frame. More precisely, this means that the
547the total height of the root window on that frame. If @var{window} is 545total height of @var{window} equals the total height of the root window
548omitted or @code{nil}, it defaults to the selected window. 546on that frame. The minibuffer window does not count in this regard. If
547@var{window} is omitted or @code{nil}, it defaults to the selected
548window.
549@end defun 549@end defun
550 550
551@defun window-full-width-p &optional window 551@defun window-full-width-p &optional window
@@ -559,7 +559,8 @@ that of the root window on that frame. If @var{window} is omitted or
559@cindex body height of a window 559@cindex body height of a window
560@cindex window body width 560@cindex window body width
561The @dfn{body height} of a window is the height of its text area, which 561The @dfn{body height} of a window is the height of its text area, which
562does not include a mode or header line or a bottom divider. 562does not include a mode or header line, a horizontal scroll bar, or a
563bottom divider.
563 564
564@defun window-body-height &optional window pixelwise 565@defun window-body-height &optional window pixelwise
565This function returns the height, in lines, of the body of window 566This function returns the height, in lines, of the body of window
@@ -646,7 +647,8 @@ size:
646@defopt window-min-height 647@defopt window-min-height
647This option specifies the minimum total height, in lines, of any window. 648This option specifies the minimum total height, in lines, of any window.
648Its value has to accommodate at least one text line as well as a mode 649Its value has to accommodate at least one text line as well as a mode
649and header line and a bottom divider, if present. 650and header line, a horizontal scroll bar and a bottom divider, if
651present.
650@end defopt 652@end defopt
651 653
652@defopt window-min-width 654@defopt window-min-width
@@ -685,10 +687,11 @@ of @var{window}'s lines.
685 687
686The return value makes sure that all components of @var{window} remain 688The return value makes sure that all components of @var{window} remain
687fully visible if @var{window}'s size were actually set to it. With 689fully visible if @var{window}'s size were actually set to it. With
688@var{horizontal} @code{nil} it includes the mode and header line and the 690@var{horizontal} @code{nil} it includes the mode and header line, the
689bottom divider. With @var{horizontal} non-@code{nil} it includes the 691horizontal scroll bar and the bottom divider. With @var{horizontal}
690fringes, a scroll bar, and a right divider, if present. It does not, 692non-@code{nil} it includes the fringes, a scroll bar, and a right
691however, include the space reserved for the margins. 693divider, if present. It does not, however, include the space reserved
694for the margins.
692 695
693The optional argument @var{ignore}, if non-@code{nil}, means ignore 696The optional argument @var{ignore}, if non-@code{nil}, means ignore
694restrictions imposed by fixed size windows, @code{window-min-height} or 697restrictions imposed by fixed size windows, @code{window-min-height} or
@@ -740,11 +743,11 @@ Normally, the variables @code{window-min-height} and
740(@pxref{Window Sizes}). However, if the optional argument @var{ignore} 743(@pxref{Window Sizes}). However, if the optional argument @var{ignore}
741is non-@code{nil}, this function ignores @code{window-min-height} and 744is non-@code{nil}, this function ignores @code{window-min-height} and
742@code{window-min-width}, as well as @code{window-size-fixed}. Instead, 745@code{window-min-width}, as well as @code{window-size-fixed}. Instead,
743it considers the minimum-height window to be one consisting of a header, 746it considers the minimum-height window to be one consisting of a header
744a mode line and a bottom divider (if any), plus a text area one line 747and a mode line, a horizontal scrollbar and a bottom divider (if any),
745tall; and a minimum-width window as one consisting of fringes, margins, 748plus a text area one line tall; and a minimum-width window as one
746a scroll bar and a right divider (if any), plus a text area two columns 749consisting of fringes, margins, a scroll bar and a right divider (if
747wide. 750any), plus a text area two columns wide.
748 751
749If the optional argument @var{pixelwise} is non-@code{nil}, 752If the optional argument @var{pixelwise} is non-@code{nil},
750@var{delta} is interpreted as pixels. 753@var{delta} is interpreted as pixels.
diff --git a/etc/NEWS b/etc/NEWS
index aa953971923..828262b0682 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -292,20 +292,28 @@ optional repeat-count argument.
292 292
293* Changes in Frames and Windows Code in Emacs 25.1 293* Changes in Frames and Windows Code in Emacs 25.1
294 294
295+++
295** Emacs can now draw horizontal scroll bars on some platforms that 296** Emacs can now draw horizontal scroll bars on some platforms that
296provide toolkit scroll bars, namely Gtk, Lucid, Motif and Windows. 297provide toolkit scroll bars, namely Gtk+, Lucid, Motif and Windows.
297Horizontal scroll bars are turned off by default. 298Horizontal scroll bars are turned off by default.
298*** New function `horizontal-scroll-bars-available-p' telling whether 299*** New function `horizontal-scroll-bars-available-p' telling whether
299 horizontal scroll bars are available on the underlying system. 300 horizontal scroll bars are available on the underlying system.
300*** New mode `horizontal-scroll-bar-mode' to toggle horizontal scroll 301*** New mode `horizontal-scroll-bar-mode' to toggle horizontal scroll
301 bars on all existing and future frames. 302 bars on all existing and future frames.
303*** New function `toggle-horizontal-scroll-bar' to toggle horizontal
304 scroll bars on the selected frame.
302*** New frame parameters `horizontal-scroll-bars' and 305*** New frame parameters `horizontal-scroll-bars' and
303 `scroll-bar-height' to set horizontal scroll bars and their height 306 `scroll-bar-height' to set horizontal scroll bars and their height
304 for individual frames and in `default-frame-alist'. 307 for individual frames and in `default-frame-alist'.
305*** New function `frame-scroll-bar-height' to return the height of 308*** New functions `frame-scroll-bar-height' and
306 horizontal scroll bars on a specific frame. 309 `window-scroll-bar-height' return the height of horizontal scroll
310 bars on a specific frame or window.
307*** `set-window-scroll-bars' now accepts five parameters where the last 311*** `set-window-scroll-bars' now accepts five parameters where the last
308 two specify height and type of the window's horizontal scroll bar. 312 two specify height and type of the window's horizontal scroll bar.
313*** `window-scroll-bars' now returns type and sizes of horizontal scroll
314 bars too.
315*** New buffer-local variables `horizontal-scroll-bar' and
316 `scroll-bar-height'.
309 317
310** The height of a frame's menu and tool bar are no more counted in the 318** The height of a frame's menu and tool bar are no more counted in the
311frame's text height. This means that the text height stands only for 319frame's text height. This means that the text height stands only for
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ae63393add6..2ce89cdb655 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,13 @@
12014-10-04 Martin Rudalics <rudalics@gmx.at>
2
3 * window.el (window-full-height-p): Make it behave correctly for
4 minibuffer window.
5 (window-current-scroll-bars): Fix code.
6 (fit-frame-to-buffer): Use window-scroll-bar-height instead of
7 window-scroll-bars.
8 * frame.el (frame-current-scroll-bars): Fix doc-string.
9 * scroll-bar.el (toggle-horizontal-scroll-bar): New command.
10
12014-10-04 Mark Oteiza <mvoteiza@udel.edu> (tiny change) 112014-10-04 Mark Oteiza <mvoteiza@udel.edu> (tiny change)
2 12
3 * files.el (auto-mode-alist): Use sh-mode for .zsh files. (Bug#18488) 13 * files.el (auto-mode-alist): Use sh-mode for .zsh files. (Bug#18488)
diff --git a/lisp/frame.el b/lisp/frame.el
index 19c878b59e3..bd055b7d6df 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -1263,16 +1263,18 @@ On graphical displays, it is displayed on the frame's title bar."
1263 (list (cons 'name name)))) 1263 (list (cons 'name name))))
1264 1264
1265(defun frame-current-scroll-bars (&optional frame) 1265(defun frame-current-scroll-bars (&optional frame)
1266 "Return the current scroll-bar settings in frame FRAME. 1266 "Return the current scroll-bar types for frame FRAME.
1267Value is a cons (VERTICAL . HORIZ0NTAL) where VERTICAL specifies the 1267Value is a cons (VERTICAL . HORIZ0NTAL) where VERTICAL specifies
1268current location of the vertical scroll-bars (left, right, or nil), 1268the current location of the vertical scroll-bars (`left', `right'
1269and HORIZONTAL specifies the current location of the horizontal scroll 1269or nil), and HORIZONTAL specifies the current location of the
1270bars (top, bottom, or nil)." 1270horizontal scroll bars (`bottom' or nil). FRAME must specify a
1271 (let ((vert (frame-parameter frame 'vertical-scroll-bars)) 1271live frame and defaults to the selected one."
1272 (hor nil)) 1272 (let* ((frame (window-normalize-frame frame))
1273 (unless (memq vert '(left right nil)) 1273 (vertical (frame-parameter frame 'vertical-scroll-bars))
1274 (setq vert default-frame-scroll-bars)) 1274 (horizontal (frame-parameter frame 'horizontal-scroll-bars)))
1275 (cons vert hor))) 1275 (unless (memq vertical '(left right nil))
1276 (setq vertical default-frame-scroll-bars))
1277 (cons vertical (and horizontal 'bottom))))
1276 1278
1277(defun frame-monitor-attributes (&optional frame) 1279(defun frame-monitor-attributes (&optional frame)
1278 "Return the attributes of the physical monitor dominating FRAME. 1280 "Return the attributes of the physical monitor dominating FRAME.
diff --git a/lisp/scroll-bar.el b/lisp/scroll-bar.el
index 63713c24a64..6de5ee3228e 100644
--- a/lisp/scroll-bar.el
+++ b/lisp/scroll-bar.el
@@ -79,7 +79,7 @@ SIDE must be the symbol `left' or `right'."
79 (htype lines) 79 (htype lines)
80 ((frame-parameter nil 'horizontal-scroll-bars) 80 ((frame-parameter nil 'horizontal-scroll-bars)
81 ;; nil means it's a non-toolkit scroll bar (which is currently 81 ;; nil means it's a non-toolkit scroll bar (which is currently
82 ;; impossible), and its width in columns is 14 pixels rounded up. 82 ;; impossible), and its height in lines is 14 pixels rounded up.
83 (ceiling (or (frame-parameter nil 'scroll-bar-height) 14) 83 (ceiling (or (frame-parameter nil 'scroll-bar-height) 14)
84 (frame-char-width))) 84 (frame-char-width)))
85 (0)))) 85 (0))))
@@ -178,7 +178,7 @@ created in the future."
178 178
179(defun toggle-scroll-bar (arg) 179(defun toggle-scroll-bar (arg)
180 "Toggle whether or not the selected frame has vertical scroll bars. 180 "Toggle whether or not the selected frame has vertical scroll bars.
181With arg, turn vertical scroll bars on if and only if arg is positive. 181With ARG, turn vertical scroll bars on if and only if ARG is positive.
182The variable `scroll-bar-mode' controls which side the scroll bars are on 182The variable `scroll-bar-mode' controls which side the scroll bars are on
183when they are turned on; if it is nil, they go on the left." 183when they are turned on; if it is nil, they go on the left."
184 (interactive "P") 184 (interactive "P")
@@ -193,6 +193,21 @@ when they are turned on; if it is nil, they go on the left."
193 (list (cons 'vertical-scroll-bars 193 (list (cons 'vertical-scroll-bars
194 (if (> arg 0) 194 (if (> arg 0)
195 (or scroll-bar-mode default-frame-scroll-bars)))))) 195 (or scroll-bar-mode default-frame-scroll-bars))))))
196
197(defun toggle-horizontal-scroll-bar (arg)
198 "Toggle whether or not the selected frame has horizontal scroll bars.
199With ARG, turn vertical scroll bars on if and only if ARG is positive."
200 (interactive "P")
201 (if (null arg)
202 (setq arg
203 (if (cdr (assq 'horizontal-scroll-bars
204 (frame-parameters (selected-frame))))
205 -1 1))
206 (setq arg (prefix-numeric-value arg)))
207 (modify-frame-parameters
208 (selected-frame)
209 (list (cons 'horizontal-scroll-bars
210 (when (> arg 0) 'bottom)))))
196 211
197;;;; Buffer navigation using the scroll bar. 212;;;; Buffer navigation using the scroll bar.
198 213
diff --git a/lisp/window.el b/lisp/window.el
index 5ac04c7e99a..472901b62b9 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -1745,9 +1745,6 @@ doc-string of `window-resizable'."
1745(defalias 'window-height 'window-total-height) 1745(defalias 'window-height 'window-total-height)
1746(defalias 'window-width 'window-body-width) 1746(defalias 'window-width 'window-body-width)
1747 1747
1748;; Eventually the following two should work pixelwise.
1749
1750;; See discussion in bug#4543.
1751(defun window-full-height-p (&optional window) 1748(defun window-full-height-p (&optional window)
1752 "Return t if WINDOW is as high as its containing frame. 1749 "Return t if WINDOW is as high as its containing frame.
1753More precisely, return t if and only if the total height of 1750More precisely, return t if and only if the total height of
@@ -1755,8 +1752,10 @@ WINDOW equals the total height of the root window of WINDOW's
1755frame. WINDOW must be a valid window and defaults to the 1752frame. WINDOW must be a valid window and defaults to the
1756selected one." 1753selected one."
1757 (setq window (window-normalize-window window)) 1754 (setq window (window-normalize-window window))
1758 (= (window-pixel-height window) 1755 (if (window-minibuffer-p window)
1759 (window-pixel-height (frame-root-window window)))) 1756 (eq window (frame-root-window (window-frame window)))
1757 (= (window-pixel-height window)
1758 (window-pixel-height (frame-root-window window)))))
1760 1759
1761(defun window-full-width-p (&optional window) 1760(defun window-full-width-p (&optional window)
1762 "Return t if WINDOW is as wide as its containing frame. 1761 "Return t if WINDOW is as wide as its containing frame.
@@ -1780,28 +1779,26 @@ optional argument PIXELWISE is passed to the functions."
1780 (window-body-height window pixelwise))) 1779 (window-body-height window pixelwise)))
1781 1780
1782(defun window-current-scroll-bars (&optional window) 1781(defun window-current-scroll-bars (&optional window)
1783 "Return the current scroll bar settings for WINDOW. 1782 "Return the current scroll bar types for WINDOW.
1784WINDOW must be a live window and defaults to the selected one. 1783WINDOW must be a live window and defaults to the selected one.
1785 1784
1786The return value is a cons cell (VERTICAL . HORIZONTAL) where 1785The return value is a cons cell (VERTICAL . HORIZONTAL) where
1787VERTICAL specifies the current location of the vertical scroll 1786VERTICAL specifies the current location of the vertical scroll
1788bars (`left', `right', or nil), and HORIZONTAL specifies the 1787bar (`left', `right' or nil), and HORIZONTAL specifies the
1789current location of the horizontal scroll bars (`top', `bottom', 1788current location of the horizontal scroll bar (`bottom' or nil).
1790or nil).
1791 1789
1792Unlike `window-scroll-bars', this function reports the scroll bar 1790Unlike `window-scroll-bars', this function reports the scroll bar
1793type actually used, once frame defaults and `scroll-bar-mode' are 1791type actually used, once frame defaults and `scroll-bar-mode' are
1794taken into account." 1792taken into account."
1795 (setq window (window-normalize-window window t)) 1793 (setq window (window-normalize-window window t))
1796 (let ((vert (nth 2 (window-scroll-bars window))) 1794 (let ((vertical (nth 2 (window-scroll-bars window)))
1797 (hor nil)) 1795 (horizontal (nth 5 (window-scroll-bars window)))
1798 (when (or (eq vert t) (eq hor t)) 1796 (inherited (frame-current-scroll-bars (window-frame window))))
1799 (let ((fcsb (frame-current-scroll-bars (window-frame window)))) 1797 (when (eq vertical t)
1800 (if (eq vert t) 1798 (setq vertical (car inherited)))
1801 (setq vert (car fcsb))) 1799 (when (eq horizontal t)
1802 (if (eq hor t) 1800 (setq horizontal (cdr inherited)))
1803 (setq hor (cdr fcsb))))) 1801 (cons vertical (and horizontal 'bottom))))
1804 (cons vert hor)))
1805 1802
1806(defun walk-windows (fun &optional minibuf all-frames) 1803(defun walk-windows (fun &optional minibuf all-frames)
1807 "Cycle through all live windows, calling FUN for each one. 1804 "Cycle through all live windows, calling FUN for each one.
@@ -7176,7 +7173,7 @@ FRAME."
7176 (height 7173 (height
7177 (+ (cdr value) 7174 (+ (cdr value)
7178 (window-bottom-divider-width) 7175 (window-bottom-divider-width)
7179 (nth 3 (window-scroll-bars))))) 7176 (window-scroll-bar-height))))
7180 ;; Don't change height or width when the window's size is fixed 7177 ;; Don't change height or width when the window's size is fixed
7181 ;; in either direction or ONLY forbids it. 7178 ;; in either direction or ONLY forbids it.
7182 (cond 7179 (cond
@@ -7335,7 +7332,7 @@ accessible position."
7335 ;; height. Its width remains fixed. 7332 ;; height. Its width remains fixed.
7336 (setq height (+ (cdr (window-text-pixel-size 7333 (setq height (+ (cdr (window-text-pixel-size
7337 nil nil t nil (frame-pixel-height) t)) 7334 nil nil t nil (frame-pixel-height) t))
7338 (nth 3 (window-scroll-bars window)) 7335 (window-scroll-bar-height window)
7339 (window-bottom-divider-width))) 7336 (window-bottom-divider-width)))
7340 ;; Round height. 7337 ;; Round height.
7341 (unless pixelwise 7338 (unless pixelwise
diff --git a/src/ChangeLog b/src/ChangeLog
index 3260af49d11..4885778b920 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
12014-10-04 Martin Rudalics <rudalics@gmx.at>
2
3 * buffer.c (scroll_bar_width, scroll_bar_height): Fix
4 doc-strings.
5 * window.c (Fset_window_scroll_bars): Fix doc-string.
6 (Fwindow_scroll_bars): Have it return what the doc-string says.
7
12014-10-03 Eli Zaretskii <eliz@gnu.org> 82014-10-03 Eli Zaretskii <eliz@gnu.org>
2 9
3 * xdisp.c (move_it_by_lines): Call reseat_1 after moving the 10 * xdisp.c (move_it_by_lines): Call reseat_1 after moving the
diff --git a/src/buffer.c b/src/buffer.c
index b46993a3cdb..80791a1fdb1 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5925,12 +5925,12 @@ in a window. To make the change take effect, call `set-window-buffer'. */);
5925 5925
5926 DEFVAR_PER_BUFFER ("scroll-bar-width", &BVAR (current_buffer, scroll_bar_width), 5926 DEFVAR_PER_BUFFER ("scroll-bar-width", &BVAR (current_buffer, scroll_bar_width),
5927 Qintegerp, 5927 Qintegerp,
5928 doc: /* Width of this buffer's scroll bars in pixels. 5928 doc: /* Width of this buffer's vertical scroll bars in pixels.
5929A value of nil means to use the scroll bar width from the window's frame. */); 5929A value of nil means to use the scroll bar width from the window's frame. */);
5930 5930
5931 DEFVAR_PER_BUFFER ("scroll-bar-height", &BVAR (current_buffer, scroll_bar_height), 5931 DEFVAR_PER_BUFFER ("scroll-bar-height", &BVAR (current_buffer, scroll_bar_height),
5932 Qintegerp, 5932 Qintegerp,
5933 doc: /* Height of this buffer's scroll bars in pixels. 5933 doc: /* Height of this buffer's horizontal scroll bars in pixels.
5934A value of nil means to use the scroll bar height from the window's frame. */); 5934A value of nil means to use the scroll bar height from the window's frame. */);
5935 5935
5936 DEFVAR_PER_BUFFER ("vertical-scroll-bar", &BVAR (current_buffer, vertical_scroll_bar_type), 5936 DEFVAR_PER_BUFFER ("vertical-scroll-bar", &BVAR (current_buffer, vertical_scroll_bar_type),
diff --git a/src/window.c b/src/window.c
index 456a8bce691..0b0f2140a58 100644
--- a/src/window.c
+++ b/src/window.c
@@ -7002,16 +7002,17 @@ DEFUN ("set-window-scroll-bars", Fset_window_scroll_bars,
7002 doc: /* Set width and type of scroll bars of window WINDOW. 7002 doc: /* Set width and type of scroll bars of window WINDOW.
7003WINDOW must be a live window and defaults to the selected one. 7003WINDOW must be a live window and defaults to the selected one.
7004 7004
7005Second parameter WIDTH specifies the pixel width for the scroll bar. 7005Second parameter WIDTH specifies the pixel width for the vertical scroll
7006bar. If WIDTH is nil, use the scroll-bar width of WINDOW's frame.
7006Third parameter VERTICAL-TYPE specifies the type of the vertical scroll 7007Third parameter VERTICAL-TYPE specifies the type of the vertical scroll
7007bar: left, right, or nil. If WIDTH is nil, use the frame's scroll-bar 7008bar: left, right, or nil. If VERTICAL-TYPE is t, this means use the
7008width. If VERTICAL-TYPE is t, use the frame's scroll-bar type. 7009frame's scroll-bar type.
7009 7010
7010Fourth parameter HEIGHT specifies the pixel height for the scroll bar. 7011Fourth parameter HEIGHT specifies the pixel height for the horizontal
7011Fifth parameter HORIZONTAL-TYPE specifies the type of the vertical 7012scroll bar. If HEIGHT is nil, use the scroll-bar height of WINDOW's
7012scroll bar: nil, bottom, or t. If HEIGHT is nil, use the frame's 7013frame. Fifth parameter HORIZONTAL-TYPE specifies the type of the
7013scroll-bar height. If HORIZONTAL-TYPE is t, use the frame's scroll-bar 7014horizontal scroll bar: nil, bottom, or t. If HORIZONTAL-TYPE is t, this
7014type. 7015means to use the frame's horizontal scroll-bar type.
7015 7016
7016Return t if scroll bars were actually changed and nil otherwise. */) 7017Return t if scroll bars were actually changed and nil otherwise. */)
7017 (Lisp_Object window, Lisp_Object width, Lisp_Object vertical_type, 7018 (Lisp_Object window, Lisp_Object width, Lisp_Object vertical_type,
@@ -7029,17 +7030,22 @@ DEFUN ("window-scroll-bars", Fwindow_scroll_bars, Swindow_scroll_bars,
7029 doc: /* Get width and type of scroll bars of window WINDOW. 7030 doc: /* Get width and type of scroll bars of window WINDOW.
7030WINDOW must be a live window and defaults to the selected one. 7031WINDOW must be a live window and defaults to the selected one.
7031 7032
7032Value is a list of the form (WIDTH COLS VERTICAL-TYPE HEIGHT LINES 7033Value is a list of the form (WIDTH COLUMNS VERTICAL-TYPE HEIGHT LINES
7033HORIZONTAL-TYPE). If WIDTH or HEIGHT is nil or TYPE is t, the window is 7034HORIZONTAL-TYPE). If WIDTH or HEIGHT is nil or VERTICAL-TYPE or
7034using the frame's corresponding value. */) 7035HORIZONTAL-TYPE is t, the window is using the frame's corresponding
7036value. */)
7035 (Lisp_Object window) 7037 (Lisp_Object window)
7036{ 7038{
7037 struct window *w = decode_live_window (window); 7039 struct window *w = decode_live_window (window);
7038 7040
7039 return Fcons (make_number (WINDOW_SCROLL_BAR_AREA_WIDTH (w)), 7041 return Fcons (((w->scroll_bar_width >= 0)
7042 ? make_number (w->scroll_bar_width)
7043 : Qnil),
7040 list5 (make_number (WINDOW_SCROLL_BAR_COLS (w)), 7044 list5 (make_number (WINDOW_SCROLL_BAR_COLS (w)),
7041 w->vertical_scroll_bar_type, 7045 w->vertical_scroll_bar_type,
7042 make_number (WINDOW_SCROLL_BAR_AREA_HEIGHT (w)), 7046 ((w->scroll_bar_height >= 0)
7047 ? make_number (w->scroll_bar_height)
7048 : Qnil),
7043 make_number (WINDOW_SCROLL_BAR_LINES (w)), 7049 make_number (WINDOW_SCROLL_BAR_LINES (w)),
7044 w->horizontal_scroll_bar_type)); 7050 w->horizontal_scroll_bar_type));
7045} 7051}