diff options
| author | Chong Yidong | 2011-07-12 14:59:48 -0400 |
|---|---|---|
| committer | Chong Yidong | 2011-07-12 14:59:48 -0400 |
| commit | 7a6bda45ea24174e8c4c8f976958d9cdb5e8e223 (patch) | |
| tree | fe7a99e127b8040da6dc2c9d370c31f45f6d0fd4 | |
| parent | c830e5aeea7e711b275a36f5ecf15d890742e2f3 (diff) | |
| download | emacs-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/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/mouse-sel.el | 31 |
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 @@ | |||
| 1 | 2011-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 | |||
| 1 | 2011-07-12 Johan Bockgård <bojohan@gnu.org> | 10 | 2011-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." | |||
| 202 | With prefix ARG, turn Mouse Sel mode on if and only if ARG is positive. | 202 | With prefix ARG, turn Mouse Sel mode on if and only if ARG is positive. |
| 203 | Returns the new status of Mouse Sel mode (non-nil means on). | 203 | Returns the new status of Mouse Sel mode (non-nil means on). |
| 204 | 204 | ||
| 205 | When Mouse Sel mode is enabled, mouse selection is enhanced in various ways: | 205 | When Mouse Sel mode is enabled, mouse selection is enhanced in |
| 206 | various 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. | ||
| 212 | Double-clicking on symbol constituents selects symbols. | ||
| 213 | Double-clicking on quotes or parentheses selects sexps. | 209 | Double-clicking on quotes or parentheses selects sexps. |
| 214 | Double-clicking on whitespace selects whitespace. | 210 | Double-clicking on whitespace selects whitespace. |
| 215 | Triple-clicking selects lines. | 211 | Triple-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 |
| 225 | the mouse position (or point, if `mouse-yank-at-point' is non-nil). | 221 | the 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 |
| 228 | to the kill ring. Pressing mouse-1 or mouse-3 kills it. | 224 | kill 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 | ||
| 234 | primary 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. | ||
| 285 | This 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. |
| 292 | Each element is of the form: | 291 | Each element is of the form: |
| 293 | 292 | ||