Mercurial > emacs
changeset 66085:bff53f7b277b
* mouse.el (mouse-drag-region-1): Handle the case where a
double-click event is bound to an arbitrary function.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Fri, 14 Oct 2005 13:15:05 +0000 |
parents | 810eaa68223f |
children | 1d0956c24eb7 |
files | lisp/ChangeLog lisp/mouse.el |
diffstat | 2 files changed, 17 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Fri Oct 14 09:05:15 2005 +0000 +++ b/lisp/ChangeLog Fri Oct 14 13:15:05 2005 +0000 @@ -1,3 +1,8 @@ +2005-10-14 Chong Yidong <cyd@stupidchicken.com> + + * mouse.el (mouse-drag-region-1): Handle the case where a + double-click event is bound to an arbitrary function. + 2005-10-14 David Ponce <david@dponce.com> * recentf.el (recentf-track-opened-file)
--- a/lisp/mouse.el Fri Oct 14 09:05:15 2005 +0000 +++ b/lisp/mouse.el Fri Oct 14 13:15:05 2005 +0000 @@ -958,12 +958,14 @@ (mouse-move-drag-overlay mouse-drag-overlay start-point end-point click-count)) (if (consp event) - (let ((fun (key-binding (vector (car event))))) + (let* ((fun (key-binding (vector (car event)))) + (do-multi-click (and (> (event-click-count event) 0) + (functionp fun) + (not (eq fun 'mouse-set-point))))) ;; Run the binding of the terminating up-event, if possible. - ;; In the case of a multiple click, it gives the wrong results, - ;; because it would fail to set up a region. - (if (not (= (overlay-start mouse-drag-overlay) - (overlay-end mouse-drag-overlay))) + (if (and (not (= (overlay-start mouse-drag-overlay) + (overlay-end mouse-drag-overlay))) + (not do-multi-click)) (let* ((stop-point (if (numberp (posn-point (event-end event))) (posn-point (event-end event)) @@ -996,8 +998,12 @@ (and (mark t) mark-active (eq buffer (current-buffer)) (mouse-set-region-1)))) + ;; Run the binding of the terminating up-event. + ;; If a multiple click is not bound to mouse-set-point, + ;; cancel the effects of mouse-move-drag-overlay to + ;; avoid producing wrong results. + (if do-multi-click (goto-char start-point)) (delete-overlay mouse-drag-overlay) - ;; Run the binding of the terminating up-event. (when (and (functionp fun) (= start-hscroll (window-hscroll start-window)) ;; Don't run the up-event handler if the