summaryrefslogtreecommitdiff
path: root/lisp/scroll-bar.el
diff options
context:
space:
mode:
authorMartin Rudalics <rudalics@gmx.at>2014-10-04 10:20:24 +0200
committerMartin Rudalics <rudalics@gmx.at>2014-10-04 10:20:24 +0200
commit3c6ba8b49bb87ada8a8cca6566ad0b6e3fc4e57d (patch)
treea47c285b071a0821573b19970cb80e1ea7150cc3 /lisp/scroll-bar.el
parentcebc89eea10104af6a871b8ee78fb60d6c597898 (diff)
downloademacs-3c6ba8b49bb87ada8a8cca6566ad0b6e3fc4e57d.tar.gz
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.
Diffstat (limited to 'lisp/scroll-bar.el')
-rw-r--r--lisp/scroll-bar.el19
1 files changed, 17 insertions, 2 deletions
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'."
(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 @@ created in the future."
(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 @@ when they are turned on; if it is nil, they go on the left."
(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.