aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorEli Zaretskii2016-09-21 18:00:18 +0300
committerEli Zaretskii2016-09-21 18:00:18 +0300
commitea1960bf3ccbceb955002837f17b67071789e863 (patch)
tree2638d976cac4374336ed951fd04b3ed023dd8f14 /lisp
parent505fef3ede4e242dee30a256f50e4f665a42c3d1 (diff)
downloademacs-ea1960bf3ccbceb955002837f17b67071789e863.tar.gz
emacs-ea1960bf3ccbceb955002837f17b67071789e863.zip
Avoid resetting track-mouse by mouse clicks
* lisp/mouse.el (mouse-drag-line, mouse-drag-track): Don't assume the previous value of track-mouse is nil; instead, save and restore the previous value. (Bug#24480)
Diffstat (limited to 'lisp')
-rw-r--r--lisp/mouse.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 27f2acbc76a..d0694007d56 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -481,7 +481,8 @@ must be one of the symbols `header', `mode', or `vertical'."
481 (window-pixel-height window))))) 481 (window-pixel-height window)))))
482 (setq dragged t) 482 (setq dragged t)
483 (adjust-window-trailing-edge window growth nil t)) 483 (adjust-window-trailing-edge window growth nil t))
484 (setq last-position position)))))) 484 (setq last-position position)))))
485 (old-track-mouse track-mouse))
485 ;; Start tracking. The special value 'dragging' signals the 486 ;; Start tracking. The special value 'dragging' signals the
486 ;; display engine to freeze the mouse pointer shape for as long 487 ;; display engine to freeze the mouse pointer shape for as long
487 ;; as we drag. 488 ;; as we drag.
@@ -514,7 +515,7 @@ must be one of the symbols `header', `mode', or `vertical'."
514 (define-key map [right-divider] map) 515 (define-key map [right-divider] map)
515 (define-key map [bottom-divider] map) 516 (define-key map [bottom-divider] map)
516 map) 517 map)
517 t (lambda () (setq track-mouse nil))))))) 518 t (lambda () (setq track-mouse old-track-mouse)))))))
518 519
519(defun mouse-drag-mode-line (start-event) 520(defun mouse-drag-mode-line (start-event)
520 "Change the height of a window by dragging on the mode line." 521 "Change the height of a window by dragging on the mode line."
@@ -825,7 +826,8 @@ The region will be defined with mark and point."
825 (click-count (1- (event-click-count start-event))) 826 (click-count (1- (event-click-count start-event)))
826 ;; Suppress automatic hscrolling, because that is a nuisance 827 ;; Suppress automatic hscrolling, because that is a nuisance
827 ;; when setting point near the right fringe (but see below). 828 ;; when setting point near the right fringe (but see below).
828 (auto-hscroll-mode-saved auto-hscroll-mode)) 829 (auto-hscroll-mode-saved auto-hscroll-mode)
830 (old-track-mouse track-mouse))
829 831
830 (setq mouse-selection-click-count click-count) 832 (setq mouse-selection-click-count click-count)
831 ;; In case the down click is in the middle of some intangible text, 833 ;; In case the down click is in the middle of some intangible text,
@@ -877,7 +879,7 @@ The region will be defined with mark and point."
877 nil start-point)))))))) 879 nil start-point))))))))
878 map) 880 map)
879 t (lambda () 881 t (lambda ()
880 (setq track-mouse nil) 882 (setq track-mouse old-track-mouse)
881 (setq auto-hscroll-mode auto-hscroll-mode-saved) 883 (setq auto-hscroll-mode auto-hscroll-mode-saved)
882 (deactivate-mark) 884 (deactivate-mark)
883 (pop-mark))))) 885 (pop-mark)))))