emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 237b2ec 2/3: Change how cua-mode defined `C-x' and `C-c'


From: Lars Ingebrigtsen
Subject: master 237b2ec 2/3: Change how cua-mode defined `C-x' and `C-c'
Date: Mon, 11 Oct 2021 07:17:51 -0400 (EDT)

branch: master
commit 237b2ecf2d1140d6789822c5de90f9bf2a8ce50c
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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.
---
 lisp/emulation/cua-base.el | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el
index 3976c1e..a98393f 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]