summaryrefslogtreecommitdiff
path: root/lisp/scroll-bar.el
diff options
context:
space:
mode:
authorMasatake YAMATO <jet@gyve.org>2004-03-15 07:27:02 +0000
committerMasatake YAMATO <jet@gyve.org>2004-03-15 07:27:02 +0000
commit9fd76d04e8b93bb6116dffe49b8fdabdac71286f (patch)
treefe6d8918286e794fb0f8cd66991abf78f3c4f180 /lisp/scroll-bar.el
parent6e54fa536d7848031898ae11a228d40ca2c81a61 (diff)
downloademacs-9fd76d04e8b93bb6116dffe49b8fdabdac71286f.tar.gz
2004-03-15 Masatake YAMATO <jet@gyve.org>
* hl-line.el (hl-line-range-function): New variable. (hl-line-move): New function. (global-hl-line-highlight): Use `hl-line-move'. (hl-line-highlight): Ditto. * scroll-bar.el (scroll-bar-columns): New function derived from ruler-mode.el. * fringe.el (fringe-columns): New function derived from ruler-mode.el. * ruler-mode.el (top-level): Require scroll-bar and fringe. (ruler-mode-left-fringe-cols) (ruler-mode-right-fringe-cols): Use `fringe-columns'. (ruler-mode-right-scroll-bar-cols) (ruler-mode-left-scroll-bar-cols): Use `scroll-bar-columns'. (ruler-mode-ruler-function): New variable. (ruler-mode-header-line-format): Call `ruler-mode-ruler-function' if the value for `ruler-mode-ruler-function'is given. * hexl.el (hexl-mode-hook): Make the hook customizable. (hexl-address-area, hexl-ascii-area, hexl-ascii-cursor): New customize variables. (hexlify-buffer): Put font-lock-faces on the address area and the ascii area. (hexl-activate-ruler): New function. (hexl-follow-line): New function. (hexl-highlight-line-range): New function. (hexl-mode-ruler): New function.
Diffstat (limited to 'lisp/scroll-bar.el')
-rw-r--r--lisp/scroll-bar.el17
1 files changed, 17 insertions, 0 deletions
diff --git a/lisp/scroll-bar.el b/lisp/scroll-bar.el
index a2f2d22da5d..2d2921e9fc9 100644
--- a/lisp/scroll-bar.el
+++ b/lisp/scroll-bar.el
@@ -54,6 +54,23 @@ that scroll bar position."
;; with a large scroll bar portion can easily overflow a lisp int.
(truncate (/ (* (float (car num-denom)) whole) (cdr num-denom))))
+(defun scroll-bar-columns (side)
+ "Return the width, measured in columns, of the vertical scrollbar on SIDE.
+SIDE must be the symbol `left' or `right'."
+ (let* ((wsb (window-scroll-bars))
+ (vtype (nth 2 wsb))
+ (cols (nth 1 wsb)))
+ (cond
+ ((not (memq side '(left right)))
+ (error "`left' or `right' expected instead of %S" side))
+ ((and (eq vtype side) cols))
+ ((eq (frame-parameter nil 'vertical-scroll-bars) side)
+ ;; nil means it's a non-toolkit scroll bar, and its width in
+ ;; columns is 14 pixels rounded up.
+ (ceiling (or (frame-parameter nil 'scroll-bar-width) 14)
+ (frame-char-width)))
+ (0))))
+
;;;; Helpful functions for enabling and disabling scroll bars.