[PATCH] Bind the mouse wheel by default

Aidan Kehoe kehoea at parhasard.net
Tue Dec 4 16:03:51 EST 2007


Myself, I’m tired of the mouse wheel provoking errors on -vanilla
invocations.

lisp/ChangeLog addition:

2007-12-04  Aidan Kehoe  <kehoea at parhasard.net>

	* 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. 


XEmacs Trunk source patch:
Diff command:   cvs -q diff -Nu
Files affected: lisp/keydefs.el
===================================================================
RCS

Index: lisp/keydefs.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/keydefs.el,v
retrieving revision 1.19
diff -u -u -r1.19 keydefs.el
--- lisp/keydefs.el	2006/08/06 22:14:10	1.19
+++ lisp/keydefs.el	2007/12/04 21:02:16
@@ -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

-- 
¿Dónde estará ahora mi sobrino Yoghurtu Nghé, que tuvo que huir
precipitadamente de la aldea por culpa de la escasez de rinocerontes?




More information about the XEmacs-Patches mailing list