diff lisp/emulation/cua-rect.el @ 67405:f8d3bd39d0a1

* emulation/cua-base.el (cua-use-hyper-key): Replaced by ... (cua-rectangle-modifier-key): ... this. New defcustom. Can now select either meta, hyper, or super modifier for rectangle commands. (cua--rectangle-modifier-key): New defvar. (cua--M/H-key): Use it. Remove special case for 'space. (cua--init-keymaps): Initialize it from cua-rectangle-modifier-key on X, to meta otherwise. Always bind C-return to toggle rectangle. Pass ?\s instead of 'space to cua--M/H-key. * emulation/cua-rect.el (cua-help-for-rectangle): Use cua--rectangle-modifier-key. Handle super modifier too. (cua--init-rectangles): Always bind C-return to toggle rectangle. Pass ?\s instead of 'space to cua--M/H-key and cua--rect-M/H-key.
author Kim F. Storm <storm@cua.dk>
date Thu, 08 Dec 2005 22:24:35 +0000
parents 60adafc3124f
children bb2f67d4e710
line wrap: on
line diff
--- a/lisp/emulation/cua-rect.el	Thu Dec 08 22:23:59 2005 +0000
+++ b/lisp/emulation/cua-rect.el	Thu Dec 08 22:24:35 2005 +0000
@@ -1358,7 +1358,9 @@
 
 (defun cua-help-for-rectangle (&optional help)
   (interactive)
-  (let ((M (if cua-use-hyper-key " H-" " M-")))
+  (let ((M (cond ((eq cua--rectangle-modifier-key 'hyper) " H-")
+		 ((eq cua--rectangle-modifier-key 'super) " s-")
+		 (t " M-"))))
     (message
      (concat (if help "C-?:help" "")
              M "p:pad" M "o:open" M "c:close" M "b:blank"
@@ -1410,12 +1412,11 @@
   (cua--M/H-key cua--rectangle-keymap key cmd))
 
 (defun cua--init-rectangles ()
-  (unless (eq cua-use-hyper-key 'only)
-    (define-key cua--rectangle-keymap [(control return)] 'cua-clear-rectangle-mark)
-    (define-key cua--region-keymap    [(control return)] 'cua-toggle-rectangle-mark))
-  (when cua-use-hyper-key
-    (cua--rect-M/H-key 'space			       'cua-clear-rectangle-mark)
-    (cua--M/H-key cua--region-keymap 'space	       'cua-toggle-rectangle-mark))
+  (define-key cua--rectangle-keymap [(control return)] 'cua-clear-rectangle-mark)
+  (define-key cua--region-keymap    [(control return)] 'cua-toggle-rectangle-mark)
+  (unless (eq cua--rectangle-modifier-key 'meta)
+    (cua--rect-M/H-key ?\s			       'cua-clear-rectangle-mark)
+    (cua--M/H-key cua--region-keymap ?\s	       'cua-toggle-rectangle-mark))
 
   (define-key cua--rectangle-keymap [remap copy-region-as-kill] 'cua-copy-rectangle)
   (define-key cua--rectangle-keymap [remap kill-ring-save]      'cua-copy-rectangle)