aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2011-07-12 14:59:48 -0400
committerChong Yidong2011-07-12 14:59:48 -0400
commit7a6bda45ea24174e8c4c8f976958d9cdb5e8e223 (patch)
treefe7a99e127b8040da6dc2c9d370c31f45f6d0fd4
parentc830e5aeea7e711b275a36f5ecf15d890742e2f3 (diff)
downloademacs-7a6bda45ea24174e8c4c8f976958d9cdb5e8e223.tar.gz
emacs-7a6bda45ea24174e8c4c8f976958d9cdb5e8e223.zip
Adapt Mouse Sel mode to Emacs 24 mouse code.
* lisp/mouse-sel.el: Hack restoring functionality, while keeping compatibility with 2010-07-03 changes to mouse selection. (mouse-sel-primary-overlay): New var. (mouse-sel-selection-alist): Use it. (mouse-sel-mode): Doc fix; remove points that are default features of mouse.el.
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/mouse-sel.el31
2 files changed, 24 insertions, 16 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 7a9e0267c3e..f0c5040b5ec 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
12011-07-12 Chong Yidong <cyd@stupidchicken.com>
2
3 * mouse-sel.el: Hack restoring functionality, while keeping
4 compatibility with 2010-07-03 changes to mouse selection.
5 (mouse-sel-primary-overlay): New var.
6 (mouse-sel-selection-alist): Use it.
7 (mouse-sel-mode): Doc fix; remove points that are default features
8 of mouse.el.
9
12011-07-12 Johan Bockgård <bojohan@gnu.org> 102011-07-12 Johan Bockgård <bojohan@gnu.org>
2 11
3 * progmodes/compile.el (compilation-error-regexp-alist-alist): 12 * progmodes/compile.el (compilation-error-regexp-alist-alist):
diff --git a/lisp/mouse-sel.el b/lisp/mouse-sel.el
index 1f601377ad4..8f27b0e162b 100644
--- a/lisp/mouse-sel.el
+++ b/lisp/mouse-sel.el
@@ -202,14 +202,10 @@ If nil, point will always be placed at the beginning of the region."
202With prefix ARG, turn Mouse Sel mode on if and only if ARG is positive. 202With prefix ARG, turn Mouse Sel mode on if and only if ARG is positive.
203Returns the new status of Mouse Sel mode (non-nil means on). 203Returns the new status of Mouse Sel mode (non-nil means on).
204 204
205When Mouse Sel mode is enabled, mouse selection is enhanced in various ways: 205When Mouse Sel mode is enabled, mouse selection is enhanced in
206various ways:
206 207
207- Clicking mouse-1 starts (cancels) selection, dragging extends it. 208- Double-clicking on symbol constituents selects symbols.
208
209- Clicking or dragging mouse-3 extends the selection as well.
210
211- Double-clicking on word constituents selects words.
212Double-clicking on symbol constituents selects symbols.
213Double-clicking on quotes or parentheses selects sexps. 209Double-clicking on quotes or parentheses selects sexps.
214Double-clicking on whitespace selects whitespace. 210Double-clicking on whitespace selects whitespace.
215Triple-clicking selects lines. 211Triple-clicking selects lines.
@@ -224,14 +220,8 @@ mouse-sel sets the variables `interprogram-cut-function' and
224- Clicking mouse-2 inserts the contents of the primary selection at 220- Clicking mouse-2 inserts the contents of the primary selection at
225the mouse position (or point, if `mouse-yank-at-point' is non-nil). 221the mouse position (or point, if `mouse-yank-at-point' is non-nil).
226 222
227- Pressing mouse-2 while selecting or extending copies selection 223- mouse-2 while selecting or extending copies selection to the
228to the kill ring. Pressing mouse-1 or mouse-3 kills it. 224kill ring; mouse-1 or mouse-3 kills it."
229
230- Double-clicking mouse-3 also kills selection.
231
232- M-mouse-1, M-mouse-2 & M-mouse-3 work similarly to mouse-1, mouse-2
233& mouse-3, but operate on the X secondary selection rather than the
234primary selection and region."
235 :global t 225 :global t
236 :group 'mouse-sel 226 :group 'mouse-sel
237 (if mouse-sel-mode 227 (if mouse-sel-mode
@@ -286,8 +276,17 @@ primary selection and region."
286 (setq mouse-secondary-overlay (make-overlay 1 1)) 276 (setq mouse-secondary-overlay (make-overlay 1 1))
287 (overlay-put mouse-secondary-overlay 'face 'secondary-selection)) 277 (overlay-put mouse-secondary-overlay 'face 'secondary-selection))
288 278
279(defconst mouse-sel-primary-overlay
280 (let ((ol (make-overlay (point-min) (point-min))))
281 (delete-overlay ol)
282 (overlay-put ol 'face 'secondary-selection)
283 ol)
284 "An overlay which records the current primary selection.
285This is used by Mouse Sel mode only.")
286
289(defconst mouse-sel-selection-alist 287(defconst mouse-sel-selection-alist
290 '((SECONDARY mouse-secondary-overlay mouse-sel-secondary-thing)) 288 '((PRIMARY mouse-sel-primary-overlay mouse-sel-primary-thing)
289 (SECONDARY mouse-secondary-overlay mouse-sel-secondary-thing))
291 "Alist associating selections with variables. 290 "Alist associating selections with variables.
292Each element is of the form: 291Each element is of the form:
293 292