comparison lisp/mwheel.el @ 44147:d8a6c969ea05

(mouse-wheel-mode): Use global-set-key and global-unset-key.
author Pavel Janík <Pavel@Janik.cz>
date Mon, 25 Mar 2002 11:30:55 +0000
parents 8f34ebe4ff92
children 7648ca9b6024
comparison
equal deleted inserted replaced
44146:aff7bdba6572 44147:d8a6c969ea05
167 ;; that if the wheeled-mouse is there, it just works, and this way it 167 ;; that if the wheeled-mouse is there, it just works, and this way it
168 ;; doesn't yell at me if I'm on my laptop or another machine, etc. 168 ;; doesn't yell at me if I'm on my laptop or another machine, etc.
169 (condition-case () 169 (condition-case ()
170 (dolist (key keys) 170 (dolist (key keys)
171 (cond (mouse-wheel-mode 171 (cond (mouse-wheel-mode
172 (define-key (current-global-map) key 'mwheel-scroll)) 172 (global-set-key key 'mwheel-scroll))
173 ((eq (lookup-key (current-global-map) key) 'mwheel-scroll) 173 ((eq (lookup-key (current-global-map) key) 'mwheel-scroll)
174 (define-key (current-global-map) key nil)))) 174 (global-unset-key key))))
175 (error nil)))) 175 (error nil))))
176 176
177 ;;; Compatibility entry point 177 ;;; Compatibility entry point
178 ;;;###autoload 178 ;;;###autoload
179 (defun mwheel-install (&optional uninstall) 179 (defun mwheel-install (&optional uninstall)