diff options
| -rw-r--r-- | lisp/mouse.el | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el index f7977689634..c43b25457c9 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el | |||
| @@ -629,11 +629,14 @@ This must be bound to a button-down mouse event." | |||
| 629 | ;; Are we moving within the original window? | 629 | ;; Are we moving within the original window? |
| 630 | ((and (eq (posn-window end) start-window) | 630 | ((and (eq (posn-window end) start-window) |
| 631 | (integer-or-marker-p end-point)) | 631 | (integer-or-marker-p end-point)) |
| 632 | (set-marker mouse-secondary-start nil) | ||
| 633 | (let ((range (mouse-start-end start-point end-point | 632 | (let ((range (mouse-start-end start-point end-point |
| 634 | click-count))) | 633 | click-count))) |
| 635 | (move-overlay mouse-secondary-overlay | 634 | (if (or (/= start-point end-point) |
| 636 | (car range) (nth 1 range)))) | 635 | (null (marker-position mouse-secondary-start))) |
| 636 | (progn | ||
| 637 | (set-marker mouse-secondary-start nil) | ||
| 638 | (move-overlay mouse-secondary-overlay | ||
| 639 | (car range) (nth 1 range)))))) | ||
| 637 | (t | 640 | (t |
| 638 | (let ((mouse-row (cdr (cdr (mouse-position))))) | 641 | (let ((mouse-row (cdr (cdr (mouse-position))))) |
| 639 | (cond | 642 | (cond |
| @@ -787,11 +790,20 @@ again. If you do this twice in the same position, it kills the selection." | |||
| 787 | (overlay-start mouse-secondary-overlay) | 790 | (overlay-start mouse-secondary-overlay) |
| 788 | click-posn)) | 791 | click-posn)) |
| 789 | (setq deactivate-mark nil))) | 792 | (setq deactivate-mark nil))) |
| 790 | (setcar kill-ring (buffer-substring | 793 | (if (eq last-command 'mouse-secondary-save-then-kill) |
| 791 | (overlay-start mouse-secondary-overlay) | 794 | (progn |
| 792 | (overlay-end mouse-secondary-overlay))) | 795 | ;; If the front of the kill ring comes from |
| 793 | (if interprogram-cut-function | 796 | ;; an immediately previous use of this command, |
| 794 | (funcall interprogram-cut-function (car kill-ring)))) | 797 | ;; replace it with the extended region. |
| 798 | ;; (It would be annoying to make a separate entry.) | ||
| 799 | (setcar kill-ring | ||
| 800 | (buffer-substring | ||
| 801 | (overlay-start mouse-secondary-overlay) | ||
| 802 | (overlay-end mouse-secondary-overlay))) | ||
| 803 | (if interprogram-cut-function | ||
| 804 | (funcall interprogram-cut-function (car kill-ring)))) | ||
| 805 | (copy-region-as-kill (overlay-start mouse-secondary-overlay) | ||
| 806 | (overlay-end mouse-secondary-overlay)))) | ||
| 795 | (if mouse-secondary-start | 807 | (if mouse-secondary-start |
| 796 | ;; All we have is one end of a selection, | 808 | ;; All we have is one end of a selection, |
| 797 | ;; so put the other end here. | 809 | ;; so put the other end here. |