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

Lines Matching +defs:drag +defs:mouse

37 ;; Functions for manipulating via the mouse and mouse-map definitions
38 ;; for accessing them. Also definitions of mouse menus.
41 ;; First half of file defines functions to implement mouse commands,
43 ;; Second half of file defines mouse bindings, do whatever you want there.
48 ;; These functions follow the sun-mouse-handler convention of being called
50 ;; This makes it easy for a mouse executed command to know where the mouse is.
55 ;; bind the mouse button to an s-exp that contains the necessary parameters.
61 (require 'term/sun-mouse)
81 (defun mouse-move-point (window x y)
82 "Move point to mouse cursor."
85 (if (memq last-command ; support the mouse-copy/delete/yank
86 '(mouse-copy mouse-delete mouse-yank-move))
87 (setq this-command 'mouse-yank-move))
90 (defun mouse-set-mark (&optional window x y)
91 "Set mark at mouse cursor."
100 (defun mouse-set-mark-and-select (window x y)
101 "Set mark at mouse cursor, and select that window."
103 (mouse-set-mark window x y)
106 (defun mouse-set-mark-and-stuff (w x y)
107 "Set mark at mouse cursor, and put region in stuff buffer."
108 (mouse-set-mark-and-select w x y)
112 ;;; Simple mouse dragging stuff: marking with button up
115 (defvar *mouse-drag-window* nil)
116 (defvar *mouse-drag-x* -1)
117 (defvar *mouse-drag-y* -1)
119 (defun mouse-drag-move-point (window x y)
120 "Move point to mouse cursor, and allow dragging."
121 (mouse-move-point window x y)
122 (setq *mouse-drag-window* window
123 *mouse-drag-x* x
124 *mouse-drag-y* y))
126 (defun mouse-drag-set-mark-stuff (window x y)
127 "The up click handler that goes with mouse-drag-move-point.
128 If mouse is in same WINDOW but at different X or Y than when
129 mouse-drag-move-point was last executed, set the mark at mouse
131 (if (and (eq *mouse-drag-window* window)
132 (not (and (equal *mouse-drag-x* x)
133 (equal *mouse-drag-y* y))))
134 (mouse-set-mark-and-stuff window x y)
138 (defun mouse-select-or-drag-move-point (window x y)
139 "Select window if not selected, otherwise do mouse-drag-move-point."
141 (mouse-drag-move-point window x y)
142 (mouse-select-window window)))
147 (defun mouse-exch-pt-and-mark (window x y)
153 (defun mouse-call-kbd-macro (window x y)
154 "Invokes last keyboard macro at mouse cursor."
155 (mouse-move-point window x y)
160 (defun mouse-mark-thing (window x y)
166 (mouse-move-point window x y)
194 (defun mouse-kill-thing (window x y)
195 "Kill thing at mouse, and put point there."
196 (mouse-mark-thing window x y)
200 (defun mouse-kill-thing-there (window x y)
201 "Kill thing at mouse, leave point where it was.
202 See mouse-mark-thing for a description of the objects recognized."
205 (mouse-mark-thing window x y)
209 (defun mouse-save-thing (window x y &optional quiet)
210 "Put thing at mouse in kill ring.
211 See mouse-mark-thing for a description of the objects recognized."
212 (mouse-mark-thing window x y)
217 (defun mouse-save-thing-there (window x y &optional quiet)
218 "Put thing at mouse in kill ring, leave point as is.
219 See mouse-mark-thing for a description of the objects recognized."
222 (mouse-save-thing window x y quiet))))
228 (defun mouse-copy-thing (window x y)
229 "Put thing at mouse in kill ring, yank to point.
230 See mouse-mark-thing for a description of the objects recognized."
232 (mouse-save-thing-there window x y t)
236 (defun mouse-move-thing (window x y)
237 "Kill thing at mouse, yank it to point.
238 See mouse-mark-thing for a description of the objects recognized."
240 (mouse-kill-thing-there window x y)
244 (defun mouse-yank-at-point (&optional window x y)
254 (defun mouse-yank-at-mouse (window x y)
255 "Yank from kill-ring at mouse; then cycle thru kill ring."
256 (mouse-move-point window x y)
257 (mouse-yank-at-point window x y))
259 (defun mouse-save/delete/yank (&optional window x y)
266 If mouse-move-point is performed after the first or second click,
267 the next click will do a yank, etc. Except for a possible mouse-move-point,
268 this command is insensitive to mouse location."
270 ((memq last-command '(mouse-delete yank mouse-yank-move)) ; third+ click
271 (mouse-yank-at-point))
272 ((eq last-command 'mouse-copy) ; second click
274 (setq this-command 'mouse-delete))
278 (setq this-command 'mouse-copy))
283 (defun mouse-split-horizontally (window x y)
284 "Splits the window horizontally at mouse cursor."
287 (defun mouse-split-vertically (window x y)
288 "Split the window vertically at the mouse cursor."
291 (defun mouse-select-window (&optional window x y)
295 (defun mouse-delete-other-windows (&optional window x y)
296 "Deletes all windows except the one mouse is in."
299 (defun mouse-delete-window (window &optional x y)
300 "Deletes the window mouse is in."
303 (defun mouse-undo (window x y)
304 "Invokes undo in the window mouse is in."
313 ;;; scrolling a non-selected process window with the mouse, after
317 (defun mouse-scroll-up (window x y)
321 (defun mouse-scroll-down (window x y)
325 (defun mouse-scroll-proportional (window x y)
345 (defun mouse-line-to-top (window x y)
346 "Scrolls the line at the mouse cursor up to the top."
349 (defun mouse-top-to-line (window x y)
350 "Scrolls the top line down to the mouse cursor."
353 (defun mouse-line-to-bottom (window x y)
354 "Scrolls the line at the mouse cursor to the bottom."
357 (defun mouse-bottom-to-line (window x y)
358 "Scrolls the bottom line up to the mouse cursor."
361 (defun mouse-line-to-middle (window x y)
362 "Scrolls the line at the mouse cursor to the middle."
365 (defun mouse-middle-to-line (window x y)
366 "Scrolls the line at the middle to the mouse cursor."
375 ("Vertically" mouse-expand-vertically *menu-window*)
376 ("Horizontally" mouse-expand-horizontally *menu-window*))
382 (defmenu mouse-help-menu
384 mouse-help-region *menu-window* *menu-x* *menu-y* 'text)
386 mouse-help-region *menu-window* *menu-x* *menu-y* 'scrollbar)
388 mouse-help-region *menu-window* *menu-x* *menu-y* 'modeline)
390 mouse-help-region *menu-window* *menu-x* *menu-y* 'minibuffer)
402 ("Previous Buffer" mouse-select-previous-buffer *menu-window*)
406 ("Mouse Help" . mouse-help-menu)
413 (defun mouse-expand-horizontally (window)
419 (defun mouse-expand-vertically (window)
422 (defun mouse-select-previous-buffer (window)
423 "Switch buffer in mouse window to most recently selected buffer."
443 (mouse-move-point window (- x 6) 0))
447 (mouse-set-mark-and-stuff window (- x 6) 0))
455 (defun Buffer-at-mouse (w x y)
456 "Calls Buffer-menu-buffer from mouse click."
458 (mouse-move-point w x y)
462 (defun mouse-buffer-bury (w x y)
464 (bury-buffer (Buffer-at-mouse w x y))
467 (defun mouse-buffer-select (w x y)
469 (switch-to-buffer (Buffer-at-mouse w x y))
473 (defun mouse-buffer-delete (w x y)
476 (mouse-move-point w x y)
480 (defun mouse-buffer-execute (w x y)
483 (mouse-move-point w x y)
487 (defun enable-mouse-in-buffer-list ()
488 "Call this to enable mouse selections in *Buffer List*
497 (local-set-mouse '(text middle) 'mouse-buffer-bury)
498 (local-set-mouse '(text left) 'mouse-buffer-select)
499 (local-set-mouse '(text right) 'mouse-buffer-delete)
500 (local-set-mouse '(text middle right) 'mouse-buffer-execute)
510 ;;; There is some sense to this mouse binding madness:
528 (global-set-mouse '(text left) 'mouse-drag-move-point)
529 (global-set-mouse '(text up left) 'mouse-drag-set-mark-stuff)
530 (global-set-mouse '(text shift left) 'mouse-exch-pt-and-mark)
531 (global-set-mouse '(text double left) 'mouse-exch-pt-and-mark)
533 (global-set-mouse '(text middle) 'mouse-set-mark-and-stuff)
535 (global-set-mouse '(text right) 'emacs-menu-eval)
536 (global-set-mouse '(text shift right) '(sun-yank-selection))
537 (global-set-mouse '(text double right) '(sun-yank-selection))
540 (global-set-mouse '(text shift middle) 'mouse-save/delete/yank)
541 (global-set-mouse '(text double middle) 'mouse-save/delete/yank)
545 (global-set-mouse '(text control middle ) 'mouse-save-thing-there)
546 (global-set-mouse '(text control right ) 'mouse-kill-thing-there)
547 (global-set-mouse '(text control left) 'mouse-yank-at-point)
548 (global-set-mouse '(text control middle left) 'mouse-copy-thing)
549 (global-set-mouse '(text control right left) 'mouse-move-thing)
550 (global-set-mouse '(text control right middle) 'mouse-mark-thing)
552 ;; The Universal mouse help command (press all buttons):
553 (global-set-mouse '(text shift control meta right) 'mouse-help-region)
554 (global-set-mouse '(text double control meta right) 'mouse-help-region)
557 (global-set-mouse '(text meta left) 'mouse-line-to-top)
558 (global-set-mouse '(text meta shift left) 'mouse-line-to-bottom)
559 (global-set-mouse '(text meta double left) 'mouse-line-to-bottom)
560 (global-set-mouse '(text meta middle) 'mouse-line-to-middle)
561 (global-set-mouse '(text meta shift middle) 'mouse-middle-to-line)
562 (global-set-mouse '(text meta double middle) 'mouse-middle-to-line)
563 (global-set-mouse '(text meta control middle) 'mouse-split-vertically)
564 (global-set-mouse '(text meta right) 'mouse-top-to-line)
565 (global-set-mouse '(text meta shift right) 'mouse-bottom-to-line)
566 (global-set-mouse '(text meta double right) 'mouse-bottom-to-line)
569 (global-set-mouse '(text meta control left) 'mouse-call-kbd-macro)
570 (global-set-mouse '(text meta control right) 'mouse-undo)
577 (global-set-mouse '(scrollbar left) 'mouse-line-to-top)
578 (global-set-mouse '(scrollbar shift left) 'mouse-line-to-bottom)
579 (global-set-mouse '(scrollbar double left) 'mouse-line-to-bottom)
581 (global-set-mouse '(scrollbar middle) 'mouse-line-to-middle)
582 (global-set-mouse '(scrollbar shift middle) 'mouse-middle-to-line)
583 (global-set-mouse '(scrollbar double middle) 'mouse-middle-to-line)
584 (global-set-mouse '(scrollbar control middle) 'mouse-split-vertically)
586 (global-set-mouse '(scrollbar right) 'mouse-top-to-line)
587 (global-set-mouse '(scrollbar shift right) 'mouse-bottom-to-line)
588 (global-set-mouse '(scrollbar double right) 'mouse-bottom-to-line)
590 (global-set-mouse '(scrollbar meta left) 'mouse-line-to-top)
591 (global-set-mouse '(scrollbar meta shift left) 'mouse-line-to-bottom)
592 (global-set-mouse '(scrollbar meta double left) 'mouse-line-to-bottom)
593 (global-set-mouse '(scrollbar meta middle) 'mouse-line-to-middle)
594 (global-set-mouse '(scrollbar meta shift middle) 'mouse-middle-to-line)
595 (global-set-mouse '(scrollbar meta double middle) 'mouse-middle-to-line)
596 (global-set-mouse '(scrollbar meta control middle) 'mouse-split-vertically)
597 (global-set-mouse '(scrollbar meta right) 'mouse-top-to-line)
598 (global-set-mouse '(scrollbar meta shift right) 'mouse-bottom-to-line)
599 (global-set-mouse '(scrollbar meta double right) 'mouse-bottom-to-line)
602 (global-set-mouse '(scrollbar shift control meta right) 'mouse-help-region)
603 (global-set-mouse '(scrollbar double control meta right) 'mouse-help-region)
611 (global-set-mouse '(modeline left) 'mouse-scroll-up)
612 (global-set-mouse '(modeline meta left) 'mouse-select-window)
614 (global-set-mouse '(modeline middle) 'mouse-scroll-proportional)
615 (global-set-mouse '(modeline meta middle) 'mouse-select-window)
616 (global-set-mouse '(modeline control middle) 'mouse-split-horizontally)
618 (global-set-mouse '(modeline right) 'mouse-scroll-down)
619 (global-set-mouse '(modeline meta right) 'mouse-select-window)
622 (global-set-mouse '(modeline control left) 'mouse-delete-other-windows)
623 (global-set-mouse '(modeline control right) 'mouse-delete-window)
626 (global-set-mouse '(modeline control left right)'mouse-select-window)
629 (global-set-mouse '(modeline left right) 'mouse-select-window)
632 (global-set-mouse '(modeline shift control meta right) 'mouse-help-region)
633 (global-set-mouse '(modeline double control meta right) 'mouse-help-region)
639 (global-set-mouse '(minibuffer left) 'mini-move-point)
641 (global-set-mouse '(minibuffer middle) 'mini-set-mark-and-stuff)
643 (global-set-mouse '(minibuffer shift middle) '(select-previous-complex-command))
644 (global-set-mouse '(minibuffer double middle) '(select-previous-complex-command))
645 (global-set-mouse '(minibuffer control middle) '(next-complex-command 1))
646 (global-set-mouse '(minibuffer meta middle) '(previous-complex-command 1))
648 (global-set-mouse '(minibuffer right) 'minibuffer-menu-eval)
650 (global-set-mouse '(minibuffer shift control meta right) 'mouse-help-region)
651 (global-set-mouse '(minibuffer double control meta right) 'mouse-help-region)