X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fmwheel.el;h=094ca43d4055ef50fb867fa19755e4753e15912e;hb=4fed288bd0d930a9689c99f48eaf2949946cf6ea;hp=57725f26462ec1a786551f39259b0647b556f611;hpb=6883ee56ec887c2c48abe5b06b5e66aa74031910;p=chise%2Fxemacs-chise.git.1 diff --git a/lisp/mwheel.el b/lisp/mwheel.el index 57725f2..094ca43 100644 --- a/lisp/mwheel.el +++ b/lisp/mwheel.el @@ -17,7 +17,7 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the +;; along with XEmacs; see the file COPYING. If not, write to the ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. @@ -91,15 +91,18 @@ This can be slightly disconcerting, but some people may prefer it." (amt (if (memq 'shift (event-modifiers event)) (cdr mwheel-scroll-amount) (car mwheel-scroll-amount)))) - (case (mwheel-event-button event) - (4 (scroll-down amt)) - (5 (scroll-up amt)) - (otherwise (error "Bad binding in mwheel-scroll"))) - (if curwin (select-window curwin)))) + (unwind-protect + (case (mwheel-event-button event) + (4 (scroll-down amt)) + (5 (scroll-up amt)) + (otherwise (error "Bad binding in mwheel-scroll"))) + (if curwin (select-window curwin))) + )) ;;;###autoload (defun mwheel-install () "Enable mouse wheel support." + (interactive) (let ((keys '([(mouse-4)] [(shift mouse-4)] [(mouse-5)] [(shift 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 @@ -111,7 +114,7 @@ This can be slightly disconcerting, but some people may prefer it." (define-key global-map (car keys) 'mwheel-scroll) (setq keys (cdr keys))) (error nil)))) - + (provide 'mwheel) ;;; mwheel.el ends here