# HG changeset patch # User Aidan Kehoe # Date 1197116329 -3600 # Node ID 26ec8d0f3a9c94369ce38325ef9ee3dd844a9827 # Parent f95358fda5d865d6cbf4ebf58957a2ccb2b9192d Bind mouse wheel movements by default, to a lambda that calls the autoloaded #'mwheel-install and then #'mwheel-scrool with the appropriate event. diff -r f95358fda5d8 -r 26ec8d0f3a9c lisp/ChangeLog --- a/lisp/ChangeLog Fri Dec 07 13:32:19 2007 -0500 +++ b/lisp/ChangeLog Sat Dec 08 13:18:49 2007 +0100 @@ -1,3 +1,10 @@ +2007-12-04 Aidan Kehoe + + * keydefs.el: + Bind mouse wheel movements by default, to a lambda that calls the + autoloaded #'mwheel-install and then #'mwheel-scrool with the + appropriate event. + 2007-12-07 Vin Shelton * about.el: Minor bio update to test hg repository. diff -r f95358fda5d8 -r 26ec8d0f3a9c lisp/keydefs.el --- a/lisp/keydefs.el Fri Dec 07 13:32:19 2007 -0500 +++ b/lisp/keydefs.el Sat Dec 08 13:18:49 2007 +0100 @@ -674,4 +674,12 @@ ;(define-key global-map 'insertchar 'function-key-error) (define-key global-map 'deletechar 'delete-char) +;; Bind the mouse wheel by default. +(dolist (keyspec '([(mouse-4)] [(shift mouse-4)] [(control mouse-4)] + [(mouse-5)] [(shift mouse-5)] [(control mouse-5)])) + (define-key global-map keyspec + #'(lambda (event) + (interactive "e") + (mwheel-install) + (declare-fboundp (mwheel-scroll event))))) ;;; keydefs.el ends here