diff options
| author | Richard M. Stallman | 1994-06-17 00:51:33 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-06-17 00:51:33 +0000 |
| commit | e919a6225efedd6a01987c1388491089ffe7b9e5 (patch) | |
| tree | d8655303566e460eb06d220f74ed4befbee66b51 | |
| parent | dcceb381ab25d112997e5e4bdd10993dfe5f42ea (diff) | |
| download | emacs-e919a6225efedd6a01987c1388491089ffe7b9e5.tar.gz emacs-e919a6225efedd6a01987c1388491089ffe7b9e5.zip | |
(mouse-scroll-subr): New arg WINDOW.
(mouse-drag-region, mouse-drag-secondary): Pass new arg.
| -rw-r--r-- | lisp/mouse.el | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el index 5d4dea37c70..7f58416f5b1 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el | |||
| @@ -157,23 +157,23 @@ the mouse back into the window, or release the button. | |||
| 157 | This variable's value may be non-integral. | 157 | This variable's value may be non-integral. |
| 158 | Setting this to zero causes Emacs to scroll as fast as it can.") | 158 | Setting this to zero causes Emacs to scroll as fast as it can.") |
| 159 | 159 | ||
| 160 | (defun mouse-scroll-subr (jump &optional overlay start) | 160 | (defun mouse-scroll-subr (window jump &optional overlay start) |
| 161 | "Scroll the selected window JUMP lines at a time, until new input arrives. | 161 | "Scroll the window WINDOW, JUMP lines at a time, until new input arrives. |
| 162 | If OVERLAY is an overlay, let it stretch from START to the far edge of | 162 | If OVERLAY is an overlay, let it stretch from START to the far edge of |
| 163 | the newly visible text. | 163 | the newly visible text. |
| 164 | Upon exit, point is at the far edge of the newly visible text." | 164 | Upon exit, point is at the far edge of the newly visible text." |
| 165 | (while (progn | 165 | (while (progn |
| 166 | (goto-char (window-start)) | 166 | (goto-char (window-start window)) |
| 167 | (if (not (zerop (vertical-motion jump))) | 167 | (if (not (zerop (vertical-motion jump window))) |
| 168 | (progn | 168 | (progn |
| 169 | (set-window-start (selected-window) (point)) | 169 | (set-window-start window (point)) |
| 170 | (if (natnump jump) | 170 | (if (natnump jump) |
| 171 | (progn | 171 | (progn |
| 172 | (goto-char (window-end (selected-window))) | 172 | (goto-char (window-end window)) |
| 173 | ;; window-end doesn't reflect the window's new | 173 | ;; window-end doesn't reflect the window's new |
| 174 | ;; start position until the next redisplay. Hurrah. | 174 | ;; start position until the next redisplay. Hurrah. |
| 175 | (vertical-motion (1- jump))) | 175 | (vertical-motion (1- jump) window)) |
| 176 | (goto-char (window-start (selected-window)))) | 176 | (goto-char (window-start window))) |
| 177 | (if overlay | 177 | (if overlay |
| 178 | (move-overlay overlay start (point))) | 178 | (move-overlay overlay start (point))) |
| 179 | (if (not (eobp)) | 179 | (if (not (eobp)) |
| @@ -238,11 +238,11 @@ release the mouse button. Otherwise, it does not." | |||
| 238 | (cond | 238 | (cond |
| 239 | ((null mouse-row)) | 239 | ((null mouse-row)) |
| 240 | ((< mouse-row top) | 240 | ((< mouse-row top) |
| 241 | (mouse-scroll-subr | 241 | (mouse-scroll-subr start-window (- mouse-row top) |
| 242 | (- mouse-row top) mouse-drag-overlay start-point)) | 242 | mouse-drag-overlay start-point)) |
| 243 | ((and (not (eobp)) | 243 | ((and (not (eobp)) |
| 244 | (>= mouse-row bottom)) | 244 | (>= mouse-row bottom)) |
| 245 | (mouse-scroll-subr (1+ (- mouse-row bottom)) | 245 | (mouse-scroll-subr start-window (1+ (- mouse-row bottom)) |
| 246 | mouse-drag-overlay start-point))))))))) | 246 | mouse-drag-overlay start-point))))))))) |
| 247 | 247 | ||
| 248 | (if (and (eq (get (event-basic-type event) 'event-kind) 'mouse-click) | 248 | (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 | (cond | 635 | (cond |
| 636 | ((null mouse-row)) | 636 | ((null mouse-row)) |
| 637 | ((< mouse-row top) | 637 | ((< mouse-row top) |
| 638 | (mouse-scroll-subr | 638 | (mouse-scroll-subr start-window (- mouse-row top) |
| 639 | (- mouse-row top) mouse-secondary-overlay start-point)) | 639 | mouse-secondary-overlay start-point)) |
| 640 | ((and (not (eobp)) | 640 | ((and (not (eobp)) |
| 641 | (>= mouse-row bottom)) | 641 | (>= mouse-row bottom)) |
| 642 | (mouse-scroll-subr (1+ (- mouse-row bottom)) | 642 | (mouse-scroll-subr start-window (1+ (- mouse-row bottom)) |
| 643 | mouse-secondary-overlay start-point))))))))) | 643 | mouse-secondary-overlay start-point))))))))) |
| 644 | 644 | ||
| 645 | (if (and (eq (get (event-basic-type event) 'event-kind) 'mouse-click) | 645 | (if (and (eq (get (event-basic-type event) 'event-kind) 'mouse-click) |