emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/mouse.el


From: Chong Yidong
Subject: [Emacs-diffs] Changes to emacs/lisp/mouse.el
Date: Fri, 14 Oct 2005 09:15:06 -0400

Index: emacs/lisp/mouse.el
diff -c emacs/lisp/mouse.el:1.281 emacs/lisp/mouse.el:1.282
*** emacs/lisp/mouse.el:1.281   Tue Oct 11 15:30:31 2005
--- emacs/lisp/mouse.el Fri Oct 14 13:15:05 2005
***************
*** 958,969 ****
          (mouse-move-drag-overlay mouse-drag-overlay start-point end-point 
click-count))
  
        (if (consp event)
!         (let ((fun (key-binding (vector (car event)))))
              ;; 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)))
                (let* ((stop-point
                        (if (numberp (posn-point (event-end event)))
                            (posn-point (event-end event))
--- 958,971 ----
          (mouse-move-drag-overlay mouse-drag-overlay start-point end-point 
click-count))
  
        (if (consp 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.
!           (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,1003 ****
                      (and (mark t) mark-active
                           (eq buffer (current-buffer))
                           (mouse-set-region-1))))
-               (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
--- 998,1009 ----
                      (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)
                (when (and (functionp fun)
                           (= start-hscroll (window-hscroll start-window))
                           ;; Don't run the up-event handler if the




reply via email to

[Prev in Thread] Current Thread [Next in Thread]