diff options
| author | Kim F. Storm | 2008-02-29 23:43:10 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2008-02-29 23:43:10 +0000 |
| commit | 88fc71a78ecbe60f99539139626608d3125d686a (patch) | |
| tree | 7e7999b7bb5e27a42353a4151b7089e17d59a802 | |
| parent | 92b2e7a30e9fa30e444e775986eac922cafc0e45 (diff) | |
| download | emacs-88fc71a78ecbe60f99539139626608d3125d686a.tar.gz emacs-88fc71a78ecbe60f99539139626608d3125d686a.zip | |
(cua-remap-control-v)
(cua-remap-control-z): New defcustoms.
(cua-mode): Add them to set-after property.
(cua--init-keymaps): Use them.
Add C-x/C-c home, end, next, and prior to cua--prefix-repeat-keymap.
| -rw-r--r-- | lisp/emulation/cua-base.el | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el index 2bc37a9bc95..e44c36597c4 100644 --- a/lisp/emulation/cua-base.el +++ b/lisp/emulation/cua-base.el | |||
| @@ -282,6 +282,17 @@ enabled." | |||
| 282 | (other :tag "Enabled" t)) | 282 | (other :tag "Enabled" t)) |
| 283 | :group 'cua) | 283 | :group 'cua) |
| 284 | 284 | ||
| 285 | (defcustom cua-remap-control-v t | ||
| 286 | "*If non-nil, C-v binding is used for paste (yank). | ||
| 287 | Also, M-v is mapped to `cua-repeat-replace-region'." | ||
| 288 | :type 'boolean | ||
| 289 | :group 'cua) | ||
| 290 | |||
| 291 | (defcustom cua-remap-control-z t | ||
| 292 | "*If non-nil, C-v binding is used for undo." | ||
| 293 | :type 'boolean | ||
| 294 | :group 'cua) | ||
| 295 | |||
| 285 | (defcustom cua-highlight-region-shift-only nil | 296 | (defcustom cua-highlight-region-shift-only nil |
| 286 | "*If non-nil, only highlight region if marked with S-<move>. | 297 | "*If non-nil, only highlight region if marked with S-<move>. |
| 287 | When this is non-nil, CUA toggles `transient-mark-mode' on when the region | 298 | When this is non-nil, CUA toggles `transient-mark-mode' on when the region |
| @@ -1432,24 +1443,21 @@ If ARG is the atom `-', scroll upward by nearly full screen." | |||
| 1432 | 1443 | ||
| 1433 | (define-key cua--cua-keys-keymap [(control x) timeout] 'kill-region) | 1444 | (define-key cua--cua-keys-keymap [(control x) timeout] 'kill-region) |
| 1434 | (define-key cua--cua-keys-keymap [(control c) timeout] 'copy-region-as-kill) | 1445 | (define-key cua--cua-keys-keymap [(control c) timeout] 'copy-region-as-kill) |
| 1435 | (define-key cua--cua-keys-keymap [(control z)] 'undo) | 1446 | (when cua-remap-control-z |
| 1436 | (define-key cua--cua-keys-keymap [(control v)] 'yank) | 1447 | (define-key cua--cua-keys-keymap [(control z)] 'undo)) |
| 1437 | (define-key cua--cua-keys-keymap [(meta v)] 'cua-repeat-replace-region) | 1448 | (when cua-remap-control-v |
| 1449 | (define-key cua--cua-keys-keymap [(control v)] 'yank) | ||
| 1450 | (define-key cua--cua-keys-keymap [(meta v)] 'cua-repeat-replace-region)) | ||
| 1438 | (define-key cua--cua-keys-keymap [remap exchange-point-and-mark] 'cua-exchange-point-and-mark) | 1451 | (define-key cua--cua-keys-keymap [remap exchange-point-and-mark] 'cua-exchange-point-and-mark) |
| 1439 | 1452 | ||
| 1440 | (define-key cua--prefix-override-keymap [(control x)] 'cua--prefix-override-handler) | 1453 | (define-key cua--prefix-override-keymap [(control x)] 'cua--prefix-override-handler) |
| 1441 | (define-key cua--prefix-override-keymap [(control c)] 'cua--prefix-override-handler) | 1454 | (define-key cua--prefix-override-keymap [(control c)] 'cua--prefix-override-handler) |
| 1442 | 1455 | ||
| 1443 | (define-key cua--prefix-repeat-keymap [(control x) (control x)] 'cua--prefix-repeat-handler) | 1456 | (define-key cua--prefix-repeat-keymap [(control x) (control x)] 'cua--prefix-repeat-handler) |
| 1444 | (define-key cua--prefix-repeat-keymap [(control x) up] 'cua--prefix-cut-handler) | ||
| 1445 | (define-key cua--prefix-repeat-keymap [(control x) down] 'cua--prefix-cut-handler) | ||
| 1446 | (define-key cua--prefix-repeat-keymap [(control x) left] 'cua--prefix-cut-handler) | ||
| 1447 | (define-key cua--prefix-repeat-keymap [(control x) right] 'cua--prefix-cut-handler) | ||
| 1448 | (define-key cua--prefix-repeat-keymap [(control c) (control c)] 'cua--prefix-repeat-handler) | 1457 | (define-key cua--prefix-repeat-keymap [(control c) (control c)] 'cua--prefix-repeat-handler) |
| 1449 | (define-key cua--prefix-repeat-keymap [(control c) up] 'cua--prefix-copy-handler) | 1458 | (dolist (key '(up down left right home end next prior)) |
| 1450 | (define-key cua--prefix-repeat-keymap [(control c) down] 'cua--prefix-copy-handler) | 1459 | (define-key cua--prefix-repeat-keymap (vector '(control x) key) 'cua--prefix-cut-handler) |
| 1451 | (define-key cua--prefix-repeat-keymap [(control c) left] 'cua--prefix-copy-handler) | 1460 | (define-key cua--prefix-repeat-keymap (vector '(control c) key) 'cua--prefix-copy-handler)) |
| 1452 | (define-key cua--prefix-repeat-keymap [(control c) right] 'cua--prefix-copy-handler) | ||
| 1453 | 1461 | ||
| 1454 | ;; Enable shifted fallbacks for C-x and C-c when region is active | 1462 | ;; Enable shifted fallbacks for C-x and C-c when region is active |
| 1455 | (define-key cua--region-keymap [(shift control x)] 'cua--shift-control-x-prefix) | 1463 | (define-key cua--region-keymap [(shift control x)] 'cua--shift-control-x-prefix) |
| @@ -1537,6 +1545,7 @@ shifted movement key, set `cua-highlight-region-shift-only'." | |||
| 1537 | :global t | 1545 | :global t |
| 1538 | :group 'cua | 1546 | :group 'cua |
| 1539 | :set-after '(cua-enable-modeline-indications | 1547 | :set-after '(cua-enable-modeline-indications |
| 1548 | cua-remap-control-v cua-remap-control-z | ||
| 1540 | cua-rectangle-mark-key cua-rectangle-modifier-key) | 1549 | cua-rectangle-mark-key cua-rectangle-modifier-key) |
| 1541 | :require 'cua-base | 1550 | :require 'cua-base |
| 1542 | :link '(emacs-commentary-link "cua-base.el") | 1551 | :link '(emacs-commentary-link "cua-base.el") |