From 1b5359dcb5daba5d5e32dc8501a86631f06a8d35 Mon Sep 17 00:00:00 2001 From: Pierre Courtieu Date: Tue, 10 Jan 2006 14:50:50 +0000 Subject: commit of a small patch from Stefan Monnier, to fix a small bug of drag-mouse-region with holes. --- lib/holes.el | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'lib') 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))) -- cgit v1.2.3