emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/mwheel.el,v


From: Chong Yidong
Subject: [Emacs-diffs] Changes to emacs/lisp/mwheel.el,v
Date: Tue, 08 Apr 2008 05:38:39 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      08/04/08 05:38:39

Index: mwheel.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/mwheel.el,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -b -r1.44 -r1.45
--- mwheel.el   8 Jan 2008 20:44:42 -0000       1.44
+++ mwheel.el   8 Apr 2008 05:38:39 -0000       1.45
@@ -190,6 +190,10 @@
                      (prog1
                          (selected-window)
                        (select-window (mwheel-event-window event)))))
+        (buffer (window-buffer curwin))
+        (opoint (with-current-buffer buffer
+                  (when (eq (car-safe transient-mark-mode) 'only)
+                    (point))))
          (mods
          (delq 'click (delq 'double (delq 'triple (event-modifiers event)))))
          (amt (assoc mods mouse-wheel-scroll-amount)))
@@ -224,7 +228,13 @@
                    ;; Make sure we do indeed scroll to the end of the buffer.
                    (end-of-buffer (while t (scroll-up)))))
                (t (error "Bad binding in mwheel-scroll"))))
-      (if curwin (select-window curwin))))
+      (if curwin (select-window curwin)))
+    ;; If there is a temporarily active region, deactivate it iff
+    ;; scrolling moves point.
+    (when opoint
+      (with-current-buffer buffer
+       (when (/= opoint (point))
+         (deactivate-mark)))))
   (when (and mouse-wheel-click-event mouse-wheel-inhibit-click-time)
     (if mwheel-inhibit-click-event-timer
        (cancel-timer mwheel-inhibit-click-event-timer)




reply via email to

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