Mercurial > emacs
changeset 62184:d2e6a54e6fb1
(cua-copy-region, cua-cut-region)
(cua-paste): Handle clipboard action.
(cua--init-keymaps): Remap clipboard-kill-region and
clipboard-kill-ring-save.
author | Kim F. Storm <storm@cua.dk> |
---|---|
date | Sun, 08 May 2005 22:29:20 +0000 |
parents | 02fb006792d9 |
children | 633425d6cc86 |
files | lisp/emulation/cua-base.el |
diffstat | 1 files changed, 18 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/emulation/cua-base.el Sun May 08 22:29:03 2005 +0000 +++ b/lisp/emulation/cua-base.el Sun May 08 22:29:20 2005 +0000 @@ -777,9 +777,13 @@ (let ((start (mark)) (end (point))) (or (<= start end) (setq start (prog1 end (setq end start)))) - (if cua--register - (copy-to-register cua--register start end nil) - (copy-region-as-kill start end)) + (cond + (cua--register + (copy-to-register cua--register start end nil)) + ((eq this-original-command 'clipboard-kill-ring-save) + (clipboard-kill-ring-save start end)) + (t + (copy-region-as-kill start end))) (if cua-keep-region-after-copy (cua--keep-active) (cua--deactivate)))) @@ -795,9 +799,13 @@ (let ((start (mark)) (end (point))) (or (<= start end) (setq start (prog1 end (setq end start)))) - (if cua--register - (copy-to-register cua--register start end t) - (kill-region start end))) + (cond + (cua--register + (copy-to-register cua--register start end t)) + ((eq this-original-command 'clipboard-kill-region) + (clipboard-kill-region start end)) + (t + (kill-region start end)))) (cua--deactivate))) ;;; Generic commands for regions, rectangles, and global marks @@ -864,6 +872,8 @@ (cua--insert-rectangle (cdr cua--last-killed-rectangle) nil paste-column paste-lines) (if arg (goto-char pt)))) + ((eq this-original-command 'clipboard-yank) + (clipboard-yank)) (t (yank arg))))))) (defun cua-paste-pop (arg) @@ -1282,9 +1292,11 @@ (define-key cua--region-keymap [remap delete-char] 'cua-delete-region) ;; kill region (define-key cua--region-keymap [remap kill-region] 'cua-cut-region) + (define-key cua--region-keymap [remap clipboard-kill-region] 'cua-cut-region) ;; copy region (define-key cua--region-keymap [remap copy-region-as-kill] 'cua-copy-region) (define-key cua--region-keymap [remap kill-ring-save] 'cua-copy-region) + (define-key cua--region-keymap [remap clipboard-kill-ring-save] 'cua-copy-region) ;; cancel current region/rectangle (define-key cua--region-keymap [remap keyboard-escape-quit] 'cua-cancel) (define-key cua--region-keymap [remap keyboard-quit] 'cua-cancel)