emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r118036: Add documentation for horizontal scroll bar


From: Martin Rudalics
Subject: [Emacs-diffs] trunk r118036: Add documentation for horizontal scroll bars and fix some minor issues.
Date: Sat, 04 Oct 2014 08:21:44 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 118036
revision-id: address@hidden
parent: address@hidden
committer: martin rudalics <address@hidden>
branch nick: trunk
timestamp: Sat 2014-10-04 10:20:24 +0200
message:
  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.
modified:
  doc/emacs/ChangeLog            changelog-20091113204419-o5vbwnq5f7feedwu-6227
  doc/emacs/frames.texi          
frames.texi-20091113204419-o5vbwnq5f7feedwu-6252
  doc/lispref/ChangeLog          changelog-20091113204419-o5vbwnq5f7feedwu-6155
  doc/lispref/display.texi       
display.texi-20091113204419-o5vbwnq5f7feedwu-6172
  doc/lispref/elisp.texi         elisp.texi-20091113204419-o5vbwnq5f7feedwu-6176
  doc/lispref/frames.texi        
frames.texi-20091113204419-o5vbwnq5f7feedwu-6180
  doc/lispref/windows.texi       
windows.texi-20091113204419-o5vbwnq5f7feedwu-6224
  etc/NEWS                       news-20141002041645-34n5fasbwydbo8t6-1
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/frame.el                  frame.el-20091113204419-o5vbwnq5f7feedwu-275
  lisp/scroll-bar.el             
scrollbar.el-20091113204419-o5vbwnq5f7feedwu-535
  lisp/window.el                 window.el-20091113204419-o5vbwnq5f7feedwu-94
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/buffer.c                   buffer.c-20091113204419-o5vbwnq5f7feedwu-264
  src/window.c                   window.c-20091113204419-o5vbwnq5f7feedwu-231
=== modified file 'doc/emacs/ChangeLog'
--- a/doc/emacs/ChangeLog       2014-10-04 07:05:21 +0000
+++ b/doc/emacs/ChangeLog       2014-10-04 08:20:24 +0000
@@ -1,3 +1,8 @@
+2014-10-04  Martin Rudalics  <address@hidden>
+
+       * frames.texi (Scroll Bars): Describe use of horizontal scroll
+       bars.
+
 2014-10-04  Glenn Morris  <address@hidden>
 
        * cmdargs.texi (Misc X):

=== modified file 'doc/emacs/frames.texi'
--- a/doc/emacs/frames.texi     2014-10-03 09:18:49 +0000
+++ b/doc/emacs/frames.texi     2014-10-04 08:20:24 +0000
@@ -904,10 +904,11 @@
 @section Scroll Bars
 @cindex Scroll Bar mode
 @cindex mode, Scroll Bar
address@hidden Vertical Scroll Bar
 
-  On graphical displays, there is a @dfn{scroll bar} on the side of
-each Emacs window.  Clicking @kbd{Mouse-1} on the scroll bar's up and
-down buttons scrolls the window by one line at a time.  Clicking
+  On graphical displays, there is a @dfn{vertical scroll bar} on the
+side of each Emacs window.  Clicking @kbd{Mouse-1} on the scroll bar's
+up and down buttons scrolls the window by one line at a time.  Clicking
 @kbd{Mouse-1} above or below the scroll bar's inner box scrolls the
 window by nearly the entire height of the window, like @kbd{M-v} and
 @kbd{C-v} respectively (@pxref{Moving Point}).  Dragging the inner box
@@ -921,23 +922,23 @@
 
 @findex scroll-bar-mode
 @findex toggle-scroll-bar
-  To toggle the use of scroll bars, type @kbd{M-x scroll-bar-mode}.
-This command applies to all frames, including frames yet to be
-created.  To toggle scroll bars for just the selected frame, use the
-command @kbd{M-x toggle-scroll-bar}.
+  To toggle the use of vertical scroll bars, type @kbd{M-x
+scroll-bar-mode}.  This command applies to all frames, including frames
+yet to be created.  To toggle vertical scroll bars for just the selected
+frame, use the command @kbd{M-x toggle-scroll-bar}.
 
 @vindex scroll-bar-mode
-  To control the use of scroll bars at startup, customize the variable
address@hidden  Its value should be either @code{right} (put
-scroll bars on the right side of windows), @code{left} (put them on
-the left), or @code{nil} (disable scroll bars).  By default, Emacs
-puts scroll bars on the right if it was compiled with GTK+ support on
-the X Window System, and on MS-Windows or Mac OS; Emacs puts scroll
-bars on the left if compiled on the X Window System without GTK+
-support (following the old convention for X applications).
+  To control the use of vertical scroll bars at startup, customize the
+variable @code{scroll-bar-mode}.  Its value should be either
address@hidden (put scroll bars on the right side of windows), @code{left}
+(put them on the left), or @code{nil} (disable vertical scroll bars).
+By default, Emacs puts scroll bars on the right if it was compiled with
+GTK+ support on the X Window System, and on MS-Windows or Mac OS; Emacs
+puts scroll bars on the left if compiled on the X Window System without
+GTK+ support (following the old convention for X applications).
 
 @vindex scroll-bar-width
address@hidden width of the scroll bar
address@hidden width of the vertical scroll bar
   You can also use the X resource @samp{verticalScrollBars} to enable
 or disable the scroll bars (@pxref{Resources}).  To control the scroll
 bar width, change the @code{scroll-bar-width} frame parameter
@@ -954,6 +955,39 @@
 bottom when the end of the buffer is shown.  You can not over-scroll
 when the entire buffer is visible.
 
address@hidden Horizontal Scroll Bar
address@hidden Horizontal Scroll Bar mode
+  On graphical displays with toolkit support, Emacs may also supply a
address@hidden scroll bar} on the bottom of each window.  Clicking
address@hidden on the that scroll bar's left and right buttons scrolls
+the window horizontally by one column at a time.  Clicking @kbd{Mouse-1}
+on the left or right of the scroll bar's inner box scrolls the window by
+four columns.  Dragging the inner box scrolls the window continuously.
+
+  Note that such horizontal scrolling can make the window's position of
+point disappear on the left or the right.  Typing a character to insert
+text or moving point with a keyboard command will usually bring it back
+into view.
+
address@hidden horizontal-scroll-bar-mode
+  To toggle the use of horizontal scroll bars, type @kbd{M-x
+horizontal-scroll-bar-mode}.  This command applies to all frames,
+including frames yet to be created.  To toggle horizontal scroll bars
+for just the selected frame, use the command @kbd{M-x
+toggle-horizontal-scroll-bar}.
+
address@hidden horizontal-scroll-bar-mode
+  To control the use of horizontal scroll bars at startup, customize the
+variable @code{horizontal-scroll-bar-mode}.
+
address@hidden scroll-bar-height
address@hidden height of the horizontal scroll bar
+  You can also use the X resource @samp{horizontalScrollBars} to enable
+or disable horizontal scroll bars (@pxref{Resources}).  To control the
+scroll bar height, change the @code{scroll-bar-height} frame parameter
+(@pxref{Frame Parameters,,, elisp, The Emacs Lisp Reference Manual}).
+
+
 @node Drag and Drop
 @section Drag and Drop
 @cindex drag and drop

=== modified file 'doc/lispref/ChangeLog'
--- a/doc/lispref/ChangeLog     2014-10-04 07:05:21 +0000
+++ b/doc/lispref/ChangeLog     2014-10-04 08:20:24 +0000
@@ -1,3 +1,14 @@
+2014-10-04  Martin Rudalics  <address@hidden>
+
+       * 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.
+
 2014-10-04  Glenn Morris  <address@hidden>
 
        * commands.texi (Generic Commands): Copyedits.

=== modified file 'doc/lispref/display.texi'
--- a/doc/lispref/display.texi  2014-10-04 06:45:19 +0000
+++ b/doc/lispref/display.texi  2014-10-04 08:20:24 +0000
@@ -23,7 +23,7 @@
 * Faces::               A face defines a graphics style for text characters:
                           font, colors, etc.
 * Fringes::             Controlling window fringes.
-* Scroll Bars::         Controlling vertical scroll bars.
+* Scroll Bars::         Controlling scroll bars.
 * Window Dividers::     Separating windows visually.
 * Display Property::    Enabling special display features.
 * Images::              Displaying images in Emacs buffers.
@@ -3866,101 +3866,163 @@
 @code{overlay-arrow-string} or @code{overlay-arrow} fringe indicator
 is used.
 
+
 @node Scroll Bars
 @section Scroll Bars
 @cindex scroll bars
 
 Normally the frame parameter @code{vertical-scroll-bars} controls
-whether the windows in the frame have vertical scroll bars, and
-whether they are on the left or right.  The frame parameter
address@hidden specifies how wide they are (@code{nil}
-meaning the default).  @xref{Layout Parameters}.
+whether the windows in the frame have vertical scroll bars, and whether
+they are on the left or right.  The frame parameter
address@hidden specifies how wide they are (@code{nil} meaning
+the default).
+
+   The frame parameter @code{horizontal-scroll-bars} controls whether
+the windows in the frame have horizontal scroll bars.  The frame
+parameter @code{scroll-bar-height} specifies how high they are
+(@code{nil} meaning the default).  @xref{Layout Parameters}.
+
address@hidden horizontal-scroll-bars-available-p
+   Horizontal scroll bars are not available on all platforms.  The
+function @code{horizontal-scroll-bars-available-p} which takes no
+argument returns address@hidden if they are available on your system.
+
+   The following three functions take as argument a live frame which
+defaults to the selected one.
 
 @defun frame-current-scroll-bars &optional frame
-This function reports the scroll bar type settings for frame
address@hidden  The value is a cons cell
address@hidden(@var{vertical-type} .@: @var{horizontal-type})}, where
address@hidden is either @code{left}, @code{right}, or @code{nil}
-(which means no scroll bar.)  @var{horizontal-type} is meant to
-specify the horizontal scroll bar type, but since they are not
-implemented, it is always @code{nil}.
address@hidden defun
-
address@hidden vertical-scroll-bar
-  You can enable or disable scroll bars for a particular buffer,
-by setting the variable @code{vertical-scroll-bar}.  This variable
-automatically becomes buffer-local when set.  The possible values are
address@hidden, @code{right}, @code{t}, which means to use the
-frame's default, and @code{nil} for no scroll bar.
-
-  You can also control this for individual windows.  Call the function
address@hidden to specify what to do for a specific window:
-
address@hidden set-window-scroll-bars window width &optional vertical-type 
horizontal-type
-This function sets the width and type of scroll bars for window
address@hidden
-
address@hidden specifies the scroll bar width in pixels (@code{nil} means
-use the width specified for the frame).  @var{vertical-type} specifies
-whether to have a vertical scroll bar and, if so, where.  The possible
-values are @code{left}, @code{right} and @code{nil}, just like the
-values of the @code{vertical-scroll-bars} frame parameter.
-
-The argument @var{horizontal-type} is meant to specify whether and
-where to have horizontal scroll bars, but since they are not
-implemented, it has no effect.  If @var{window} is @code{nil}, the
-selected window is used.
address@hidden defun
+This function reports the scroll bar types for frame @var{frame}.  The
+value is a cons cell @code{(@var{vertical-type} .@:
address@hidden)}, where @var{vertical-type} is either
address@hidden, @code{right}, or @code{nil} (which means no vertical scroll
+bar.)  @var{horizontal-type} is either @code{bottom} or @code{nil}
+(which means no horizontal scroll bar).
address@hidden defun
+
address@hidden frame-scroll-bar-width &optional Lisp_Object &optional frame
+This function returns the width of vertical scroll bars of @var{frame}
+in pixels.
address@hidden defun
+
address@hidden frame-scroll-bar-height &optional Lisp_Object &optional frame
+This function returns the height of horizontal scroll bars of
address@hidden in pixels.
address@hidden defun
+
+You can override the frame specific settings for individual windows by
+using the following function:
+
address@hidden set-window-scroll-bars window &optional width vertical-type 
height horizontal-type
+This function sets the width and/or height and the types of scroll bars
+for window @var{window}.
+
address@hidden specifies the width of the vertical scroll bar in pixels
+(@code{nil} means use the width specified for the frame).
address@hidden specifies whether to have a vertical scroll bar and,
+if so, where.  The possible values are @code{left}, @code{right},
address@hidden, which means to use the frame's default, and @code{nil} for no
+vertical scroll bar.
+
address@hidden specifies the height of the horizontal scroll bar in pixels
+(@code{nil} means use the height specified for the frame).
address@hidden specifies whether to have a horizontal scroll bar.
+The possible values are @code{bottom}, @code{t}, which means to use the
+frame's default, and @code{nil} for no horizontal scroll bar.
+
+If @var{window} is @code{nil}, the selected window is used.
address@hidden defun
+
+The following four functions take as argument a live window which
+defaults to the selected one.
 
 @defun window-scroll-bars &optional window
-Report the width and type of scroll bars specified for @var{window}.
-If @var{window} is omitted or @code{nil}, the selected window is used.
-The value is a list of the form @code{(@var{width}
address@hidden @var{vertical-type} @var{horizontal-type})}.  The value
address@hidden is the value that was specified for the width (which may
-be @code{nil}); @var{cols} is the number of columns that the scroll
-bar actually occupies.
-
address@hidden is not actually meaningful.
+This function returns a list of the form @code{(@var{width}
address@hidden @var{vertical-type} @var{height} @var{lines}
address@hidden)}.
+
+The value @var{width} is the value that was specified for the width of
+the vertical scroll bar (which may be @code{nil}); @var{columns} is the
+(possibly rounded) number of columns that the vertical scroll bar
+actually occupies.
+
+The value @var{height} is the value that was specified for the height of
+the horizontal scroll bar (which may be @code{nil}); @var{lines} is the
+(possibly rounded) number of lines that the horizontally scroll bar
+actually occupies.
address@hidden defun
+
address@hidden window-current-scroll-bars &optional window
+This function reports the scroll bar type for window @var{window}.  The
+value is a cons cell @code{(@var{vertical-type} .@:
address@hidden)}.  Unlike @code{window-scroll-bars}, this reports
+the scroll bar type actually used, once frame defaults and
address@hidden are taken into account.
 @end defun
 
 @defun window-scroll-bar-width &optional window
 This function returns the width in pixels of @var{window}'s vertical
-scrollbar.  @var{window} must be a live window, and defaults to the
-selected window.
+scrollbar.
address@hidden defun
+
address@hidden window-scroll-bar-height &optional window
+This function returns the height in pixels of @var{window}'s horizontal
+scrollbar.
 @end defun
 
 If you don't specify these values for a window with
 @code{set-window-scroll-bars}, the buffer-local variables
address@hidden and @code{scroll-bar-width} in the buffer being
-displayed control the window's vertical scroll bars.  The function
address@hidden, @code{horizontal-scroll-bar},
address@hidden and @code{scroll-bar-height} in the buffer being
+displayed control the window's scroll bars.  The function
 @code{set-window-buffer} examines these variables.  If you change them
-in a buffer that is already visible in a window, you can make the
-window take note of the new values by calling @code{set-window-buffer}
+in a buffer that is already visible in a window, you can make the window
+take note of the new values by calling @code{set-window-buffer}
 specifying the same buffer that is already displayed.
 
+You can control the appearance of scroll bars for a particular buffer by
+setting the following variables which automatically become buffer-local
+when set.
+
address@hidden vertical-scroll-bar
+This variable specifies the location of the vertical scroll bar.  The
+possible values are @code{left}, @code{right}, @code{t}, which means to
+use the frame's default, and @code{nil} for no scroll bar.
address@hidden defvar
+
address@hidden horizontal-scroll-bar
+This variable specifies the location of the horizontal scroll bar.  The
+possible values are @code{bottom}, @code{t}, which means to use the
+frame's default, and @code{nil} for no scroll bar.
address@hidden defvar
+
address@hidden scroll-bar-width
+This variable specifies the width of the buffer's vertical scroll bars,
+measured in pixels.  A value of @code{nil} means to use the value
+specified by the frame.
address@hidden defvar
+
address@hidden scroll-bar-height
+This variable specifies the height of the buffer's horizontal scroll
+bar, measured in pixels.  A value of @code{nil} means to use the value
+specified by the frame.
address@hidden defvar
+
+Finally you can toggle the display of scroll bars on all frames by
+customizing the variables @code{scroll-bar-mode} and
address@hidden
+
 @defopt scroll-bar-mode
-This variable, always local in all buffers, controls whether and where
-to put scroll bars in windows displaying the buffer.  The possible values
-are @code{nil} for no scroll bar, @code{left} to put a scroll bar on
-the left, and @code{right} to put a scroll bar on the right.
address@hidden defopt
-
address@hidden window-current-scroll-bars &optional window
-This function reports the scroll bar type for window @var{window}.
-If @var{window} is omitted or @code{nil}, the selected window is used.
-The value is a cons cell
address@hidden(@var{vertical-type} .@: @var{horizontal-type})}.  Unlike
address@hidden, this reports the scroll bar type actually
-used, once frame defaults and @code{scroll-bar-mode} are taken into
-account.
address@hidden defun
-
address@hidden scroll-bar-width
-This variable, always local in all buffers, specifies the width of the
-buffer's scroll bars, measured in pixels.  A value of @code{nil} means
-to use the value specified by the frame.
address@hidden defvar
+This variable controls whether and where to put vertical scroll bars in
+all frames.  The possible values are @code{nil} for no scroll bars,
address@hidden to put scroll bars on the left and @code{right} to put
+scroll bars on the right.
address@hidden defopt
+
address@hidden horizontal-scroll-bar-mode
+This variable controls whether to display horizontal scroll bars on all
+frames.
address@hidden defopt
+
 
 @node Window Dividers
 @section Window Dividers

=== modified file 'doc/lispref/elisp.texi'
--- a/doc/lispref/elisp.texi    2014-06-10 02:20:31 +0000
+++ b/doc/lispref/elisp.texi    2014-10-04 08:20:24 +0000
@@ -1343,7 +1343,7 @@
 * Faces::                   A face defines a graphics style
                               for text characters: font, colors, etc.
 * Fringes::                 Controlling window fringes.
-* Scroll Bars::             Controlling vertical scroll bars.
+* Scroll Bars::             Controlling scroll bars.
 * Window Dividers::         Separating windows visually.
 * Display Property::        Enabling special display features.
 * Images::                  Displaying images in Emacs buffers.

=== modified file 'doc/lispref/frames.texi'
--- a/doc/lispref/frames.texi   2014-10-04 07:05:21 +0000
+++ b/doc/lispref/frames.texi   2014-10-04 08:20:24 +0000
@@ -709,19 +709,21 @@
 of the frame they should be on.  The possible values are @code{left},
 @code{right}, and @code{nil} for no scroll bars.
 
address@hidden
 @vindex horizontal-scroll-bars, a frame parameter
 @item horizontal-scroll-bars
-Whether the frame has scroll bars for horizontal scrolling
-(address@hidden means yes).  Horizontal scroll bars are not currently
-implemented.
address@hidden ignore
+Whether the frame has scroll bars for horizontal scrolling (@code{t} and
address@hidden mean yes, @code{nil} means no).
 
 @vindex scroll-bar-width, a frame parameter
 @item scroll-bar-width
 The width of vertical scroll bars, in pixels, or @code{nil} meaning to
 use the default width.
 
address@hidden scroll-bar-height, a frame parameter
address@hidden scroll-bar-height
+The height of horizontal scroll bars, in pixels, or @code{nil} meaning
+to use the default height.
+
 @vindex left-fringe, a frame parameter
 @vindex right-fringe, a frame parameter
 @item left-fringe
@@ -735,14 +737,6 @@
 When using @code{set-frame-parameter}, passing a @code{nil} value
 imposes an actual default value of 8 pixels.
 
-The combined fringe widths must add up to an integral number of
-columns, so the actual default fringe widths for the frame, as
-reported by @code{frame-parameter}, may be larger than what you
-specify.  Any extra width is distributed evenly between the left and
-right fringe.  However, you can force one fringe or the other to a
-precise width by specifying that width as a negative integer.  If both
-widths are negative, only the left fringe gets the specified width.
-
 @vindex right-divider-width, a frame parameter
 @item right-divider-width
 The width (thickness) reserved for the right divider (@pxref{Window

=== modified file 'doc/lispref/windows.texi'
--- a/doc/lispref/windows.texi  2014-10-04 07:05:21 +0000
+++ b/doc/lispref/windows.texi  2014-10-04 08:20:24 +0000
@@ -394,13 +394,14 @@
 @group
         ____________________________________________
        |______________ Header Line ______________|RD| ^
-     ^ |LS|LF|LM|                       |RM|RF|RS|  | |
+     ^ |LS|LM|LF|                       |RF|RM|RS|  | |
      | |  |  |  |                       |  |  |  |  | |
 Window |  |  |  |       Text Area       |  |  |  |  | Window
 Body | |  |  |  |     (Window Body)     |  |  |  |  | Total
 Height |  |  |  |                       |  |  |  |  | Height
      | |  |  |  |<- Window Body Width ->|  |  |  |  | |
      v |__|__|__|_______________________|__|__|__|  | |
+       |_________ Horizontal Scroll Bar _________|  | |
        |_______________ Mode Line _______________|__| |
        |_____________ Bottom Divider _______________| v
         <---------- Window Total Width ------------>
@@ -414,15 +415,15 @@
   At the center of the window is the @dfn{text area}, or @dfn{body},
 where the buffer text is displayed.  The text area can be surrounded by
 a series of optional areas.  On the left and right, from innermost to
-outermost, these are the left and right margins, denoted by LM and RM in
-the schematic (@pxref{Display Margins}); the left and right fringes,
-denoted by LF and RF (@pxref{Fringes}); the left or right scroll bar,
-only one of which is present at any time, denoted by LS and RS
-(@pxref{Scroll Bars}); and the right divider, denoted by RD
+outermost, these are the left and right fringes, denoted by LF and RF
+(@pxref{Fringes}); the left and right margins, denoted by LM and RM in
+the schematic (@pxref{Display Margins}); the left or right vertical
+scroll bar, only one of which is present at any time, denoted by LS and
+RS (@pxref{Scroll Bars}); and the right divider, denoted by RD
 (@pxref{Window Dividers}).  At the top of the window is the header line
-(@pxref{Header Lines}); at the bottom of the window is the mode line
-(@pxref{Mode Line Format}) followed by the bottom divider (@pxref{Window
-Dividers}).
+(@pxref{Header Lines}).  At the bottom of the window are the horizontal
+scroll bar (@pxref{Scroll Bars}); the mode line (@pxref{Mode Line
+Format}); and the bottom divider (@pxref{Window Dividers}).
 
   Emacs provides miscellaneous functions for finding the height and
 width of a window.  The return value of many of these functions can be
@@ -439,11 +440,8 @@
 @cindex height of a window
 @cindex total height of a window
   The @dfn{total height} of a window is the number of lines comprising
-the window's body, the header line, the mode line and the bottom divider
-(if any).  Note that the height of a frame is not the same as the height
-of its root window (@pxref{Windows and Frames}), since a frame may also
-contain an echo area, a menu bar, and a tool bar (@pxref{Size and
-Position}).
+the window's body, the header line, the horizontal scroll bar, the mode
+line and the bottom divider (if any).
 
 @defun window-total-height &optional window round
 This function returns the total height, in lines, of the window
@@ -457,8 +455,8 @@
 parent window, the sum of the total heights of all its child windows
 internally equals the total height of their parent.  This means that
 although two windows have the same pixel height, their internal total
-heights may differ by one line.  This means also, that if this window is
-vertically combined and has a right sibling, the topmost row of that
+heights may differ by one line.  This means also, that if window is
+vertically combined and has a next sibling, the topmost row of that
 sibling can be calculated as the sum of this window's topmost row and
 total height (@pxref{Coordinates and Windows})
 
@@ -490,11 +488,10 @@
 equals the total width of their parent.  This means that although two
 windows have the same pixel width, their internal total widths may
 differ by one column.  This means also, that if this window is
-horizontally combined and has a right sibling, the leftmost column of
+horizontally combined and has a next sibling, the leftmost column of
 that sibling can be calculated as the sum of this window's leftmost
-column and total width (@pxref{Coordinates and Windows}).  The
-optional argument @var{round} behaves as it does for
address@hidden
+column and total width (@pxref{Coordinates and Windows}).  The optional
+argument @var{round} behaves as it does for @code{window-total-height}.
 @end defun
 
 @defun window-total-size &optional window horizontal round
@@ -517,9 +514,10 @@
 This function returns the total height of window @var{window} in pixels.
 @var{window} must be a valid window and defaults to the selected one.
 
-The return value includes mode and header line and a bottom divider, if
-any.  If @var{window} is an internal window, its pixel height is the
-pixel height of the screen areas spanned by its children.
+The return value includes mode and header line, a horizontal scroll bar
+and a bottom divider, if any.  If @var{window} is an internal window,
+its pixel height is the pixel height of the screen areas spanned by its
+children.
 @end defun
 
 @cindex window pixel height
@@ -542,10 +540,12 @@
 window has any adjacent windows.
 
 @defun window-full-height-p &optional window
-This function returns address@hidden if @var{window} has no other
-window above or below it in its frame, i.e., its total height equals
-the total height of the root window on that frame.  If @var{window} is
-omitted or @code{nil}, it defaults to the selected window.
+This function returns address@hidden if @var{window} has no other window
+above or below it in its frame.  More precisely, this means that the
+total height of @var{window} equals the total height of the root window
+on that frame.  The minibuffer window does not count in this regard.  If
address@hidden is omitted or @code{nil}, it defaults to the selected
+window.
 @end defun
 
 @defun window-full-width-p &optional window
@@ -559,7 +559,8 @@
 @cindex body height of a window
 @cindex window body width
 The @dfn{body height} of a window is the height of its text area, which
-does not include a mode or header line or a bottom divider.
+does not include a mode or header line, a horizontal scroll bar, or a
+bottom divider.
 
 @defun window-body-height &optional window pixelwise
 This function returns the height, in lines, of the body of window
@@ -646,7 +647,8 @@
 @defopt window-min-height
 This option specifies the minimum total height, in lines, of any window.
 Its value has to accommodate at least one text line as well as a mode
-and header line and a bottom divider, if present.
+and header line, a horizontal scroll bar and a bottom divider, if
+present.
 @end defopt
 
 @defopt window-min-width
@@ -685,10 +687,11 @@
 
 The return value makes sure that all components of @var{window} remain
 fully visible if @var{window}'s size were actually set to it.  With
address@hidden @code{nil} it includes the mode and header line and the
-bottom divider.  With @var{horizontal} address@hidden it includes the
-fringes, a scroll bar, and a right divider, if present.  It does not,
-however, include the space reserved for the margins.
address@hidden @code{nil} it includes the mode and header line, the
+horizontal scroll bar and the bottom divider.  With @var{horizontal}
address@hidden it includes the fringes, a scroll bar, and a right
+divider, if present.  It does not, however, include the space reserved
+for the margins.
 
 The optional argument @var{ignore}, if address@hidden, means ignore
 restrictions imposed by fixed size windows, @code{window-min-height} or
@@ -740,11 +743,11 @@
 (@pxref{Window Sizes}).  However, if the optional argument @var{ignore}
 is address@hidden, this function ignores @code{window-min-height} and
 @code{window-min-width}, as well as @code{window-size-fixed}.  Instead,
-it considers the minimum-height window to be one consisting of a header,
-a mode line and a bottom divider (if any), plus a text area one line
-tall; and a minimum-width window as one consisting of fringes, margins,
-a scroll bar and a right divider (if any), plus a text area two columns
-wide.
+it considers the minimum-height window to be one consisting of a header
+and a mode line, a horizontal scrollbar and a bottom divider (if any),
+plus a text area one line tall; and a minimum-width window as one
+consisting of fringes, margins, a scroll bar and a right divider (if
+any), plus a text area two columns wide.
 
 If the optional argument @var{pixelwise} is address@hidden,
 @var{delta} is interpreted as pixels.

=== modified file 'etc/NEWS'
--- a/etc/NEWS  2014-10-03 01:39:49 +0000
+++ b/etc/NEWS  2014-10-04 08:20:24 +0000
@@ -292,20 +292,28 @@
 
 * Changes in Frames and Windows Code in Emacs 25.1
 
++++
 ** Emacs can now draw horizontal scroll bars on some platforms that
-provide toolkit scroll bars, namely Gtk, Lucid, Motif and Windows.
+provide toolkit scroll bars, namely Gtk+, Lucid, Motif and Windows.
 Horizontal scroll bars are turned off by default.
 *** New function `horizontal-scroll-bars-available-p' telling whether
     horizontal scroll bars are available on the underlying system.
 *** New mode `horizontal-scroll-bar-mode' to toggle horizontal scroll
     bars on all existing and future frames.
+*** New function `toggle-horizontal-scroll-bar' to toggle horizontal
+    scroll bars on the selected frame.
 *** New frame parameters `horizontal-scroll-bars' and
     `scroll-bar-height' to set horizontal scroll bars and their height
     for individual frames and in `default-frame-alist'.
-*** New function `frame-scroll-bar-height' to return the height of
-    horizontal scroll bars on a specific frame.
+*** New functions `frame-scroll-bar-height' and
+    `window-scroll-bar-height' return the height of horizontal scroll
+    bars on a specific frame or window.
 *** `set-window-scroll-bars' now accepts five parameters where the last
     two specify height and type of the window's horizontal scroll bar.
+*** `window-scroll-bars' now returns type and sizes of horizontal scroll
+    bars too.
+*** New buffer-local variables `horizontal-scroll-bar' and
+    `scroll-bar-height'.
 
 ** The height of a frame's menu and tool bar are no more counted in the
 frame's text height.  This means that the text height stands only for

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-10-04 07:27:10 +0000
+++ b/lisp/ChangeLog    2014-10-04 08:20:24 +0000
@@ -1,3 +1,13 @@
+2014-10-04  Martin Rudalics  <address@hidden>
+
+       * 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.
+
 2014-10-04  Mark Oteiza  <address@hidden>  (tiny change)
 
        * files.el (auto-mode-alist): Use sh-mode for .zsh files.  (Bug#18488)

=== modified file 'lisp/frame.el'
--- a/lisp/frame.el     2014-10-04 07:05:21 +0000
+++ b/lisp/frame.el     2014-10-04 08:20:24 +0000
@@ -1263,16 +1263,18 @@
                           (list (cons 'name name))))
 
 (defun frame-current-scroll-bars (&optional frame)
-  "Return the current scroll-bar settings in frame FRAME.
-Value is a cons (VERTICAL . HORIZ0NTAL) where VERTICAL specifies the
-current location of the vertical scroll-bars (left, right, or nil),
-and HORIZONTAL specifies the current location of the horizontal scroll
-bars (top, bottom, or nil)."
-  (let ((vert (frame-parameter frame 'vertical-scroll-bars))
-       (hor nil))
-    (unless (memq vert '(left right nil))
-      (setq vert default-frame-scroll-bars))
-    (cons vert hor)))
+  "Return the current scroll-bar types for frame FRAME.
+Value is a cons (VERTICAL . HORIZ0NTAL) where VERTICAL specifies
+the current location of the vertical scroll-bars (`left', `right'
+or nil), and HORIZONTAL specifies the current location of the
+horizontal scroll bars (`bottom' or nil).  FRAME must specify a
+live frame and defaults to the selected one."
+  (let* ((frame (window-normalize-frame frame))
+        (vertical (frame-parameter frame 'vertical-scroll-bars))
+        (horizontal (frame-parameter frame 'horizontal-scroll-bars)))
+    (unless (memq vertical '(left right nil))
+      (setq vertical default-frame-scroll-bars))
+    (cons vertical (and horizontal 'bottom))))
 
 (defun frame-monitor-attributes (&optional frame)
   "Return the attributes of the physical monitor dominating FRAME.

=== modified file 'lisp/scroll-bar.el'
--- a/lisp/scroll-bar.el        2014-09-05 10:29:34 +0000
+++ b/lisp/scroll-bar.el        2014-10-04 08:20:24 +0000
@@ -79,7 +79,7 @@
      (htype lines)
      ((frame-parameter nil 'horizontal-scroll-bars)
       ;; nil means it's a non-toolkit scroll bar (which is currently
-      ;; impossible), and its width in columns is 14 pixels rounded up.
+      ;; impossible), and its height in lines is 14 pixels rounded up.
       (ceiling (or (frame-parameter nil 'scroll-bar-height) 14)
                (frame-char-width)))
      (0))))
@@ -178,7 +178,7 @@
 
 (defun toggle-scroll-bar (arg)
   "Toggle whether or not the selected frame has vertical scroll bars.
-With arg, turn vertical scroll bars on if and only if arg is positive.
+With ARG, turn vertical scroll bars on if and only if ARG is positive.
 The variable `scroll-bar-mode' controls which side the scroll bars are on
 when they are turned on; if it is nil, they go on the left."
   (interactive "P")
@@ -193,6 +193,21 @@
    (list (cons 'vertical-scroll-bars
               (if (> arg 0)
                   (or scroll-bar-mode default-frame-scroll-bars))))))
+
+(defun toggle-horizontal-scroll-bar (arg)
+  "Toggle whether or not the selected frame has horizontal scroll bars.
+With ARG, turn vertical scroll bars on if and only if ARG is positive."
+  (interactive "P")
+  (if (null arg)
+      (setq arg
+           (if (cdr (assq 'horizontal-scroll-bars
+                          (frame-parameters (selected-frame))))
+               -1 1))
+    (setq arg (prefix-numeric-value arg)))
+  (modify-frame-parameters
+   (selected-frame)
+   (list (cons 'horizontal-scroll-bars
+              (when (> arg 0) 'bottom)))))
 
 ;;;; Buffer navigation using the scroll bar.
 

=== modified file 'lisp/window.el'
--- a/lisp/window.el    2014-09-22 19:20:45 +0000
+++ b/lisp/window.el    2014-10-04 08:20:24 +0000
@@ -1745,9 +1745,6 @@
 (defalias 'window-height 'window-total-height)
 (defalias 'window-width 'window-body-width)
 
-;; Eventually the following two should work pixelwise.
-
-;; See discussion in bug#4543.
 (defun window-full-height-p (&optional window)
   "Return t if WINDOW is as high as its containing frame.
 More precisely, return t if and only if the total height of
@@ -1755,8 +1752,10 @@
 frame.  WINDOW must be a valid window and defaults to the
 selected one."
   (setq window (window-normalize-window window))
-  (= (window-pixel-height window)
-     (window-pixel-height (frame-root-window window))))
+  (if (window-minibuffer-p window)
+      (eq window (frame-root-window (window-frame window)))
+    (= (window-pixel-height window)
+       (window-pixel-height (frame-root-window window)))))
 
 (defun window-full-width-p (&optional window)
   "Return t if WINDOW is as wide as its containing frame.
@@ -1780,28 +1779,26 @@
     (window-body-height window pixelwise)))
 
 (defun window-current-scroll-bars (&optional window)
-  "Return the current scroll bar settings for WINDOW.
+  "Return the current scroll bar types for WINDOW.
 WINDOW must be a live window and defaults to the selected one.
 
 The return value is a cons cell (VERTICAL . HORIZONTAL) where
 VERTICAL specifies the current location of the vertical scroll
-bars (`left', `right', or nil), and HORIZONTAL specifies the
-current location of the horizontal scroll bars (`top', `bottom',
-or nil).
+bar (`left', `right' or nil), and HORIZONTAL specifies the
+current location of the horizontal scroll bar (`bottom' or nil).
 
 Unlike `window-scroll-bars', this function reports the scroll bar
 type actually used, once frame defaults and `scroll-bar-mode' are
 taken into account."
   (setq window (window-normalize-window window t))
-  (let ((vert (nth 2 (window-scroll-bars window)))
-       (hor nil))
-    (when (or (eq vert t) (eq hor t))
-      (let ((fcsb (frame-current-scroll-bars (window-frame window))))
-       (if (eq vert t)
-           (setq vert (car fcsb)))
-       (if (eq hor t)
-           (setq hor (cdr fcsb)))))
-    (cons vert hor)))
+  (let ((vertical (nth 2 (window-scroll-bars window)))
+       (horizontal (nth 5 (window-scroll-bars window)))
+       (inherited (frame-current-scroll-bars (window-frame window))))
+    (when (eq vertical t)
+      (setq vertical (car inherited)))
+    (when (eq horizontal t)
+      (setq horizontal (cdr inherited)))
+    (cons vertical (and horizontal 'bottom))))
 
 (defun walk-windows (fun &optional minibuf all-frames)
   "Cycle through all live windows, calling FUN for each one.
@@ -7176,7 +7173,7 @@
             (height
              (+ (cdr value)
                 (window-bottom-divider-width)
-                (nth 3 (window-scroll-bars)))))
+                (window-scroll-bar-height))))
        ;; Don't change height or width when the window's size is fixed
        ;; in either direction or ONLY forbids it.
        (cond
@@ -7335,7 +7332,7 @@
          ;; height.  Its width remains fixed.
          (setq height (+ (cdr (window-text-pixel-size
                                nil nil t nil (frame-pixel-height) t))
-                         (nth 3 (window-scroll-bars window))
+                         (window-scroll-bar-height window)
                          (window-bottom-divider-width)))
          ;; Round height.
          (unless pixelwise

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-10-03 16:05:12 +0000
+++ b/src/ChangeLog     2014-10-04 08:20:24 +0000
@@ -1,3 +1,10 @@
+2014-10-04  Martin Rudalics  <address@hidden>
+
+       * 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.
+
 2014-10-03  Eli Zaretskii  <address@hidden>
 
        * xdisp.c (move_it_by_lines): Call reseat_1 after moving the

=== modified file 'src/buffer.c'
--- a/src/buffer.c      2014-10-01 03:28:16 +0000
+++ b/src/buffer.c      2014-10-04 08:20:24 +0000
@@ -5925,12 +5925,12 @@
 
   DEFVAR_PER_BUFFER ("scroll-bar-width", &BVAR (current_buffer, 
scroll_bar_width),
                     Qintegerp,
-                    doc: /* Width of this buffer's scroll bars in pixels.
+                    doc: /* Width of this buffer's vertical scroll bars in 
pixels.
 A value of nil means to use the scroll bar width from the window's frame.  */);
 
   DEFVAR_PER_BUFFER ("scroll-bar-height", &BVAR (current_buffer, 
scroll_bar_height),
                     Qintegerp,
-                    doc: /* Height of this buffer's scroll bars in pixels.
+                    doc: /* Height of this buffer's horizontal scroll bars in 
pixels.
 A value of nil means to use the scroll bar height from the window's frame.  
*/);
 
   DEFVAR_PER_BUFFER ("vertical-scroll-bar", &BVAR (current_buffer, 
vertical_scroll_bar_type),

=== modified file 'src/window.c'
--- a/src/window.c      2014-09-30 23:19:31 +0000
+++ b/src/window.c      2014-10-04 08:20:24 +0000
@@ -7002,16 +7002,17 @@
        doc: /* Set width and type of scroll bars of window WINDOW.
 WINDOW must be a live window and defaults to the selected one.
 
-Second parameter WIDTH specifies the pixel width for the scroll bar.
+Second parameter WIDTH specifies the pixel width for the vertical scroll
+bar.  If WIDTH is nil, use the scroll-bar width of WINDOW's frame.
 Third parameter VERTICAL-TYPE specifies the type of the vertical scroll
-bar: left, right, or nil.  If WIDTH is nil, use the frame's scroll-bar
-width.  If VERTICAL-TYPE is t, use the frame's scroll-bar type.
+bar: left, right, or nil.  If VERTICAL-TYPE is t, this means use the
+frame's scroll-bar type.
 
-Fourth parameter HEIGHT specifies the pixel height for the scroll bar.
-Fifth parameter HORIZONTAL-TYPE specifies the type of the vertical
-scroll bar: nil, bottom, or t.  If HEIGHT is nil, use the frame's
-scroll-bar height.  If HORIZONTAL-TYPE is t, use the frame's scroll-bar
-type.
+Fourth parameter HEIGHT specifies the pixel height for the horizontal
+scroll bar.  If HEIGHT is nil, use the scroll-bar height of WINDOW's
+frame.  Fifth parameter HORIZONTAL-TYPE specifies the type of the
+horizontal scroll bar: nil, bottom, or t.  If HORIZONTAL-TYPE is t, this
+means to use the frame's horizontal scroll-bar type.
 
 Return t if scroll bars were actually changed and nil otherwise.  */)
   (Lisp_Object window, Lisp_Object width, Lisp_Object vertical_type,
@@ -7029,17 +7030,22 @@
        doc: /* Get width and type of scroll bars of window WINDOW.
 WINDOW must be a live window and defaults to the selected one.
 
-Value is a list of the form (WIDTH COLS VERTICAL-TYPE HEIGHT LINES
-HORIZONTAL-TYPE).  If WIDTH or HEIGHT is nil or TYPE is t, the window is
-using the frame's corresponding value.  */)
+Value is a list of the form (WIDTH COLUMNS VERTICAL-TYPE HEIGHT LINES
+HORIZONTAL-TYPE).  If WIDTH or HEIGHT is nil or VERTICAL-TYPE or
+HORIZONTAL-TYPE is t, the window is using the frame's corresponding
+value.  */)
   (Lisp_Object window)
 {
   struct window *w = decode_live_window (window);
 
-  return Fcons (make_number (WINDOW_SCROLL_BAR_AREA_WIDTH (w)),
+  return Fcons (((w->scroll_bar_width >= 0)
+                ? make_number (w->scroll_bar_width)
+                : Qnil),
                list5 (make_number (WINDOW_SCROLL_BAR_COLS (w)),
                       w->vertical_scroll_bar_type,
-                      make_number (WINDOW_SCROLL_BAR_AREA_HEIGHT (w)),
+                      ((w->scroll_bar_height >= 0)
+                       ? make_number (w->scroll_bar_height)
+                       : Qnil),
                       make_number (WINDOW_SCROLL_BAR_LINES (w)),
                       w->horizontal_scroll_bar_type));
 }


reply via email to

[Prev in Thread] Current Thread [Next in Thread]