
(defvar sup-mouse-fast-select-window nil "\
*Non-nil for mouse hits to select new window, then execute; else just select.")

(defconst mouse-left 0)

(defconst mouse-center 1)

(defconst mouse-right 2)

(defconst mouse-2left 4)

(defconst mouse-2center 5)

(defconst mouse-2right 6)

(defconst mouse-3left 8)

(defconst mouse-3center 9)

(defconst mouse-3right 10)

(defun sup-mouse-report nil "\
This function is called directly by the mouse, it parses and
executes the mouse commands.

 L move point          *  |---- These apply for mouse click in a window.
2L delete word            |
3L copy word		  | If sup-mouse-fast-select-window is nil,
 C move point and yank *  | just selects that window.
2C yank pop		  |
 R set mark            *  |
2R delete region	  |
3R copy region		  |

on modeline		    on \"scroll bar\"	in minibuffer
 L scroll-up		    line to top		execute-extended-command
 C proportional goto-char   line to middle	mouse-help
 R scroll-down		    line to bottom	eval-expression" (interactive) (byte-code "Ո!!!	
\"! 
 S=?* =
8S=	8SY		8Z
8Z !
Ua   Um   U 	deZ\" S\"b  !	 !
U 
 U 
 Z\\ U 

 [$\" ͅ !!
U 	
\"~U 	
\"!~U	
\"`!`\")~U+ 	
\" ~UB 	
\" `\"~U^ 	
\" `\"~Ut	
\" ~U~!U!
U!U!ͅ!?
U	
\"U 	
\" U	
\" .
" [buttons x y window edges old-window in-minibuf-p same-window-p in-modeline-p in-scrollbar-p mouse-left mouse-right mouse-center t mouse-2left mouse-3left this-command mouse-2right mouse-3right mouse-2center sup-mouse-fast-select-window nil sup-get-tty-num 59 99 sup-pos-to-window window-edges selected-window screen-height 3 2 0 1 select-window scroll-up scroll-down / * window-width beginning-of-line what-cursor-position window-height + sup-move-point-to-x-y kill-word copy-region-as-kill forward-word yank push-mark exchange-point-and-mark kill-region mark yank-pop call-interactively eval-expression execute-extended-command describe-function sup-mouse-report] 54))

(defun sup-get-tty-num (term-char) "\
Read from terminal until TERM-CHAR is read, and return intervening number.
Upon non-numeric not matching TERM-CHAR signal an error." (byte-code "r	Y 	X\" \"	Z\\r 
	=, !*" [num char term-char 0 48 57 * 10 error "Invalid data format in mouse command"] 5))

(defun sup-move-point-to-x-y (x y) "\
Position cursor in window coordinates.
X and Y are 0-based character positions in the window." (byte-code "!	!" [y x move-to-window-line move-to-column] 3))

(defun sup-pos-to-window (x y) "\
Find window corresponding to screen coordinates.
X and Y are 0-based character positions on the screen." (byte-code " 	 =?* 8W* 8Y* 8W* 8Y< 	!	! 	C  *" [edges window nil y x window-edges selected-window 1 3 0 2 next-window] 7))
