aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorGravatar Pierre Courtieu <courtieu@lri.fr>2006-01-10 14:50:50 +0000
committerGravatar Pierre Courtieu <courtieu@lri.fr>2006-01-10 14:50:50 +0000
commit1b5359dcb5daba5d5e32dc8501a86631f06a8d35 (patch)
tree18a3fe6cbfc6d4914e54eb563702cbfe915cae21 /lib
parent755234d9672b0a3cb2ddb000066d1af25a1237c1 (diff)
commit of a small patch from Stefan Monnier, to fix a small bug of
drag-mouse-region with holes.
Diffstat (limited to 'lib')
-rw-r--r--lib/holes.el14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/holes.el b/lib/holes.el
index 62956b89..3b182f19 100644
--- a/lib/holes.el
+++ b/lib/holes.el
@@ -589,13 +589,25 @@ Sets `holes-active-hole' to the next hole if it exists."
(eval-and-compile
(cond
+ ;; XEmacs's mouse-track.
((fboundp 'mouse-track)
(defalias 'holes-track-mouse-selection 'mouse-track)
(defsubst holes-track-mouse-clicks ()
"see `mouse-track-click-count'"
mouse-track-click-count))
+ ;; Emacs-22's mouse-drag-track.
+ ((fboundp 'mouse-drag-track)
+ (defalias 'holes-track-mouse-selection 'mouse-drag-track)
+ (defsubst holes-track-mouse-clicks ()
+ "see `mouse-track-click-count'"
+ (+ mouse-selection-click-count 1)))
+ ;; Emacs<22
((fboundp 'mouse-drag-region)
- (defalias 'holes-track-mouse-selection 'mouse-drag-region)
+ (defun holes-track-mouse-selection (event)
+ ;; Emacs-21's mouse-drag-region has a bug that makes it behave more or
+ ;; less like we want it as long as transient-mark-mode is active.
+ (let ((transient-mark-mode nil))
+ (mouse-drag-region event)))
(defsubst holes-track-mouse-clicks ()
"see `mouse-selection-click-count'"
(+ mouse-selection-click-count 1)))