Commit e919a622 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(mouse-scroll-subr): New arg WINDOW.

(mouse-drag-region, mouse-drag-secondary): Pass new arg.
parent dcceb381
...@@ -157,23 +157,23 @@ the mouse back into the window, or release the button. ...@@ -157,23 +157,23 @@ the mouse back into the window, or release the button.
This variable's value may be non-integral. This variable's value may be non-integral.
Setting this to zero causes Emacs to scroll as fast as it can.") Setting this to zero causes Emacs to scroll as fast as it can.")
(defun mouse-scroll-subr (jump &optional overlay start) (defun mouse-scroll-subr (window jump &optional overlay start)
"Scroll the selected window JUMP lines at a time, until new input arrives. "Scroll the window WINDOW, JUMP lines at a time, until new input arrives.
If OVERLAY is an overlay, let it stretch from START to the far edge of If OVERLAY is an overlay, let it stretch from START to the far edge of
the newly visible text. the newly visible text.
Upon exit, point is at the far edge of the newly visible text." Upon exit, point is at the far edge of the newly visible text."
(while (progn (while (progn
(goto-char (window-start)) (goto-char (window-start window))
(if (not (zerop (vertical-motion jump))) (if (not (zerop (vertical-motion jump window)))
(progn (progn
(set-window-start (selected-window) (point)) (set-window-start window (point))
(if (natnump jump) (if (natnump jump)
(progn (progn
(goto-char (window-end (selected-window))) (goto-char (window-end window))
;; window-end doesn't reflect the window's new ;; window-end doesn't reflect the window's new
;; start position until the next redisplay. Hurrah. ;; start position until the next redisplay. Hurrah.
(vertical-motion (1- jump))) (vertical-motion (1- jump) window))
(goto-char (window-start (selected-window)))) (goto-char (window-start window)))
(if overlay (if overlay
(move-overlay overlay start (point))) (move-overlay overlay start (point)))
(if (not (eobp)) (if (not (eobp))
...@@ -238,11 +238,11 @@ release the mouse button. Otherwise, it does not." ...@@ -238,11 +238,11 @@ release the mouse button. Otherwise, it does not."
(cond (cond
((null mouse-row)) ((null mouse-row))
((< mouse-row top) ((< mouse-row top)
(mouse-scroll-subr (mouse-scroll-subr start-window (- mouse-row top)
(- mouse-row top) mouse-drag-overlay start-point)) mouse-drag-overlay start-point))
((and (not (eobp)) ((and (not (eobp))
(>= mouse-row bottom)) (>= mouse-row bottom))
(mouse-scroll-subr (1+ (- mouse-row bottom)) (mouse-scroll-subr start-window (1+ (- mouse-row bottom))
mouse-drag-overlay start-point))))))))) mouse-drag-overlay start-point)))))))))
(if (and (eq (get (event-basic-type event) 'event-kind) 'mouse-click) (if (and (eq (get (event-basic-type event) 'event-kind) 'mouse-click)
...@@ -635,11 +635,11 @@ This must be bound to a button-down mouse event." ...@@ -635,11 +635,11 @@ This must be bound to a button-down mouse event."
(cond (cond
((null mouse-row)) ((null mouse-row))
((< mouse-row top) ((< mouse-row top)
(mouse-scroll-subr (mouse-scroll-subr start-window (- mouse-row top)
(- mouse-row top) mouse-secondary-overlay start-point)) mouse-secondary-overlay start-point))
((and (not (eobp)) ((and (not (eobp))
(>= mouse-row bottom)) (>= mouse-row bottom))
(mouse-scroll-subr (1+ (- mouse-row bottom)) (mouse-scroll-subr start-window (1+ (- mouse-row bottom))
mouse-secondary-overlay start-point))))))))) mouse-secondary-overlay start-point)))))))))
(if (and (eq (get (event-basic-type event) 'event-kind) 'mouse-click) (if (and (eq (get (event-basic-type event) 'event-kind) 'mouse-click)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment