Mercurial > emacs
comparison lisp/mouse.el @ 13307:4bc9015f709e
(mouse-drag-region): Set end-of-range after calling mouse-scroll-subr.
(mouse-set-region): Don't do the sit-for on a pc frame.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 27 Oct 1995 17:48:32 +0000 |
parents | 9cc4392719e3 |
children | 84acc3adcd63 |
comparison
equal
deleted
inserted
replaced
13306:77d8e407592e | 13307:4bc9015f709e |
---|---|
399 (goto-char (posn-point posn))) | 399 (goto-char (posn-point posn))) |
400 ;; If mark is highlighted, no need to bounce the cursor. | 400 ;; If mark is highlighted, no need to bounce the cursor. |
401 ;; On X, we highlight while dragging, thus once again no need to bounce. | 401 ;; On X, we highlight while dragging, thus once again no need to bounce. |
402 (or transient-mark-mode | 402 (or transient-mark-mode |
403 (eq (framep (selected-frame)) 'x) | 403 (eq (framep (selected-frame)) 'x) |
404 (eq (framep (selected-frame)) 'pc) | |
404 (sit-for 1)) | 405 (sit-for 1)) |
405 (push-mark) | 406 (push-mark) |
406 (set-mark (point)) | 407 (set-mark (point)) |
407 (if (numberp (posn-point end)) | 408 (if (numberp (posn-point end)) |
408 (goto-char (posn-point end))) | 409 (goto-char (posn-point end))) |
541 (let ((mouse-row (cdr (cdr (mouse-position))))) | 542 (let ((mouse-row (cdr (cdr (mouse-position))))) |
542 (cond | 543 (cond |
543 ((null mouse-row)) | 544 ((null mouse-row)) |
544 ((< mouse-row top) | 545 ((< mouse-row top) |
545 (mouse-scroll-subr start-window (- mouse-row top) | 546 (mouse-scroll-subr start-window (- mouse-row top) |
546 mouse-drag-overlay start-point)) | 547 mouse-drag-overlay start-point) |
548 ;; Without this, point tends to jump back to the starting | |
549 ;; position where the mouse button was pressed down. | |
550 (setq end-of-range (overlay-start mouse-drag-overlay))) | |
547 ((>= mouse-row bottom) | 551 ((>= mouse-row bottom) |
548 (mouse-scroll-subr start-window (1+ (- mouse-row bottom)) | 552 (mouse-scroll-subr start-window (1+ (- mouse-row bottom)) |
549 mouse-drag-overlay start-point))))))))) | 553 mouse-drag-overlay start-point) |
554 (setq end-of-range (overlay-end mouse-drag-overlay)))))))))) | |
550 (if (consp event) | 555 (if (consp event) |
551 (let ((fun (key-binding (vector (car event))))) | 556 (let ((fun (key-binding (vector (car event))))) |
552 ;; Run the binding of the terminating up-event, if possible. | 557 ;; Run the binding of the terminating up-event, if possible. |
553 ;; In the case of a multiple click, it gives the wrong results, | 558 ;; In the case of a multiple click, it gives the wrong results, |
554 ;; because it would fail to set up a region. | 559 ;; because it would fail to set up a region. |