emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r107668: * mwheel.el (mwheel-scroll):


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107668: * mwheel.el (mwheel-scroll): Call deactivate-mark at the right point.
Date: Sat, 24 Mar 2012 19:05:39 +0800
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107668
fixes bug(s): http://debbugs.gnu.org/9623
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sat 2012-03-24 19:05:39 +0800
message:
  * mwheel.el (mwheel-scroll): Call deactivate-mark at the right point.
modified:
  lisp/ChangeLog
  lisp/mwheel.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-03-23 02:46:31 +0000
+++ b/lisp/ChangeLog    2012-03-24 11:05:39 +0000
@@ -1,3 +1,8 @@
+2012-03-24  Chong Yidong  <address@hidden>
+
+       * mwheel.el (mwheel-scroll): Call deactivate-mark at the right
+       point (Bug#9623).
+
 2012-03-23  Stefan Monnier  <address@hidden>
 
        * newcomment.el (comment-choose-indent): No space after BOL.

=== modified file 'lisp/mwheel.el'
--- a/lisp/mwheel.el    2012-01-19 07:21:25 +0000
+++ b/lisp/mwheel.el    2012-03-24 11:05:39 +0000
@@ -232,12 +232,17 @@
                    (end-of-buffer (while t (funcall 
mwheel-scroll-up-function)))))
                (t (error "Bad binding in mwheel-scroll"))))
       (if curwin (select-window curwin)))
-    ;; If there is a temporarily active region, deactivate it iff
+    ;; If there is a temporarily active region, deactivate it if
     ;; scrolling moves point.
     (when opoint
       (with-current-buffer buffer
        (when (/= opoint (point))
-         (deactivate-mark)))))
+         ;; Call `deactivate-mark' at the original position, so that
+         ;; the original region is saved to the X selection.
+         (let ((newpoint (point)))
+           (goto-char opoint)
+           (deactivate-mark)
+           (goto-char newpoint))))))
   (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]