changeset 74367:a3192cfa5e41

(mouse-drag-track): Suppress automatic hscrolling for initial down event.
author Chong Yidong <cyd@stupidchicken.com>
date Sat, 02 Dec 2006 21:47:02 +0000
parents b172b155c64c
children 3fed121bb58a
files lisp/mouse.el
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mouse.el	Sat Dec 02 21:46:52 2006 +0000
+++ b/lisp/mouse.el	Sat Dec 02 21:47:02 2006 +0000
@@ -925,7 +925,11 @@
 	 (click-count (1- (event-click-count start-event)))
 	 (remap-double-click (and on-link
 				  (eq mouse-1-click-follows-link 'double)
-				  (= click-count 1))))
+				  (= click-count 1)))
+	 ;; Suppress automatic hscrolling, because that is a nuisance
+	 ;; when setting point near the right fringe (but see below).
+	 (automatic-hscrolling-saved automatic-hscrolling)
+	 (automatic-hscrolling nil))
     (setq mouse-selection-click-count click-count)
     ;; In case the down click is in the middle of some intangible text,
     ;; use the end of that text, and put it in START-POINT.
@@ -946,6 +950,11 @@
                      (memq (car-safe event) '(switch-frame select-window))))
           (if (memq (car-safe event) '(switch-frame select-window))
 	      nil
+	    ;; Automatic hscrolling did not occur during the call to
+	    ;; `read-event'; but if the user subsequently drags the
+	    ;; mouse, go ahead and hscroll.
+	    (let ((automatic-hscrolling automatic-hscrolling-saved))
+	      (redisplay))
 	    (setq end (event-end event)
 		  end-point (posn-point end))
 	    (if (numberp end-point)