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: Richard M. Stallman
Subject: [Emacs-diffs] Changes to emacs/lisp/mouse.el
Date: Tue, 13 Nov 2001 21:49:16 -0500

Index: emacs/lisp/mouse.el
diff -u emacs/lisp/mouse.el:1.229 emacs/lisp/mouse.el:1.230
--- emacs/lisp/mouse.el:1.229   Tue Nov 13 21:48:17 2001
+++ emacs/lisp/mouse.el Tue Nov 13 21:49:15 2001
@@ -677,6 +677,7 @@
         (start-posn (event-start start-event))
         (start-point (posn-point start-posn))
         (start-window (posn-window start-posn))
+        (start-window-start (window-start start-window))
         (start-frame (window-frame start-window))
         (start-hscroll (window-hscroll start-window))
         (bounds (window-edges start-window))
@@ -742,6 +743,7 @@
                  (mouse-scroll-subr start-window (1+ (- mouse-row bottom))
                                     mouse-drag-overlay start-point)
                  (setq end-of-range (overlay-end mouse-drag-overlay))))))))))
+      
       ;; In case we did not get a mouse-motion event
       ;; for the final move of the mouse before a drag event
       ;; pretend that we did get one.
@@ -750,7 +752,6 @@
                       end-point (posn-point end))
                 (eq (posn-window end) start-window)
                 (integer-or-marker-p end-point))
-
        ;; Go to START-POINT first, so that when we move to END-POINT,
        ;; if it's in the middle of intangible text,
        ;; point jumps in the direction away from START-POINT.
@@ -802,7 +803,18 @@
              (delete-overlay mouse-drag-overlay)
              ;; Run the binding of the terminating up-event.
              (when (and (functionp fun)
-                        (= start-hscroll (window-hscroll start-window)))
+                        (= start-hscroll (window-hscroll start-window))
+                        ;; Don't run the up-event handler if the
+                        ;; window start changed in a redisplay after
+                        ;; the mouse-set-point for the down-mouse
+                        ;; event at the beginning of this function.
+                        ;; When the window start has changed, the
+                        ;; up-mouse event will contain a different
+                        ;; position due to the new window contents,
+                        ;; and point is set again.
+                        (or end-point
+                            (= (window-start start-window)
+                               start-window-start)))
                (setq unread-command-events
                      (cons event unread-command-events)))))
        (delete-overlay mouse-drag-overlay)))))



reply via email to

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