*** orig/xt-mouse.el 2015-03-22 16:12:30.390204371 +0100 --- new/xt-mouse.el 2015-03-22 16:12:30.394204419 +0100 *************** *** 1,6 **** ;;; xt-mouse.el --- support the mouse when emacs run in an xterm ! ;; Copyright (C) 1994, 2000-2015 Free Software Foundation, Inc. ;; Author: Per Abrahamsen ;; Keywords: mouse, terminals --- 1,6 ---- ;;; xt-mouse.el --- support the mouse when emacs run in an xterm ! ;; Copyright (C) 1994, 2000-2014 Free Software Foundation, Inc. ;; Author: Per Abrahamsen ;; Keywords: mouse, terminals *************** *** 60,65 **** --- 60,66 ---- (ev-data (nth 1 event)) (ev-where (nth 1 ev-data)) (vec (vector event)) + (is-move (eq 'mouse-movement ev-command)) (is-down (string-match "down-" (symbol-name ev-command)))) ;; Mouse events symbols must have an 'event-kind property with *************** *** 71,76 **** --- 72,78 ---- (is-down (setf (terminal-parameter nil 'xterm-mouse-last-down) event) vec) + (is-move vec) (t (let* ((down (terminal-parameter nil 'xterm-mouse-last-down)) (down-data (nth 1 down)) *************** *** 132,196 **** (fdiff (- f (* 1.0 maxwrap dbig)))) (+ (truncate fdiff) (* maxwrap dbig)))))) ! ;; Normal terminal mouse click reporting: expect three bytes, of the ! ;; form . Return a list (EVENT-TYPE X Y). ! (defun xterm-mouse--read-event-sequence-1000 () ! (let* ((code (- (read-event) 32)) ! (type ! ;; For buttons > 3, the release-event looks differently ! ;; (see xc/programs/xterm/button.c, function EditorButton), ! ;; and come in a release-event only, no down-event. ! (cond ((>= code 64) ! (format "mouse-%d" (- code 60))) ! ((memq code '(8 9 10)) ! (format "M-down-mouse-%d" (- code 7))) ! ((memq code '(3 11)) ! (let ((down (car (terminal-parameter ! nil 'xterm-mouse-last-down)))) ! (when (and down (string-match "[0-9]" (symbol-name down))) ! (format (if (eq code 3) "mouse-%s" "M-mouse-%s") ! (match-string 0 (symbol-name down)))))) ! ((memq code '(0 1 2)) ! (format "down-mouse-%d" (+ 1 code))))) ! (x (- (read-event) 33)) ! (y (- (read-event) 33))) ! (and type (wholenump x) (wholenump y) ! (list (intern type) x y)))) ! ! ;; XTerm's 1006-mode terminal mouse click reporting has the form ! ;;