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

Lines Matching defs:mouse

0 ;;; mouse-drag.el --- use mouse-2 to do a new style of scrolling
7 ;; Keywords: mouse
28 ;;; What is ``mouse-drag.el''?
31 ;;; This module overloads mouse-2 to do ``throw'' scrolling. You
36 ;;; buffer without much mouse movement. Finally, clicks which aren't
37 ;;; drags are passed off to the old mouse-2 binding, so old mouse-2
43 ;;; buffer with you. The character always stays under the mouse.
45 ;;; manipulation (nice) but requires more mouse movement
49 ;;; If you like mouse-drag, you should also check out mouse-copy
52 ;;; To use mouse-drag, place the following in your .emacs file:
53 ;;; (require 'mouse-drag)
55 ;;; (global-set-key [down-mouse-2] 'mouse-drag-throw)
57 ;;; (global-set-key [down-mouse-2] 'mouse-drag-drag)
63 ;;; - reverse the throw-scroll direction with \\[mouse-throw-with-scroll-bar]
64 ;;; - work around a bug with \\[mouse-extras-work-around-drag-bug]
66 ;;; \\[mouse-drag-electric-col-scrolling]
73 ;;; mouse-2 scrolling. The package mouse-scroll.el by Tom Wurgler
74 ;;; <twurgler@goodyear.com> is similar to mouse-drag-throw, but
80 ;;; Originally mouse-drag was part of a larger package.
97 ;;; What's new with mouse-drag 2.24?
99 ;;; - mouse-drag-electric-col-scrolling (default: on)
110 (defun mouse-drag-safe-scroll (row-delta &optional col-delta)
135 (defun mouse-drag-repeatedly-safe-scroll (row-delta &optional col-delta)
137 (while (sit-for mouse-scroll-delay)
138 (mouse-drag-safe-scroll row-delta col-delta)))
140 (defun mouse-drag-events-are-point-events-p (start-posn end-posn)
154 (defvar mouse-drag-electric-col-scrolling t
155 "If non-nil, mouse-drag on a long line enables truncate-lines.")
157 (defun mouse-drag-should-do-col-scrolling ()
164 mouse-drag-electric-col-scrolling
173 (defvar mouse-throw-with-scroll-bar nil
174 "*Set direction of mouse-throwing.
175 If nil, the text moves in the direction the mouse moves.
176 If t, the scroll bar moves in the direction the mouse moves.")
177 (defconst mouse-throw-magnifier-with-scroll-bar
179 (defconst mouse-throw-magnifier-with-mouse-movement
181 (defconst mouse-throw-magnifier-min -6)
182 (defconst mouse-throw-magnifier-max 6)
184 (defun mouse-drag-throw (start-event)
185 "\"Throw\" the page according to a mouse drag.
188 from the original mouse click to the current mouse location. Try it;
191 If the mouse is clicked and released in the same place of time we
193 mouse-2 used to do, so we pass it through.
198 If `mouse-throw-with-scroll-bar' is non-nil, then this command scrolls
204 (global-set-key [down-mouse-2] 'mouse-drag-throw)"
212 event end row mouse-delta scroll-delta
215 col mouse-col-delta window-last-col
217 adjusted-mouse-col-delta
218 adjusted-mouse-delta
220 (col-scrolling-p (mouse-drag-should-do-col-scrolling)))
222 (track-mouse
228 (or (mouse-movement-p event)
232 (setq mouse-delta (- start-row row)
233 adjusted-mouse-delta
235 ((<= mouse-delta mouse-throw-magnifier-min)
236 mouse-throw-magnifier-min)
237 ((>= mouse-delta mouse-throw-magnifier-max)
238 mouse-throw-magnifier-max)
239 (t mouse-delta))
240 mouse-throw-magnifier-min)
241 scroll-delta (aref (if mouse-throw-with-scroll-bar
242 mouse-throw-magnifier-with-scroll-bar
243 mouse-throw-magnifier-with-mouse-movement)
244 adjusted-mouse-delta))
246 (setq mouse-col-delta (- start-col col)
247 adjusted-mouse-col-delta
249 ((<= mouse-col-delta mouse-throw-magnifier-min)
250 mouse-throw-magnifier-min)
251 ((>= mouse-col-delta mouse-throw-magnifier-max)
252 mouse-throw-magnifier-max)
253 (t mouse-col-delta))
254 mouse-throw-magnifier-min)
255 scroll-col-delta (aref (if mouse-throw-with-scroll-bar
256 mouse-throw-magnifier-with-scroll-bar
257 mouse-throw-magnifier-with-mouse-movement)
258 adjusted-mouse-col-delta)))))
263 (mouse-drag-safe-scroll scroll-delta scroll-col-delta)
264 (mouse-drag-repeatedly-safe-scroll scroll-delta scroll-col-delta))))) ;xxx
268 (mouse-drag-events-are-point-events-p start-posn end))
274 (defun mouse-drag-drag (start-event)
275 "\"Drag\" the page according to a mouse drag.
277 Drag scrolling moves the page according to the movement of the mouse.
278 You \"grab\" the character under the mouse and move it around.
280 If the mouse is clicked and released in the same place of time we
282 mouse-2 used to do, so we pass it through.
288 (global-set-key [down-mouse-2] 'mouse-drag-drag)"
296 event end row mouse-delta scroll-delta
299 col mouse-col-delta window-last-col
302 (col-scrolling-p (mouse-drag-should-do-col-scrolling)))
306 (track-mouse
312 (or (mouse-movement-p event)
315 ;; NEEDSWORK: should handle mouse-in-other window.
319 ((<= row 0) (mouse-drag-repeatedly-safe-scroll -1 0))
320 ((>= row window-last-row) (mouse-drag-repeatedly-safe-scroll 1 0))
321 ((and col-scrolling-p (<= col 1)) (mouse-drag-repeatedly-safe-scroll 0 -1))
322 ((and col-scrolling-p (>= col window-last-col)) (mouse-drag-repeatedly-safe-scroll 0 1))
333 (mouse-drag-safe-scroll scroll-delta scroll-col-delta)))))))
337 (mouse-drag-events-are-point-events-p start-posn end))
344 (provide 'mouse-drag)
347 ;;; mouse-drag.el ends here