diff options
| author | Martin Rudalics | 2014-10-04 10:20:24 +0200 |
|---|---|---|
| committer | Martin Rudalics | 2014-10-04 10:20:24 +0200 |
| commit | 3c6ba8b49bb87ada8a8cca6566ad0b6e3fc4e57d (patch) | |
| tree | a47c285b071a0821573b19970cb80e1ea7150cc3 | |
| parent | cebc89eea10104af6a871b8ee78fb60d6c597898 (diff) | |
| download | emacs-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/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/emacs/frames.texi | 66 | ||||
| -rw-r--r-- | doc/lispref/ChangeLog | 11 | ||||
| -rw-r--r-- | doc/lispref/display.texi | 194 | ||||
| -rw-r--r-- | doc/lispref/elisp.texi | 2 | ||||
| -rw-r--r-- | doc/lispref/frames.texi | 20 | ||||
| -rw-r--r-- | doc/lispref/windows.texi | 79 | ||||
| -rw-r--r-- | etc/NEWS | 14 | ||||
| -rw-r--r-- | lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/frame.el | 22 | ||||
| -rw-r--r-- | lisp/scroll-bar.el | 19 | ||||
| -rw-r--r-- | lisp/window.el | 37 | ||||
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/buffer.c | 4 | ||||
| -rw-r--r-- | src/window.c | 32 |
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 @@ | |||
| 1 | 2014-10-04 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * frames.texi (Scroll Bars): Describe use of horizontal scroll | ||
| 4 | bars. | ||
| 5 | |||
| 1 | 2014-10-04 Glenn Morris <rgm@gnu.org> | 6 | 2014-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 |
| 909 | each Emacs window. Clicking @kbd{Mouse-1} on the scroll bar's up and | 910 | side of each Emacs window. Clicking @kbd{Mouse-1} on the scroll bar's |
| 910 | down buttons scrolls the window by one line at a time. Clicking | 911 | up 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 |
| 912 | window by nearly the entire height of the window, like @kbd{M-v} and | 913 | window 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 |
| 925 | This command applies to all frames, including frames yet to be | 926 | scroll-bar-mode}. This command applies to all frames, including frames |
| 926 | created. To toggle scroll bars for just the selected frame, use the | 927 | yet to be created. To toggle vertical scroll bars for just the selected |
| 927 | command @kbd{M-x toggle-scroll-bar}. | 928 | frame, 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 | 932 | variable @code{scroll-bar-mode}. Its value should be either |
| 932 | scroll 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} |
| 933 | the left), or @code{nil} (disable scroll bars). By default, Emacs | 934 | (put them on the left), or @code{nil} (disable vertical scroll bars). |
| 934 | puts scroll bars on the right if it was compiled with GTK+ support on | 935 | By default, Emacs puts scroll bars on the right if it was compiled with |
| 935 | the X Window System, and on MS-Windows or Mac OS; Emacs puts scroll | 936 | GTK+ support on the X Window System, and on MS-Windows or Mac OS; Emacs |
| 936 | bars on the left if compiled on the X Window System without GTK+ | 937 | puts scroll bars on the left if compiled on the X Window System without |
| 937 | support (following the old convention for X applications). | 938 | GTK+ 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 |
| 942 | or disable the scroll bars (@pxref{Resources}). To control the scroll | 943 | or disable the scroll bars (@pxref{Resources}). To control the scroll |
| 943 | bar width, change the @code{scroll-bar-width} frame parameter | 944 | bar 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 | |||
| 954 | bottom when the end of the buffer is shown. You can not over-scroll | 955 | bottom when the end of the buffer is shown. You can not over-scroll |
| 955 | when the entire buffer is visible. | 956 | when 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 | ||
| 963 | the window horizontally by one column at a time. Clicking @kbd{Mouse-1} | ||
| 964 | on the left or right of the scroll bar's inner box scrolls the window by | ||
| 965 | four columns. Dragging the inner box scrolls the window continuously. | ||
| 966 | |||
| 967 | Note that such horizontal scrolling can make the window's position of | ||
| 968 | point disappear on the left or the right. Typing a character to insert | ||
| 969 | text or moving point with a keyboard command will usually bring it back | ||
| 970 | into view. | ||
| 971 | |||
| 972 | @findex horizontal-scroll-bar-mode | ||
| 973 | To toggle the use of horizontal scroll bars, type @kbd{M-x | ||
| 974 | horizontal-scroll-bar-mode}. This command applies to all frames, | ||
| 975 | including frames yet to be created. To toggle horizontal scroll bars | ||
| 976 | for just the selected frame, use the command @kbd{M-x | ||
| 977 | toggle-horizontal-scroll-bar}. | ||
| 978 | |||
| 979 | @vindex horizontal-scroll-bar-mode | ||
| 980 | To control the use of horizontal scroll bars at startup, customize the | ||
| 981 | variable @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 | ||
| 986 | or disable horizontal scroll bars (@pxref{Resources}). To control the | ||
| 987 | scroll 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 @@ | |||
| 1 | 2014-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 | |||
| 1 | 2014-10-04 Glenn Morris <rgm@gnu.org> | 12 | 2014-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 |
| 3867 | is used. | 3867 | is 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 | ||
| 3873 | Normally the frame parameter @code{vertical-scroll-bars} controls | 3874 | Normally the frame parameter @code{vertical-scroll-bars} controls |
| 3874 | whether the windows in the frame have vertical scroll bars, and | 3875 | whether the windows in the frame have vertical scroll bars, and whether |
| 3875 | whether they are on the left or right. The frame parameter | 3876 | they 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 |
| 3877 | meaning the default). @xref{Layout Parameters}. | 3878 | the default). |
| 3879 | |||
| 3880 | The frame parameter @code{horizontal-scroll-bars} controls whether | ||
| 3881 | the windows in the frame have horizontal scroll bars. The frame | ||
| 3882 | parameter @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 | ||
| 3887 | function @code{horizontal-scroll-bars-available-p} which takes no | ||
| 3888 | argument returns non-@code{nil} if they are available on your system. | ||
| 3889 | |||
| 3890 | The following three functions take as argument a live frame which | ||
| 3891 | defaults to the selected one. | ||
| 3878 | 3892 | ||
| 3879 | @defun frame-current-scroll-bars &optional frame | 3893 | @defun frame-current-scroll-bars &optional frame |
| 3880 | This function reports the scroll bar type settings for frame | 3894 | This function reports the scroll bar types for frame @var{frame}. The |
| 3881 | @var{frame}. The value is a cons cell | 3895 | value 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 | 3898 | bar.) @var{horizontal-type} is either @code{bottom} or @code{nil} |
| 3885 | specify the horizontal scroll bar type, but since they are not | 3899 | (which means no horizontal scroll bar). |
| 3886 | implemented, 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, | ||
| 3891 | by setting the variable @code{vertical-scroll-bar}. This variable | ||
| 3892 | automatically becomes buffer-local when set. The possible values are | ||
| 3893 | @code{left}, @code{right}, @code{t}, which means to use the | ||
| 3894 | frame'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: | 3903 | This function returns the width of vertical scroll bars of @var{frame} |
| 3904 | in 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 |
| 3900 | This function sets the width and type of scroll bars for window | 3908 | This 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 | 3912 | You can override the frame specific settings for individual windows by |
| 3904 | use the width specified for the frame). @var{vertical-type} specifies | 3913 | using the following function: |
| 3905 | whether to have a vertical scroll bar and, if so, where. The possible | ||
| 3906 | values are @code{left}, @code{right} and @code{nil}, just like the | ||
| 3907 | values of the @code{vertical-scroll-bars} frame parameter. | ||
| 3908 | 3914 | ||
| 3909 | The argument @var{horizontal-type} is meant to specify whether and | 3915 | @defun set-window-scroll-bars window &optional width vertical-type height horizontal-type |
| 3910 | where to have horizontal scroll bars, but since they are not | 3916 | This function sets the width and/or height and the types of scroll bars |
| 3911 | implemented, it has no effect. If @var{window} is @code{nil}, the | 3917 | for window @var{window}. |
| 3912 | selected 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, | ||
| 3922 | if 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 | ||
| 3924 | vertical 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. | ||
| 3929 | The possible values are @code{bottom}, @code{t}, which means to use the | ||
| 3930 | frame's default, and @code{nil} for no horizontal scroll bar. | ||
| 3931 | |||
| 3932 | If @var{window} is @code{nil}, the selected window is used. | ||
| 3913 | @end defun | 3933 | @end defun |
| 3914 | 3934 | ||
| 3935 | The following four functions take as argument a live window which | ||
| 3936 | defaults to the selected one. | ||
| 3937 | |||
| 3915 | @defun window-scroll-bars &optional window | 3938 | @defun window-scroll-bars &optional window |
| 3916 | Report the width and type of scroll bars specified for @var{window}. | 3939 | This function returns a list of the form @code{(@var{width} |
| 3917 | If @var{window} is omitted or @code{nil}, the selected window is used. | 3940 | @var{columns} @var{vertical-type} @var{height} @var{lines} |
| 3918 | The 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 | ||
| 3921 | be @code{nil}); @var{cols} is the number of columns that the scroll | ||
| 3922 | bar actually occupies. | ||
| 3923 | 3942 | ||
| 3924 | @var{horizontal-type} is not actually meaningful. | 3943 | The value @var{width} is the value that was specified for the width of |
| 3944 | the vertical scroll bar (which may be @code{nil}); @var{columns} is the | ||
| 3945 | (possibly rounded) number of columns that the vertical scroll bar | ||
| 3946 | actually occupies. | ||
| 3947 | |||
| 3948 | The value @var{height} is the value that was specified for the height of | ||
| 3949 | the horizontal scroll bar (which may be @code{nil}); @var{lines} is the | ||
| 3950 | (possibly rounded) number of lines that the horizontally scroll bar | ||
| 3951 | actually occupies. | ||
| 3952 | @end defun | ||
| 3953 | |||
| 3954 | @defun window-current-scroll-bars &optional window | ||
| 3955 | This function reports the scroll bar type for window @var{window}. The | ||
| 3956 | value is a cons cell @code{(@var{vertical-type} .@: | ||
| 3957 | @var{horizontal-type})}. Unlike @code{window-scroll-bars}, this reports | ||
| 3958 | the 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 |
| 3928 | This function returns the width in pixels of @var{window}'s vertical | 3963 | This function returns the width in pixels of @var{window}'s vertical |
| 3929 | scrollbar. @var{window} must be a live window, and defaults to the | 3964 | scrollbar. |
| 3930 | selected window. | 3965 | @end defun |
| 3966 | |||
| 3967 | @defun window-scroll-bar-height &optional window | ||
| 3968 | This function returns the height in pixels of @var{window}'s horizontal | ||
| 3969 | scrollbar. | ||
| 3931 | @end defun | 3970 | @end defun |
| 3932 | 3971 | ||
| 3933 | If you don't specify these values for a window with | 3972 | If 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}, |
| 3936 | displayed control the window's vertical scroll bars. The function | 3975 | @code{scroll-bar-width} and @code{scroll-bar-height} in the buffer being |
| 3976 | displayed 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 |
| 3938 | in a buffer that is already visible in a window, you can make the | 3978 | in a buffer that is already visible in a window, you can make the window |
| 3939 | window take note of the new values by calling @code{set-window-buffer} | 3979 | take note of the new values by calling @code{set-window-buffer} |
| 3940 | specifying the same buffer that is already displayed. | 3980 | specifying the same buffer that is already displayed. |
| 3941 | 3981 | ||
| 3942 | @defopt scroll-bar-mode | 3982 | You can control the appearance of scroll bars for a particular buffer by |
| 3943 | This variable, always local in all buffers, controls whether and where | 3983 | setting the following variables which automatically become buffer-local |
| 3944 | to put scroll bars in windows displaying the buffer. The possible values | 3984 | when set. |
| 3945 | are @code{nil} for no scroll bar, @code{left} to put a scroll bar on | ||
| 3946 | the 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 |
| 3950 | This function reports the scroll bar type for window @var{window}. | 3987 | This variable specifies the location of the vertical scroll bar. The |
| 3951 | If @var{window} is omitted or @code{nil}, the selected window is used. | 3988 | possible values are @code{left}, @code{right}, @code{t}, which means to |
| 3952 | The value is a cons cell | 3989 | use 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 | |
| 3955 | used, once frame defaults and @code{scroll-bar-mode} are taken into | 3992 | @defvar horizontal-scroll-bar |
| 3956 | account. | 3993 | This variable specifies the location of the horizontal scroll bar. The |
| 3957 | @end defun | 3994 | possible values are @code{bottom}, @code{t}, which means to use the |
| 3995 | frame's default, and @code{nil} for no scroll bar. | ||
| 3996 | @end defvar | ||
| 3958 | 3997 | ||
| 3959 | @defvar scroll-bar-width | 3998 | @defvar scroll-bar-width |
| 3960 | This variable, always local in all buffers, specifies the width of the | 3999 | This variable specifies the width of the buffer's vertical scroll bars, |
| 3961 | buffer's scroll bars, measured in pixels. A value of @code{nil} means | 4000 | measured in pixels. A value of @code{nil} means to use the value |
| 3962 | to use the value specified by the frame. | 4001 | specified by the frame. |
| 3963 | @end defvar | 4002 | @end defvar |
| 3964 | 4003 | ||
| 4004 | @defvar scroll-bar-height | ||
| 4005 | This variable specifies the height of the buffer's horizontal scroll | ||
| 4006 | bar, measured in pixels. A value of @code{nil} means to use the value | ||
| 4007 | specified by the frame. | ||
| 4008 | @end defvar | ||
| 4009 | |||
| 4010 | Finally you can toggle the display of scroll bars on all frames by | ||
| 4011 | customizing the variables @code{scroll-bar-mode} and | ||
| 4012 | @code{horizontal-scroll-bar-mode}. | ||
| 4013 | |||
| 4014 | @defopt scroll-bar-mode | ||
| 4015 | This variable controls whether and where to put vertical scroll bars in | ||
| 4016 | all 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 | ||
| 4018 | scroll bars on the right. | ||
| 4019 | @end defopt | ||
| 4020 | |||
| 4021 | @defopt horizontal-scroll-bar-mode | ||
| 4022 | This variable controls whether to display horizontal scroll bars on all | ||
| 4023 | frames. | ||
| 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 | |||
| 709 | of the frame they should be on. The possible values are @code{left}, | 709 | of 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 |
| 715 | Whether the frame has scroll bars for horizontal scrolling | 714 | Whether 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). |
| 717 | implemented. | ||
| 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 |
| 722 | The width of vertical scroll bars, in pixels, or @code{nil} meaning to | 719 | The width of vertical scroll bars, in pixels, or @code{nil} meaning to |
| 723 | use the default width. | 720 | use the default width. |
| 724 | 721 | ||
| 722 | @vindex scroll-bar-height, a frame parameter | ||
| 723 | @item scroll-bar-height | ||
| 724 | The height of horizontal scroll bars, in pixels, or @code{nil} meaning | ||
| 725 | to 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. | |||
| 735 | When using @code{set-frame-parameter}, passing a @code{nil} value | 737 | When using @code{set-frame-parameter}, passing a @code{nil} value |
| 736 | imposes an actual default value of 8 pixels. | 738 | imposes an actual default value of 8 pixels. |
| 737 | 739 | ||
| 738 | The combined fringe widths must add up to an integral number of | ||
| 739 | columns, so the actual default fringe widths for the frame, as | ||
| 740 | reported by @code{frame-parameter}, may be larger than what you | ||
| 741 | specify. Any extra width is distributed evenly between the left and | ||
| 742 | right fringe. However, you can force one fringe or the other to a | ||
| 743 | precise width by specifying that width as a negative integer. If both | ||
| 744 | widths 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 |
| 748 | The width (thickness) reserved for the right divider (@pxref{Window | 742 | The 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 | | | | | | | | | | | | |
| 399 | Window | | | | Text Area | | | | | Window | 399 | Window | | | | Text Area | | | | | Window |
| 400 | Body | | | | | (Window Body) | | | | | Total | 400 | Body | | | | | (Window Body) | | | | | Total |
| 401 | Height | | | | | | | | | Height | 401 | Height | | | | | | | | | 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}, |
| 415 | where the buffer text is displayed. The text area can be surrounded by | 416 | where the buffer text is displayed. The text area can be surrounded by |
| 416 | a series of optional areas. On the left and right, from innermost to | 417 | a series of optional areas. On the left and right, from innermost to |
| 417 | outermost, these are the left and right margins, denoted by LM and RM in | 418 | outermost, these are the left and right fringes, denoted by LF and RF |
| 418 | the schematic (@pxref{Display Margins}); the left and right fringes, | 419 | (@pxref{Fringes}); the left and right margins, denoted by LM and RM in |
| 419 | denoted by LF and RF (@pxref{Fringes}); the left or right scroll bar, | 420 | the schematic (@pxref{Display Margins}); the left or right vertical |
| 420 | only one of which is present at any time, denoted by LS and RS | 421 | scroll 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 | 422 | RS (@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 | 425 | scroll bar (@pxref{Scroll Bars}); the mode line (@pxref{Mode Line |
| 425 | Dividers}). | 426 | Format}); 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 |
| 428 | width of a window. The return value of many of these functions can be | 429 | width 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 |
| 442 | the window's body, the header line, the mode line and the bottom divider | 443 | the 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 | 444 | line and the bottom divider (if any). |
| 444 | of its root window (@pxref{Windows and Frames}), since a frame may also | ||
| 445 | contain an echo area, a menu bar, and a tool bar (@pxref{Size and | ||
| 446 | Position}). | ||
| 447 | 445 | ||
| 448 | @defun window-total-height &optional window round | 446 | @defun window-total-height &optional window round |
| 449 | This function returns the total height, in lines, of the window | 447 | This 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 | |||
| 457 | parent window, the sum of the total heights of all its child windows | 455 | parent window, the sum of the total heights of all its child windows |
| 458 | internally equals the total height of their parent. This means that | 456 | internally equals the total height of their parent. This means that |
| 459 | although two windows have the same pixel height, their internal total | 457 | although two windows have the same pixel height, their internal total |
| 460 | heights may differ by one line. This means also, that if this window is | 458 | heights may differ by one line. This means also, that if window is |
| 461 | vertically combined and has a right sibling, the topmost row of that | 459 | vertically combined and has a next sibling, the topmost row of that |
| 462 | sibling can be calculated as the sum of this window's topmost row and | 460 | sibling can be calculated as the sum of this window's topmost row and |
| 463 | total height (@pxref{Coordinates and Windows}) | 461 | total height (@pxref{Coordinates and Windows}) |
| 464 | 462 | ||
| @@ -490,11 +488,10 @@ window, the sum of the total widths of all its children internally | |||
| 490 | equals the total width of their parent. This means that although two | 488 | equals the total width of their parent. This means that although two |
| 491 | windows have the same pixel width, their internal total widths may | 489 | windows have the same pixel width, their internal total widths may |
| 492 | differ by one column. This means also, that if this window is | 490 | differ by one column. This means also, that if this window is |
| 493 | horizontally combined and has a right sibling, the leftmost column of | 491 | horizontally combined and has a next sibling, the leftmost column of |
| 494 | that sibling can be calculated as the sum of this window's leftmost | 492 | that sibling can be calculated as the sum of this window's leftmost |
| 495 | column and total width (@pxref{Coordinates and Windows}). The | 493 | column and total width (@pxref{Coordinates and Windows}). The optional |
| 496 | optional argument @var{round} behaves as it does for | 494 | argument @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. | |||
| 517 | This function returns the total height of window @var{window} in pixels. | 514 | This 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 | ||
| 520 | The return value includes mode and header line and a bottom divider, if | 517 | The return value includes mode and header line, a horizontal scroll bar |
| 521 | any. If @var{window} is an internal window, its pixel height is the | 518 | and a bottom divider, if any. If @var{window} is an internal window, |
| 522 | pixel height of the screen areas spanned by its children. | 519 | its pixel height is the pixel height of the screen areas spanned by its |
| 520 | children. | ||
| 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. | |||
| 542 | window has any adjacent windows. | 540 | window has any adjacent windows. |
| 543 | 541 | ||
| 544 | @defun window-full-height-p &optional window | 542 | @defun window-full-height-p &optional window |
| 545 | This function returns non-@code{nil} if @var{window} has no other | 543 | This function returns non-@code{nil} if @var{window} has no other window |
| 546 | window above or below it in its frame, i.e., its total height equals | 544 | above or below it in its frame. More precisely, this means that the |
| 547 | the total height of the root window on that frame. If @var{window} is | 545 | total height of @var{window} equals the total height of the root window |
| 548 | omitted or @code{nil}, it defaults to the selected window. | 546 | on 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 | ||
| 548 | window. | ||
| 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 |
| 561 | The @dfn{body height} of a window is the height of its text area, which | 561 | The @dfn{body height} of a window is the height of its text area, which |
| 562 | does not include a mode or header line or a bottom divider. | 562 | does not include a mode or header line, a horizontal scroll bar, or a |
| 563 | bottom divider. | ||
| 563 | 564 | ||
| 564 | @defun window-body-height &optional window pixelwise | 565 | @defun window-body-height &optional window pixelwise |
| 565 | This function returns the height, in lines, of the body of window | 566 | This 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 |
| 647 | This option specifies the minimum total height, in lines, of any window. | 648 | This option specifies the minimum total height, in lines, of any window. |
| 648 | Its value has to accommodate at least one text line as well as a mode | 649 | Its value has to accommodate at least one text line as well as a mode |
| 649 | and header line and a bottom divider, if present. | 650 | and header line, a horizontal scroll bar and a bottom divider, if |
| 651 | present. | ||
| 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 | ||
| 686 | The return value makes sure that all components of @var{window} remain | 688 | The return value makes sure that all components of @var{window} remain |
| 687 | fully visible if @var{window}'s size were actually set to it. With | 689 | fully 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 |
| 689 | bottom divider. With @var{horizontal} non-@code{nil} it includes the | 691 | horizontal scroll bar and the bottom divider. With @var{horizontal} |
| 690 | fringes, a scroll bar, and a right divider, if present. It does not, | 692 | non-@code{nil} it includes the fringes, a scroll bar, and a right |
| 691 | however, include the space reserved for the margins. | 693 | divider, if present. It does not, however, include the space reserved |
| 694 | for the margins. | ||
| 692 | 695 | ||
| 693 | The optional argument @var{ignore}, if non-@code{nil}, means ignore | 696 | The optional argument @var{ignore}, if non-@code{nil}, means ignore |
| 694 | restrictions imposed by fixed size windows, @code{window-min-height} or | 697 | restrictions 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} |
| 741 | is non-@code{nil}, this function ignores @code{window-min-height} and | 744 | is 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, |
| 743 | it considers the minimum-height window to be one consisting of a header, | 746 | it considers the minimum-height window to be one consisting of a header |
| 744 | a mode line and a bottom divider (if any), plus a text area one line | 747 | and a mode line, a horizontal scrollbar and a bottom divider (if any), |
| 745 | tall; and a minimum-width window as one consisting of fringes, margins, | 748 | plus a text area one line tall; and a minimum-width window as one |
| 746 | a scroll bar and a right divider (if any), plus a text area two columns | 749 | consisting of fringes, margins, a scroll bar and a right divider (if |
| 747 | wide. | 750 | any), plus a text area two columns wide. |
| 748 | 751 | ||
| 749 | If the optional argument @var{pixelwise} is non-@code{nil}, | 752 | If the optional argument @var{pixelwise} is non-@code{nil}, |
| 750 | @var{delta} is interpreted as pixels. | 753 | @var{delta} is interpreted as pixels. |
| @@ -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 |
| 296 | provide toolkit scroll bars, namely Gtk, Lucid, Motif and Windows. | 297 | provide toolkit scroll bars, namely Gtk+, Lucid, Motif and Windows. |
| 297 | Horizontal scroll bars are turned off by default. | 298 | Horizontal 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 |
| 311 | frame's text height. This means that the text height stands only for | 319 | frame'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 @@ | |||
| 1 | 2014-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 | |||
| 1 | 2014-10-04 Mark Oteiza <mvoteiza@udel.edu> (tiny change) | 11 | 2014-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. |
| 1267 | Value is a cons (VERTICAL . HORIZ0NTAL) where VERTICAL specifies the | 1267 | Value is a cons (VERTICAL . HORIZ0NTAL) where VERTICAL specifies |
| 1268 | current location of the vertical scroll-bars (left, right, or nil), | 1268 | the current location of the vertical scroll-bars (`left', `right' |
| 1269 | and HORIZONTAL specifies the current location of the horizontal scroll | 1269 | or nil), and HORIZONTAL specifies the current location of the |
| 1270 | bars (top, bottom, or nil)." | 1270 | horizontal scroll bars (`bottom' or nil). FRAME must specify a |
| 1271 | (let ((vert (frame-parameter frame 'vertical-scroll-bars)) | 1271 | live 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. |
| 181 | With arg, turn vertical scroll bars on if and only if arg is positive. | 181 | With ARG, turn vertical scroll bars on if and only if ARG is positive. |
| 182 | The variable `scroll-bar-mode' controls which side the scroll bars are on | 182 | The variable `scroll-bar-mode' controls which side the scroll bars are on |
| 183 | when they are turned on; if it is nil, they go on the left." | 183 | when 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. | ||
| 199 | With 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. |
| 1753 | More precisely, return t if and only if the total height of | 1750 | More 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 | |||
| 1755 | frame. WINDOW must be a valid window and defaults to the | 1752 | frame. WINDOW must be a valid window and defaults to the |
| 1756 | selected one." | 1753 | selected 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. |
| 1784 | WINDOW must be a live window and defaults to the selected one. | 1783 | WINDOW must be a live window and defaults to the selected one. |
| 1785 | 1784 | ||
| 1786 | The return value is a cons cell (VERTICAL . HORIZONTAL) where | 1785 | The return value is a cons cell (VERTICAL . HORIZONTAL) where |
| 1787 | VERTICAL specifies the current location of the vertical scroll | 1786 | VERTICAL specifies the current location of the vertical scroll |
| 1788 | bars (`left', `right', or nil), and HORIZONTAL specifies the | 1787 | bar (`left', `right' or nil), and HORIZONTAL specifies the |
| 1789 | current location of the horizontal scroll bars (`top', `bottom', | 1788 | current location of the horizontal scroll bar (`bottom' or nil). |
| 1790 | or nil). | ||
| 1791 | 1789 | ||
| 1792 | Unlike `window-scroll-bars', this function reports the scroll bar | 1790 | Unlike `window-scroll-bars', this function reports the scroll bar |
| 1793 | type actually used, once frame defaults and `scroll-bar-mode' are | 1791 | type actually used, once frame defaults and `scroll-bar-mode' are |
| 1794 | taken into account." | 1792 | taken 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 @@ | |||
| 1 | 2014-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 | |||
| 1 | 2014-10-03 Eli Zaretskii <eliz@gnu.org> | 8 | 2014-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. |
| 5929 | A value of nil means to use the scroll bar width from the window's frame. */); | 5929 | A 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. |
| 5934 | A value of nil means to use the scroll bar height from the window's frame. */); | 5934 | A 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. |
| 7003 | WINDOW must be a live window and defaults to the selected one. | 7003 | WINDOW must be a live window and defaults to the selected one. |
| 7004 | 7004 | ||
| 7005 | Second parameter WIDTH specifies the pixel width for the scroll bar. | 7005 | Second parameter WIDTH specifies the pixel width for the vertical scroll |
| 7006 | bar. If WIDTH is nil, use the scroll-bar width of WINDOW's frame. | ||
| 7006 | Third parameter VERTICAL-TYPE specifies the type of the vertical scroll | 7007 | Third parameter VERTICAL-TYPE specifies the type of the vertical scroll |
| 7007 | bar: left, right, or nil. If WIDTH is nil, use the frame's scroll-bar | 7008 | bar: left, right, or nil. If VERTICAL-TYPE is t, this means use the |
| 7008 | width. If VERTICAL-TYPE is t, use the frame's scroll-bar type. | 7009 | frame's scroll-bar type. |
| 7009 | 7010 | ||
| 7010 | Fourth parameter HEIGHT specifies the pixel height for the scroll bar. | 7011 | Fourth parameter HEIGHT specifies the pixel height for the horizontal |
| 7011 | Fifth parameter HORIZONTAL-TYPE specifies the type of the vertical | 7012 | scroll bar. If HEIGHT is nil, use the scroll-bar height of WINDOW's |
| 7012 | scroll bar: nil, bottom, or t. If HEIGHT is nil, use the frame's | 7013 | frame. Fifth parameter HORIZONTAL-TYPE specifies the type of the |
| 7013 | scroll-bar height. If HORIZONTAL-TYPE is t, use the frame's scroll-bar | 7014 | horizontal scroll bar: nil, bottom, or t. If HORIZONTAL-TYPE is t, this |
| 7014 | type. | 7015 | means to use the frame's horizontal scroll-bar type. |
| 7015 | 7016 | ||
| 7016 | Return t if scroll bars were actually changed and nil otherwise. */) | 7017 | Return 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. |
| 7030 | WINDOW must be a live window and defaults to the selected one. | 7031 | WINDOW must be a live window and defaults to the selected one. |
| 7031 | 7032 | ||
| 7032 | Value is a list of the form (WIDTH COLS VERTICAL-TYPE HEIGHT LINES | 7033 | Value is a list of the form (WIDTH COLUMNS VERTICAL-TYPE HEIGHT LINES |
| 7033 | HORIZONTAL-TYPE). If WIDTH or HEIGHT is nil or TYPE is t, the window is | 7034 | HORIZONTAL-TYPE). If WIDTH or HEIGHT is nil or VERTICAL-TYPE or |
| 7034 | using the frame's corresponding value. */) | 7035 | HORIZONTAL-TYPE is t, the window is using the frame's corresponding |
| 7036 | value. */) | ||
| 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 | } |