• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/obsolete/

Lines Matching defs:mouse

1 ;;; bg-mouse.el --- GNU Emacs code for BBN Bitgraph mouse
38 (defvar bg-mouse-fast-select-window nil
39 "*Non-nil for mouse hits to select new window, then execute; else just select.")
41 ;;; These numbers are summed to make the index into the mouse-map.
42 ;;; The low three bits correspond to what the mouse actually sends.
54 (defvar bg-mouse-x)
55 (defvar bg-mouse-y)
59 (defvar mouse-map)
63 (defun bg-mouse-report (prefix-arg)
64 "Read, parse, and execute a BBN BitGraph mouse click.
66 L-- move point | These apply for mouse click in a window.
67 --R set mark | If bg-mouse-fast-select-window is nil,
78 To reinitialize the mouse if the terminal is reset, type ESC : RET"
82 ((screen-mouse-x (min (1- (frame-width)) ;don't hit column 86!
84 (screen-mouse-y (- (1- (frame-height)) ;assume default font size.
86 (bg-mouse-buttons (% (bg-get-tty-num ?c) 8))
87 (bg-mouse-window (bg-window-from-x-y screen-mouse-x screen-mouse-y))
89 (edges (window-edges bg-mouse-window))
90 (minibuf-p (= screen-mouse-y (1- (frame-height))))
92 (= screen-mouse-y (1- (nth 3 edges)))))
94 (>= screen-mouse-x (1- (nth 2 edges)))))
95 (same-window-p (eq bg-mouse-window bg-cursor-window))
97 (not bg-mouse-window))) ;minibuf must be inactive
102 (lookup-key mouse-map
103 (char-to-string (+ bg-mode-bits bg-mouse-buttons))))
104 (bg-mouse-x (- screen-mouse-x (nth 0 edges)))
105 (bg-mouse-y (- screen-mouse-y (nth 1 edges))))
107 (select-window bg-mouse-window)
113 (select-window bg-mouse-window)
114 (if bg-mouse-fast-select-window
123 "Move point to location of BitGraph mouse."
125 (bg-move-point-to-x-y bg-mouse-x bg-mouse-y)
127 (setq temporary-goal-column bg-mouse-x))
130 "Set mark at location of BitGraph mouse."
133 (bg-move-point-to-x-y bg-mouse-x bg-mouse-y)
137 "Move point to location of BitGraph mouse and yank."
139 (bg-move-point-to-x-y bg-mouse-x bg-mouse-y)
148 "Move point to location of BitGraph mouse and yank. If last command
160 through the buffer as the BitGraph mouse's X position in the window."
164 (cond ((zerop bg-mouse-x)
166 ((< (buffer-size) (/ bg-most-positive-fixnum bg-mouse-x))
168 (/ (* bg-mouse-x (buffer-size))
173 bg-mouse-x))))
177 (defun bg-mouse-line-to-top ()
178 "Scroll the line pointed to by the BitGraph mouse to the top of the window."
180 (scroll-up bg-mouse-y))
182 (defun bg-mouse-line-to-center ()
183 "Scroll the line pointed to by the BitGraph mouse to the center
186 (scroll-up (/ (+ 2 bg-mouse-y bg-mouse-y (- (window-height))) 2)))
188 (defun bg-mouse-line-to-bottom ()
189 "Scroll the line pointed to by the mouse to the bottom of the window."
191 (scroll-up (+ bg-mouse-y (- 2 (window-height)))))
198 "Insert a copy of the word (actually sexp) that the mouse is pointing at.
203 (bg-move-point-to-x-y bg-mouse-x bg-mouse-y)
233 If non-numeric not matching TERM-CHAR, reprogram the mouse and signal an error."
243 (bg-program-mouse)
245 "Invalid data format in bg-mouse command: mouse reinitialized.")))
276 (defun bg-program-mouse ()
279 ;;; Note that the doc string for mouse-map (as defined in subr.el)
280 ;;; says it is for the X-window mouse. This is wrong; that keymap
281 ;;; should be used for your mouse no matter what terminal you have.
283 (or (keymapp mouse-map)
284 (setq mouse-map (make-keymap)))
286 (defun bind-bg-mouse-click (click-code function)
287 "Bind bg-mouse CLICK-CODE to run FUNCTION."
288 (define-key mouse-map (char-to-string click-code) function))
290 (bind-bg-mouse-click bg-button-l 'bg-set-point)
291 (bind-bg-mouse-click bg-button-m 'bg-yank)
292 (bind-bg-mouse-click bg-button-r 'bg-set-mark)
293 (bind-bg-mouse-click (+ bg-button-l bg-button-m) 'yank-pop-1)
294 (bind-bg-mouse-click (+ bg-button-l bg-button-r) 'bg-kill-region)
295 (bind-bg-mouse-click (+ bg-button-m bg-button-r) 'undo)
296 (bind-bg-mouse-click (+ bg-button-l bg-button-m bg-button-r) 'undo)
297 (bind-bg-mouse-click (+ bg-in-modeline bg-button-l) 'scroll-up)
298 (bind-bg-mouse-click (+ bg-in-modeline bg-button-m) 'bg-move-by-percentage)
299 (bind-bg-mouse-click (+ bg-in-modeline bg-button-r) 'scroll-down)
300 (bind-bg-mouse-click (+ bg-in-scrollbar bg-button-l) 'bg-mouse-line-to-top)
301 (bind-bg-mouse-click (+ bg-in-scrollbar bg-button-m) 'bg-mouse-line-to-center)
302 (bind-bg-mouse-click (+ bg-in-scrollbar bg-button-r) 'bg-mouse-line-to-bottom)
303 (bind-bg-mouse-click (+ bg-in-minibuf bg-button-l) 'execute-extended-command)
304 (bind-bg-mouse-click (+ bg-in-minibuf bg-button-m) 'suspend-emacs)
305 (bind-bg-mouse-click (+ bg-in-minibuf bg-button-r) 'eval-expression)
307 (provide 'bg-mouse)
310 ;;; bg-mouse.el ends here