;ELC ;;; Compiled by cyd@localhost on Mon Apr 23 22:21:07 2007 ;;; from file /home/cyd/emacs/lisp/scroll-bar.el ;;; in Emacs version 22.0.99 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. (if (and (boundp 'emacs-version) (< (aref emacs-version (1- (length emacs-version))) ?A) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19.29"))) (error "`scroll-bar.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (require 'mouse) #@259 Given a scroll bar event EVENT, return the scroll bar position as a ratio. The value is a cons cell (PORTION . WHOLE) containing two integers whose ratio gives the event's vertical position in the scroll bar, with 0 referring to the top and 1 to the bottom. (defalias 'scroll-bar-event-ratio #[(event) "\3018\207" [event 2] 2 (#$ . 585)]) #@372 Given a pair (NUM . DENOM) and WHOLE, return (/ (* NUM WHOLE) DENOM). This is handy for scaling a position on a scroll bar into real units, like buffer positions. If SCROLL-BAR-POS is the (PORTION . WHOLE) pair from a scroll bar event, then (scroll-bar-scale SCROLL-BAR-POS (buffer-size)) is the position in the current buffer corresponding to that scroll bar position. (defalias 'scroll-bar-scale #[(num-denom whole) "\302\303@! _A\245!\207" [num-denom whole truncate float] 3 (#$ . 932)]) #@118 Return the width, measured in columns, of the vertical scrollbar on SIDE. SIDE must be the symbol `left' or `right'. (defalias 'scroll-bar-columns #[(side) "\304 \3058A@ \306>\204\307\310 \"\202; =\203\"\n\206;\311\312\313\" =\203:\314\311\312\315\"\2064\316\317 \"\202;\320+\207" [wsb vtype cols side window-scroll-bars 2 (left right) error "`left' or `right' expected instead of %S" frame-parameter nil vertical-scroll-bars ceiling scroll-bar-width 14 frame-char-width 0] 4 (#$ . 1433)]) (byte-code "\301B\302\301!\204\303\301\304\"\210\304\207" [current-load-list previous-scroll-bar-mode default-boundp set-default nil] 3) #@125 Non-nil means `set-scroll-bar-mode' should really do something. This is nil while loading `scroll-bar.el', and t afterward. (defvar scroll-bar-mode-explicit nil (#$ . 2085)) (defalias 'set-scroll-bar-mode-1 #[(ignore value) "\301!\207" [value set-scroll-bar-mode] 2]) #@67 Set `scroll-bar-mode' to VALUE and put the new value into effect. (defalias 'set-scroll-bar-mode #[(value) "\203\n \205@\306\f\236\211:\203 \241\210\202\"\306B\fB)\307 \211\n\205?\310\n@\306BC\"\210\nA\211\n\204+\311)\207" [scroll-bar-mode previous-scroll-bar-mode value scroll-bar-mode-explicit default-frame-alist parameter vertical-scroll-bars frame-list modify-frame-parameters nil frames] 5 (#$ . 2360)]) #@337 *Specify whether to have vertical scroll bars, and on which side. Possible values are nil (no scroll bars), `left' (scroll bars on left) and `right' (scroll bars on right). To set this variable in a Lisp program, use `set-scroll-bar-mode' to make it take real effect. Setting the variable with a customization buffer also takes effect. (custom-declare-variable 'scroll-bar-mode 'default-frame-scroll-bars '(#$ . -2798) :type '(choice (const :tag "none (nil)" nil) (const left) (const right)) :group 'frames :initialize 'custom-initialize-default :set 'set-scroll-bar-mode-1) (byte-code "\301\211\207" [scroll-bar-mode-explicit t] 2) #@249 Toggle display of vertical scroll bars on all frames. This command applies to all frames that exist and frames to be created in the future. With a numeric argument, if the argument is negative, turn off scroll bars; otherwise, turn on scroll bars. (defalias 'scroll-bar-mode #[(&optional flag) "\304\204\n ?\202\305!\211\247\203\306Y\205\n\206 !\207" [flag scroll-bar-mode previous-scroll-bar-mode default-frame-scroll-bars set-scroll-bar-mode prefix-numeric-value 0] 4 (#$ . 3439) "P"]) #@273 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. 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. (defalias 'toggle-scroll-bar #[(arg) "\204\303\304\305 !\236A\203\306\202\307\202\310!\311\305 \303\312V\205* \206*\nBC\"\207" [arg scroll-bar-mode default-frame-scroll-bars vertical-scroll-bars frame-parameters selected-frame -1 1 prefix-numeric-value modify-frame-parameters 0] 5 (#$ . 3947) "P"]) #@190 Toggle whether or not the selected frame has horizontal scroll bars. With arg, turn horizontal scroll bars on if and only if arg is positive. Horizontal scroll bars aren't implemented yet. (defalias 'toggle-horizontal-scroll-bar #[(arg) "\300\301!\207" [error "Horizontal scroll bars aren't implemented yet"] 2 (#$ . 4541) "P"]) #@118 Set the window start according to where the scroll bar is dragged. EVENT should be a scroll bar click or drag event. (defalias 'scroll-bar-set-window-start #[(event) "\211:\203\3048:\203\304\202\3058\202\306 `\307\310F)\211@\304 8\212\311\n!q\210\212e\312 deZ\"\\b\210\313 \210\314\n`\"-\207" [event end-position window portion-whole 2 1 selected-window (0 . 0) 0 window-buffer scroll-bar-scale beginning-of-line set-window-start] 6 (#$ . 4877) "e"]) #@44 Calculate new window start for drag event. (defalias 'scroll-bar-drag-position #[(portion-whole) "\212e\301deZ\"\\b\210\302 \210`)\207" [portion-whole scroll-bar-scale beginning-of-line] 5 (#$ . 5349)]) #@188 Set the window start according to where the scroll bar is dragged. Only change window start if the new start is substantially different. EVENT should be a scroll bar click or drag event. (defalias 'scroll-bar-maybe-set-window-start #[(event) "\211:\203\3068:\203\306\202\3078\202\310 `\311\312F)\211@\306 8\211@T AB\313\211\314\n!\212\315\n!q\210\316 !\316\f! T]Y\204Y W\203`\317\n \"\202e\317\n\".\207" [event end-position window portion-whole next-portion-whole portion-start 2 1 selected-window (0 . 0) 0 nil window-start window-buffer scroll-bar-drag-position set-window-start next-portion-start current-start] 5 (#$ . 5560) "e"]) (defalias 'scroll-bar-drag-1 #[(event) "\211:\203 \3048\202\305 `\306\307F)\211@\310 8\212\311\n!q\210e\312 deZ\"\\b\210\313\307\n\"\210\314\n`\",\207" [event start-position window portion-whole 1 selected-window (0 . 0) 0 2 window-buffer scroll-bar-scale vertical-motion set-window-start] 6]) #@133 Scroll the window by dragging the scroll bar slider. If you click outside the slider, the window scrolls to bring the slider there. (defalias 'scroll-bar-drag #[(event) "\306\307\n\211:\203\310\n8:\203\310\202\311\n8\202\"\312 `\313\307F)\211@\306r\314\f!q\210)\312 \315\316\317 \"r\320\216\321\f!\210 \206J`,\322\n!\210\323 \210\324\307!\210r\314\f!q\210 \211.\207" [done echo-keystrokes event end-position window before-scroll nil 0 2 1 selected-window (0 . 0) window-buffer mapcar #[(frame) "\301!D\207" [frame frame-selected-window] 3] frame-list ((byte-code "\305\211\203/\n@\306 @!\203(\307 \211A@)!\203(\310 @ \211A@)\"\210\nA\211\204*\307\f!\203:\311\f!\210\305\207" [save-selected-window-alist elt #1=#:--cl-dolist-temp-- x save-selected-window-window nil frame-live-p window-live-p set-frame-selected-window select-window] 4)) select-window scroll-bar-drag-1 (lambda nil (track-mouse (byte-code "?\205&\302 \211\242\303=\203\302  \242\304=\203 \305 !\210\202\306\211\202\207" [done event read-event mouse-movement scroll-bar-movement scroll-bar-drag-1 t] 3))) sit-for point-before-scroll save-selected-window-alist save-selected-window-window] 5 (#$ . 6541) "e"]) #@112 Scroll the window's top line down to the location of the scroll bar click. EVENT should be a scroll bar click. (defalias 'scroll-bar-scroll-down #[(event) "\211:\203\3068:\203\306\202\3078\202\310 `\311\312F)\211@\313r\314\n!q\210\f)\315\216\310 \316\317\320 \"r\321\216\306 8\322\n!\210 \206K`\323\324\325 S\"!\210)\326\312!.\207" [event end-position window before-scroll point-before-scroll save-selected-window-alist 2 1 selected-window (0 . 0) 0 nil window-buffer ((byte-code "r\303!q\210 )\303\207" [window before-scroll point-before-scroll window-buffer] 2)) mapcar #[(frame) "\301!D\207" [frame frame-selected-window] 3] frame-list ((byte-code "\305\211\203/\n@\306 @!\203(\307 \211A@)!\203(\310 @ \211A@)\"\210\nA\211\204*\307\f!\203:\311\f!\210\305\207" [save-selected-window-alist elt #1=#:--cl-dolist-temp-- x save-selected-window-window nil frame-live-p window-live-p set-frame-selected-window select-window] 4)) select-window scroll-down scroll-bar-scale window-height sit-for save-selected-window-window portion-whole] 5 (#$ . 7774) "e"]) #@108 Scroll the line next to the scroll bar click to the top of the window. EVENT should be a scroll bar click. (defalias 'scroll-bar-scroll-up #[(event) "\211:\203\3068:\203\306\202\3078\202\310 `\311\312F)\211@\313r\314\n!q\210\f)\315\216\310 \316\317\320 \"r\321\216\306 8\322\n!\210 \206K`\323\324\325 S\"!\210)\326\312!.\207" [event end-position window before-scroll point-before-scroll save-selected-window-alist 2 1 selected-window (0 . 0) 0 nil window-buffer ((byte-code "r\303!q\210 )\303\207" [window before-scroll point-before-scroll window-buffer] 2)) mapcar #[(frame) "\301!D\207" [frame frame-selected-window] 3] frame-list ((byte-code "\305\211\203/\n@\306 @!\203(\307 \211A@)!\203(\310 @ \211A@)\"\210\nA\211\204*\307\f!\203:\311\f!\210\305\207" [save-selected-window-alist elt #1=#:--cl-dolist-temp-- x save-selected-window-window nil frame-live-p window-live-p set-frame-selected-window select-window] 4)) select-window scroll-up scroll-bar-scale window-height sit-for save-selected-window-window portion-whole] 5 (#$ . 8877) "e"]) (defalias 'scroll-bar-toolkit-scroll #[(event) "\211:\203\3068:\203\306\202\3078\202\310 `\311\312F)\211@\313 8\314 \315=\206\356r\316\n!q\210 )\310 \317\320\321 \"&'r\322\216\323\n!\210\f\206O` \324=\203]\325\326!\210\202\337 \327=\203j\325\314!\210\202\337 \330=\203\236\306 8(\331(\332 S\")\325\333)!\204\213)\202\230(@\312W\203\227\334\202\230\307!\210*\202\337 \335=\203\253\325\334!\210\202\337 \336=\203\270\325\307!\210\202\337 \337=\203\306\340\ne\"\210\202\337 \341=\203\325db\210\342 \210\202\337 \343=\203\337\344!\210,\345\312!\210r\316\n!q\210\f\211),\207" [event end-position window part before-scroll point-before-scroll 2 1 selected-window (0 . 0) 0 4 nil end-scroll window-buffer mapcar #[(frame) "\301!D\207" [frame frame-selected-window] 3] frame-list ((byte-code "\305\211\203/\n@\306 @!\203(\307 \211A@)!\203(\310 @ \211A@)\"\210\nA\211\204*\307\f!\203:\311\f!\210\305\207" [save-selected-window-alist elt #1=#:--cl-dolist-temp-- x save-selected-window-window nil frame-live-p window-live-p set-frame-selected-window select-window] 4)) select-window above-handle scroll-up - below-handle ratio scroll-bar-scale window-height zerop -1 up down top set-window-start bottom recenter handle scroll-bar-drag-1 sit-for save-selected-window-alist save-selected-window-window portion-whole lines] 5 nil "e"]) (byte-code "\301\300!\203\203\302\303\304\"\210\202+\302\305\306\"\210\302\307\306\"\210\302\310\311\"\210\302\312\313\"\210\302\314\313\"\210\315\316!\207" [x-toolkit-scroll-bars boundp global-set-key [vertical-scroll-bar mouse-1] scroll-bar-toolkit-scroll [vertical-scroll-bar mouse-1] scroll-bar-scroll-up [vertical-scroll-bar drag-mouse-1] [vertical-scroll-bar down-mouse-2] scroll-bar-drag [vertical-scroll-bar mouse-3] scroll-bar-scroll-down [vertical-scroll-bar drag-mouse-3] provide scroll-bar] 3)