From: Lars Ingebrigtsen Date: Mon, 11 Oct 2021 11:16:57 +0000 (+0200) Subject: Change how cua-mode defined `C-x' and `C-c' X-Git-Tag: emacs-29.0.90~3671^2~618 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=237b2ecf2d1140d6789822c5de90f9bf2a8ce50c;p=emacs.git Change how cua-mode defined `C-x' and `C-c' * lisp/emulation/cua-base.el (cua-cut-handler): (cua-copy-handler): New aliases (bug#28930). (cua--init-keymaps): Use them for `C-x' and `C-c' to be able to distinguish the commands when looking them up in reverse. --- diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el index 3976c1ea063..a98393fa2e5 100644 --- a/lisp/emulation/cua-base.el +++ b/lisp/emulation/cua-base.el @@ -699,6 +699,11 @@ Repeating prefix key when region is active works as a single prefix key." (interactive) (cua--prefix-override-replay 0)) +;; These aliases are so that we can look up the commands and find the +;; correct keys when generating menus. +(defalias 'cua-cut-handler #'cua--prefix-override-handler) +(defalias 'cua-copy-handler #'cua--prefix-override-handler) + (defun cua--prefix-repeat-handler () "Repeating prefix key when region is active works as a single prefix key." (interactive) @@ -1258,10 +1263,8 @@ If ARG is the atom `-', scroll upward by nearly full screen." (define-key cua--cua-keys-keymap [(meta v)] #'delete-selection-repeat-replace-region)) - (define-key cua--prefix-override-keymap [(control x)] - #'cua--prefix-override-handler) - (define-key cua--prefix-override-keymap [(control c)] - #'cua--prefix-override-handler) + (define-key cua--prefix-override-keymap [(control x)] #'cua-cut-handler) + (define-key cua--prefix-override-keymap [(control c)] #'cua-copy-handler) (define-key cua--prefix-repeat-keymap [(control x) (control x)] #'cua--prefix-repeat-handler)