Mercurial > emacs
comparison lisp/term/bg-mouse.el @ 49599:5ade352e8d1c
Trailing whitespace deleted.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Tue, 04 Feb 2003 13:30:45 +0000 |
parents | 62c9f562dc40 |
children | 695cf19ef79e |
comparison
equal
deleted
inserted
replaced
49598:0d8b17d428b5 | 49599:5ade352e8d1c |
---|---|
72 (bg-get-tty-num semicolon) | 72 (bg-get-tty-num semicolon) |
73 (let* | 73 (let* |
74 ((screen-mouse-x (min (1- (frame-width)) ;don't hit column 86! | 74 ((screen-mouse-x (min (1- (frame-width)) ;don't hit column 86! |
75 (/ (bg-get-tty-num semicolon) 9))) | 75 (/ (bg-get-tty-num semicolon) 9))) |
76 (screen-mouse-y (- (1- (frame-height)) ;assume default font size. | 76 (screen-mouse-y (- (1- (frame-height)) ;assume default font size. |
77 (/ (bg-get-tty-num semicolon) 16))) | 77 (/ (bg-get-tty-num semicolon) 16))) |
78 (bg-mouse-buttons (% (bg-get-tty-num ?c) 8)) | 78 (bg-mouse-buttons (% (bg-get-tty-num ?c) 8)) |
79 (bg-mouse-window (bg-window-from-x-y screen-mouse-x screen-mouse-y)) | 79 (bg-mouse-window (bg-window-from-x-y screen-mouse-x screen-mouse-y)) |
80 (bg-cursor-window (selected-window)) | 80 (bg-cursor-window (selected-window)) |
81 (edges (window-edges bg-mouse-window)) | 81 (edges (window-edges bg-mouse-window)) |
82 (minibuf-p (= screen-mouse-y (1- (frame-height)))) | 82 (minibuf-p (= screen-mouse-y (1- (frame-height)))) |
169 "Scroll the line pointed to by the BitGraph mouse to the top of the window." | 169 "Scroll the line pointed to by the BitGraph mouse to the top of the window." |
170 (interactive) | 170 (interactive) |
171 (scroll-up bg-mouse-y)) | 171 (scroll-up bg-mouse-y)) |
172 | 172 |
173 (defun bg-mouse-line-to-center () | 173 (defun bg-mouse-line-to-center () |
174 "Scroll the line pointed to by the BitGraph mouse to the center | 174 "Scroll the line pointed to by the BitGraph mouse to the center |
175 of the window" | 175 of the window" |
176 (interactive) | 176 (interactive) |
177 (scroll-up (/ (+ 2 bg-mouse-y bg-mouse-y (- (window-height))) 2))) | 177 (scroll-up (/ (+ 2 bg-mouse-y bg-mouse-y (- (window-height))) 2))) |
178 | 178 |
179 (defun bg-mouse-line-to-bottom () | 179 (defun bg-mouse-line-to-bottom () |
253 ;;; Returns the window that screen position (x, y) is in or nil if none, | 253 ;;; Returns the window that screen position (x, y) is in or nil if none, |
254 ;;; meaning we are in the echo area with a non-active minibuffer. | 254 ;;; meaning we are in the echo area with a non-active minibuffer. |
255 (defun bg-window-from-x-y (x y) | 255 (defun bg-window-from-x-y (x y) |
256 "Find window corresponding to screen coordinates. | 256 "Find window corresponding to screen coordinates. |
257 X and Y are 0-based character positions on the screen." | 257 X and Y are 0-based character positions on the screen." |
258 (get-window-with-predicate (lambda (w) | 258 (get-window-with-predicate (lambda (w) |
259 (coordinates-in-window-p (cons x y) w)))) | 259 (coordinates-in-window-p (cons x y) w)))) |
260 | 260 |
261 (defun bg-command-execute (bg-command) | 261 (defun bg-command-execute (bg-command) |
262 (if (commandp bg-command) | 262 (if (commandp bg-command) |
263 (command-execute bg-command) | 263 (command-execute bg-command) |
275 | 275 |
276 (defun bind-bg-mouse-click (click-code function) | 276 (defun bind-bg-mouse-click (click-code function) |
277 "Bind bg-mouse CLICK-CODE to run FUNCTION." | 277 "Bind bg-mouse CLICK-CODE to run FUNCTION." |
278 (define-key mouse-map (char-to-string click-code) function)) | 278 (define-key mouse-map (char-to-string click-code) function)) |
279 | 279 |
280 (bind-bg-mouse-click bg-button-l 'bg-set-point) | 280 (bind-bg-mouse-click bg-button-l 'bg-set-point) |
281 (bind-bg-mouse-click bg-button-m 'bg-yank) | 281 (bind-bg-mouse-click bg-button-m 'bg-yank) |
282 (bind-bg-mouse-click bg-button-r 'bg-set-mark) | 282 (bind-bg-mouse-click bg-button-r 'bg-set-mark) |
283 (bind-bg-mouse-click (+ bg-button-l bg-button-m) 'yank-pop-1) | 283 (bind-bg-mouse-click (+ bg-button-l bg-button-m) 'yank-pop-1) |
284 (bind-bg-mouse-click (+ bg-button-l bg-button-r) 'bg-kill-region) | 284 (bind-bg-mouse-click (+ bg-button-l bg-button-r) 'bg-kill-region) |
285 (bind-bg-mouse-click (+ bg-button-m bg-button-r) 'undo) | 285 (bind-bg-mouse-click (+ bg-button-m bg-button-r) 'undo) |