comparison lisp/mouse.el @ 6923:5df81bebf7f7

(mouse-drag-region): Handle scroll off top/bottom.
author Karl Heuer <kwzh@gnu.org>
date Sat, 16 Apr 1994 06:47:20 +0000
parents 569c2c6d812f
children da5dc735eb50
comparison
equal deleted inserted replaced
6922:26998cd05104 6923:5df81bebf7f7
234 (integer-or-marker-p end-point)) 234 (integer-or-marker-p end-point))
235 (goto-char end-point) 235 (goto-char end-point)
236 (let ((range (mouse-start-end start-point (point) click-count))) 236 (let ((range (mouse-start-end start-point (point) click-count)))
237 (move-overlay mouse-drag-overlay (car range) (nth 1 range)))) 237 (move-overlay mouse-drag-overlay (car range) (nth 1 range))))
238 238
239 ;; Are we moving on a different window on the same frame? 239 (t
240 ((and (windowp (posn-window end)) 240 (let ((mouse-row (cdr (cdr (mouse-position)))))
241 (eq (window-frame (posn-window end)) start-frame))
242 (let ((mouse-row
243 (+ (nth 1 (window-edges (posn-window end)))
244 (cdr (posn-col-row end)))))
245 (cond 241 (cond
242 ((null mouse-row))
246 ((< mouse-row top) 243 ((< mouse-row top)
247 (mouse-scroll-subr 244 (mouse-scroll-subr
248 (- mouse-row top) mouse-drag-overlay start-point)) 245 (- mouse-row top) mouse-drag-overlay start-point))
249 ((and (not (eobp)) 246 ((and (not (eobp))
250 (>= mouse-row bottom)) 247 (>= mouse-row bottom))
251 (mouse-scroll-subr (1+ (- mouse-row bottom)) 248 (mouse-scroll-subr (1+ (- mouse-row bottom))
252 mouse-drag-overlay start-point))))) 249 mouse-drag-overlay start-point)))))))))
253
254 (t
255 (let ((mouse-y (cdr (cdr (mouse-position))))
256 (menu-bar-lines (or (cdr (assq 'menu-bar-lines
257 (frame-parameters)))
258 0)))
259
260 ;; Are we on the menu bar?
261 (and (integerp mouse-y) (< mouse-y menu-bar-lines)
262 (mouse-scroll-subr (- mouse-y menu-bar-lines)
263 mouse-drag-overlay start-point))))))))
264 250
265 (if (and (eq (get (event-basic-type event) 'event-kind) 'mouse-click) 251 (if (and (eq (get (event-basic-type event) 'event-kind) 'mouse-click)
266 (eq (posn-window (event-end event)) start-window) 252 (eq (posn-window (event-end event)) start-window)
267 (numberp (posn-point (event-end event)))) 253 (numberp (posn-point (event-end event))))
268 (let ((fun (key-binding (vector (car event))))) 254 (let ((fun (key-binding (vector (car event)))))