diff lisp/mwheel.el @ 458:c33ae14dd6d0 r21-2-44

Import from CVS: tag r21-2-44
author cvs
date Mon, 13 Aug 2007 11:42:25 +0200
parents 576fb035e263
children 7039e6323819
line wrap: on
line diff
--- a/lisp/mwheel.el	Mon Aug 13 11:41:26 2007 +0200
+++ b/lisp/mwheel.el	Mon Aug 13 11:42:25 2007 +0200
@@ -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,11 +91,13 @@
 	(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 ()
@@ -112,7 +114,7 @@
 	  (define-key global-map (car keys) 'mwheel-scroll)
 	  (setq keys (cdr keys)))
       (error nil))))
-    
+
 (provide 'mwheel)
 
 ;;; mwheel.el ends here