diff options
| author | Chong Yidong | 2005-10-14 13:15:05 +0000 |
|---|---|---|
| committer | Chong Yidong | 2005-10-14 13:15:05 +0000 |
| commit | f28e9cbd37a11d734b4301a332661affee281aa2 (patch) | |
| tree | 808aca3a027295beec2f71878ed99ac828769999 | |
| parent | b6b5618c15e0d836edc2e91b25718a249ffde7ee (diff) | |
| download | emacs-f28e9cbd37a11d734b4301a332661affee281aa2.tar.gz emacs-f28e9cbd37a11d734b4301a332661affee281aa2.zip | |
* mouse.el (mouse-drag-region-1): Handle the case where a
double-click event is bound to an arbitrary function.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/mouse.el | 18 |
2 files changed, 17 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 914eec4ab64..7331e7a6213 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2005-10-14 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * mouse.el (mouse-drag-region-1): Handle the case where a | ||
| 4 | double-click event is bound to an arbitrary function. | ||
| 5 | |||
| 1 | 2005-10-14 David Ponce <david@dponce.com> | 6 | 2005-10-14 David Ponce <david@dponce.com> |
| 2 | 7 | ||
| 3 | * recentf.el (recentf-track-opened-file) | 8 | * recentf.el (recentf-track-opened-file) |
diff --git a/lisp/mouse.el b/lisp/mouse.el index 90f2b3ba879..294396a0029 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el | |||
| @@ -958,12 +958,14 @@ at the same position." | |||
| 958 | (mouse-move-drag-overlay mouse-drag-overlay start-point end-point click-count)) | 958 | (mouse-move-drag-overlay mouse-drag-overlay start-point end-point click-count)) |
| 959 | 959 | ||
| 960 | (if (consp event) | 960 | (if (consp event) |
| 961 | (let ((fun (key-binding (vector (car event))))) | 961 | (let* ((fun (key-binding (vector (car event)))) |
| 962 | (do-multi-click (and (> (event-click-count event) 0) | ||
| 963 | (functionp fun) | ||
| 964 | (not (eq fun 'mouse-set-point))))) | ||
| 962 | ;; Run the binding of the terminating up-event, if possible. | 965 | ;; Run the binding of the terminating up-event, if possible. |
| 963 | ;; In the case of a multiple click, it gives the wrong results, | 966 | (if (and (not (= (overlay-start mouse-drag-overlay) |
| 964 | ;; because it would fail to set up a region. | 967 | (overlay-end mouse-drag-overlay))) |
| 965 | (if (not (= (overlay-start mouse-drag-overlay) | 968 | (not do-multi-click)) |
| 966 | (overlay-end mouse-drag-overlay))) | ||
| 967 | (let* ((stop-point | 969 | (let* ((stop-point |
| 968 | (if (numberp (posn-point (event-end event))) | 970 | (if (numberp (posn-point (event-end event))) |
| 969 | (posn-point (event-end event)) | 971 | (posn-point (event-end event)) |
| @@ -996,8 +998,12 @@ at the same position." | |||
| 996 | (and (mark t) mark-active | 998 | (and (mark t) mark-active |
| 997 | (eq buffer (current-buffer)) | 999 | (eq buffer (current-buffer)) |
| 998 | (mouse-set-region-1)))) | 1000 | (mouse-set-region-1)))) |
| 999 | (delete-overlay mouse-drag-overlay) | ||
| 1000 | ;; Run the binding of the terminating up-event. | 1001 | ;; Run the binding of the terminating up-event. |
| 1002 | ;; If a multiple click is not bound to mouse-set-point, | ||
| 1003 | ;; cancel the effects of mouse-move-drag-overlay to | ||
| 1004 | ;; avoid producing wrong results. | ||
| 1005 | (if do-multi-click (goto-char start-point)) | ||
| 1006 | (delete-overlay mouse-drag-overlay) | ||
| 1001 | (when (and (functionp fun) | 1007 | (when (and (functionp fun) |
| 1002 | (= start-hscroll (window-hscroll start-window)) | 1008 | (= start-hscroll (window-hscroll start-window)) |
| 1003 | ;; Don't run the up-event handler if the | 1009 | ;; Don't run the up-event handler if the |