emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r108600: Do not set mark on single mo


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r108600: Do not set mark on single mouse-1 clicks.
Date: Wed, 13 Jun 2012 23:28:10 +0800
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 108600
fixes bug: http://debbugs.gnu.org/11588
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Wed 2012-06-13 23:28:10 +0800
message:
  Do not set mark on single mouse-1 clicks.
  
  * mouse.el (mouse-drag-track): Do not set the mark if the user
  releases the mouse without selecting anything.
modified:
  lisp/ChangeLog
  lisp/mouse.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-06-13 13:56:57 +0000
+++ b/lisp/ChangeLog    2012-06-13 15:28:10 +0000
@@ -1,3 +1,8 @@
+2012-06-13  Chong Yidong  <address@hidden>
+
+       * mouse.el (mouse-drag-track): Do not set the mark if the user
+       releases the mouse without selecting anything (Bug#11588).
+
 2012-06-13  Stefan Monnier  <address@hidden>
 
        * textmodes/tex-mode.el (latex-indent): Recognize tex-verbatim at EOB

=== modified file 'lisp/mouse.el'
--- a/lisp/mouse.el     2012-05-04 23:16:47 +0000
+++ b/lisp/mouse.el     2012-06-13 15:28:10 +0000
@@ -805,7 +805,7 @@
         ;; when setting point near the right fringe (but see below).
         (auto-hscroll-mode-saved auto-hscroll-mode)
         (auto-hscroll-mode nil)
-        event end end-point)
+        moved-off-start event end end-point)
 
     (setq mouse-selection-click-count click-count)
     ;; In case the down click is in the middle of some intangible text,
@@ -840,6 +840,9 @@
            (redisplay))
          (setq end (event-end event)
                end-point (posn-point end))
+         ;; Note whether the mouse has left the starting position.
+         (unless (eq end-point start-point)
+           (setq moved-off-start t))
          (if (and (eq (posn-window end) start-window)
                   (integer-or-marker-p end-point))
              (mouse--drag-set-mark-and-point start-point
@@ -880,11 +883,11 @@
                   (let (deactivate-mark)
                     (copy-region-as-kill (mark) (point)))))
 
-         ;; If point hasn't moved, run the binding of the
-         ;; terminating up-event.
-         (if do-multi-click
-             (goto-char start-point)
-           (deactivate-mark))
+         ;; Otherwise, run binding of terminating up-event.
+         (cond
+          (do-multi-click (goto-char start-point))
+          (moved-off-start (deactivate-mark))
+          (t (pop-mark)))
          (when (and (functionp fun)
                     (= start-hscroll (window-hscroll start-window))
                     ;; Don't run the up-event handler if the window


reply via email to

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