changeset 93177:470ea273abbf

(xterm-mouse-event): Avoid error with buttons > 5.
author Andreas Schwab <schwab@suse.de>
date Mon, 24 Mar 2008 09:28:05 +0000
parents c985261aee9c
children 6c44d22f4d83
files lisp/ChangeLog lisp/xt-mouse.el
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon Mar 24 08:47:06 2008 +0000
+++ b/lisp/ChangeLog	Mon Mar 24 09:28:05 2008 +0000
@@ -1,3 +1,7 @@
+2008-03-24  Andreas Schwab  <schwab@suse.de>
+
+	* xt-mouse.el (xterm-mouse-event): Avoid error with buttons > 5.
+
 2008-03-24  Dan Nicolaescu  <dann@ics.uci.edu>
 
 	* vc-hg.el (vc-hg-after-dir-status):
--- a/lisp/xt-mouse.el	Mon Mar 24 08:47:06 2008 +0000
+++ b/lisp/xt-mouse.el	Mon Mar 24 09:28:05 2008 +0000
@@ -168,7 +168,10 @@
 		       ((= type 11)
 			(format "mouse-%d" (- xterm-mouse-last 7)))
 		       ((= type 3)
-			(format "mouse-%d" (+ 1 xterm-mouse-last)))
+			;; For buttons > 5 xterm only reports a
+			;; button-release event.  Avoid error by mapping
+			;; them all to mouse-1.
+			(format "mouse-%d" (+ 1 (or xterm-mouse-last 0))))
 		       (t
 			(setq xterm-mouse-last type)
 			(format "down-mouse-%d" (+ 1 type))))))