Mercurial > hg > xemacs-beta
changeset 1621:9cf129cb99b9
[xemacs-hg @ 2003-08-13 11:22:42 by stephent]
finer mwheel control <87oeytby87.fsf@tleepslib.sk.tsukuba.ac.jp>
author | stephent |
---|---|
date | Wed, 13 Aug 2003 11:22:43 +0000 |
parents | 1fa8838efe99 |
children | bf2a986fcb17 |
files | lisp/ChangeLog lisp/mwheel.el |
diffstat | 2 files changed, 22 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Wed Aug 13 11:07:40 2003 +0000 +++ b/lisp/ChangeLog Wed Aug 13 11:22:43 2003 +0000 @@ -1,3 +1,10 @@ +2003-07-31 René Kyllingstad <listmailxemacs@kyllingstad.com> + + * mwheel.el (mwheel-scroll-amount): + * mwheel.el (mwheel-scroll): + * mwheel.el (mwheel-install): + bind C-mouse-{4,5} to scroll page by page. + 2003-08-03 Mike Sperber <mike@xemacs.org> * files.el (insert-directory): Massage somewhat to be slightly
--- a/lisp/mwheel.el Wed Aug 13 11:07:40 2003 +0000 +++ b/lisp/mwheel.el Wed Aug 13 11:22:43 2003 +0000 @@ -49,22 +49,25 @@ '(event-basic-type posn-window event-start mwheel-event-window mwheel-event-button)) -(defcustom mwheel-scroll-amount '(5 . 1) +(defcustom mwheel-scroll-amount '(5 1 nil) "Amount to scroll windows by when spinning the mouse wheel. -This is actually a cons cell, where the first item is the amount to scroll -on a normal wheel event, and the second is the amount to scroll when the -wheel is moved with the shift key depressed. +A list with 3 elements specifying the amount to scroll on: a normal wheel +event, a wheel event with the shift key pressed, and a wheel event with the +control key pressed, in that order. Each item should be the number of lines to scroll, or `nil' for near full screen. A near full screen is `next-screen-context-lines' less than a full screen." :group 'mouse - :type '(cons + :type '(list (choice :tag "Normal" (const :tag "Full screen" :value nil) (integer :tag "Specific # of lines")) (choice :tag "Shifted" (const :tag "Full screen" :value nil) + (integer :tag "Specific # of lines")) + (choice :tag "Controlled" + (const :tag "Full screen" :value nil) (integer :tag "Specific # of lines")))) (defcustom mwheel-follow-mouse nil @@ -93,8 +96,10 @@ (selected-window) (select-window (mwheel-event-window event))))) (amt (if (memq 'shift (event-modifiers event)) - (cdr mwheel-scroll-amount) - (car mwheel-scroll-amount)))) + (cadr mwheel-scroll-amount) + (if (memq 'control (event-modifiers event)) + (caddr mwheel-scroll-amount) + (car mwheel-scroll-amount))))) (unwind-protect (case (mwheel-event-button event) (4 (scroll-down amt)) @@ -107,7 +112,9 @@ (defun mwheel-install () "Enable mouse wheel support." (interactive) - (let ((keys '([(mouse-4)] [(shift mouse-4)] [(mouse-5)] [(shift mouse-5)]))) + (let ((keys '([(mouse-4)] [(shift mouse-4)] [(control mouse-4)] + [(mouse-5)] [(shift mouse-5)] [(control mouse-5)]))) + ;; This condition-case is here because Emacs 19 will throw an error ;; if you try to define a key that it does not know about. I for one ;; prefer to just unconditionally do a mwheel-install in my .emacs, so