comparison lisp/term/bg-mouse.el @ 444:576fb035e263 r21-2-37

Import from CVS: tag r21-2-37
author cvs
date Mon, 13 Aug 2007 11:36:19 +0200
parents 376386a54a3c
children 1ccc32a20af4
comparison
equal deleted inserted replaced
443:a8296e22da4e 444:576fb035e263
69 (bg-get-tty-num semicolon) 69 (bg-get-tty-num semicolon)
70 (let* 70 (let*
71 ((screen-mouse-x (min (1- (frame-width)) ;don't hit column 86! 71 ((screen-mouse-x (min (1- (frame-width)) ;don't hit column 86!
72 (/ (bg-get-tty-num semicolon) 9))) 72 (/ (bg-get-tty-num semicolon) 9)))
73 (screen-mouse-y (- (1- (frame-height)) ;assume default font size. 73 (screen-mouse-y (- (1- (frame-height)) ;assume default font size.
74 (/ (bg-get-tty-num semicolon) 16))) 74 (/ (bg-get-tty-num semicolon) 16)))
75 (bg-mouse-buttons (% (bg-get-tty-num ?c) 8)) 75 (bg-mouse-buttons (% (bg-get-tty-num ?c) 8))
76 (bg-mouse-window (bg-window-from-x-y screen-mouse-x screen-mouse-y)) 76 (bg-mouse-window (bg-window-from-x-y screen-mouse-x screen-mouse-y))
77 (bg-cursor-window (selected-window)) 77 (bg-cursor-window (selected-window))
78 (edges (window-edges bg-mouse-window)) 78 (edges (window-edges bg-mouse-window))
79 (minibuf-p (= screen-mouse-y (1- (screen-height)))) 79 (minibuf-p (= screen-mouse-y (1- (screen-height))))
166 "Scroll the line pointed to by the BitGraph mouse to the top of the window." 166 "Scroll the line pointed to by the BitGraph mouse to the top of the window."
167 (interactive) 167 (interactive)
168 (scroll-up bg-mouse-y)) 168 (scroll-up bg-mouse-y))
169 169
170 (defun bg-mouse-line-to-center () 170 (defun bg-mouse-line-to-center ()
171 "Scroll the line pointed to by the BitGraph mouse to the center 171 "Scroll the line pointed to by the BitGraph mouse to the center
172 of the window" 172 of the window."
173 (interactive) 173 (interactive)
174 (scroll-up (/ (+ 2 bg-mouse-y bg-mouse-y (- (window-height))) 2))) 174 (scroll-up (/ (+ 2 bg-mouse-y bg-mouse-y (- (window-height))) 2)))
175 175
176 (defun bg-mouse-line-to-bottom () 176 (defun bg-mouse-line-to-bottom ()
177 "Scroll the line pointed to by the mouse to the bottom of the window." 177 "Scroll the line pointed to by the mouse to the bottom of the window."
288 288
289 (defun bind-bg-mouse-click (click-code function) 289 (defun bind-bg-mouse-click (click-code function)
290 "Bind bg-mouse CLICK-CODE to run FUNCTION." 290 "Bind bg-mouse CLICK-CODE to run FUNCTION."
291 (define-key mouse-map (char-to-string click-code) function)) 291 (define-key mouse-map (char-to-string click-code) function))
292 292
293 (bind-bg-mouse-click bg-button-l 'bg-set-point) 293 (bind-bg-mouse-click bg-button-l 'bg-set-point)
294 (bind-bg-mouse-click bg-button-m 'bg-yank) 294 (bind-bg-mouse-click bg-button-m 'bg-yank)
295 (bind-bg-mouse-click bg-button-r 'bg-set-mark) 295 (bind-bg-mouse-click bg-button-r 'bg-set-mark)
296 (bind-bg-mouse-click (+ bg-button-l bg-button-m) 'yank-pop-1) 296 (bind-bg-mouse-click (+ bg-button-l bg-button-m) 'yank-pop-1)
297 (bind-bg-mouse-click (+ bg-button-l bg-button-r) 'bg-kill-region) 297 (bind-bg-mouse-click (+ bg-button-l bg-button-r) 'bg-kill-region)
298 (bind-bg-mouse-click (+ bg-button-m bg-button-r) 'undo) 298 (bind-bg-mouse-click (+ bg-button-m bg-button-r) 'undo)