]> code.delx.au - gnu-emacs/blobdiff - lisp/emulation/cua-rect.el
Typo.
[gnu-emacs] / lisp / emulation / cua-rect.el
index e80a332751b5d9e1e917a84983e9fbec16a185fa..120866e7925e947dae14d79ee57bba9081fde4d7 100644 (file)
@@ -1,7 +1,7 @@
 ;;; cua-rect.el --- CUA unified rectangle support
 
 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-;;   2005 Free Software Foundation, Inc.
+;;   2005, 2006 Free Software Foundation, Inc.
 
 ;; Author: Kim F. Storm <storm@cua.dk>
 ;; Keywords: keyboard emulations convenience CUA
@@ -641,11 +641,11 @@ If command is repeated at same position, delete the rectangle."
             (if (= (point) (line-end-position))
                 (setq bs (- r l)
                       copy nil)
-              (skip-chars-forward " \t" e)
+              (skip-chars-forward "\s\t" e)
               (setq bs (- (min r (current-column)) l)
                     s (point))
               (move-to-column r)
-              (skip-chars-backward " \t" s)
+              (skip-chars-backward "\s\t" s)
               (setq as (- r (max (current-column) l))
                     e (point)))
                     (setq row (if (and copy (> e s))
@@ -1242,6 +1242,7 @@ The numbers are formatted according to the FORMAT string."
               (setq z (cdr z)))
             (if cua--debug
                 (print (list (current-column) cc) auxbuf))
+            (just-one-space 0)
              (indent-to cc))))
       (if (> tr 0)
          (message "Warning:  Truncated %d row%s" tr (if (> tr 1) "s" "")))
@@ -1358,7 +1359,9 @@ With prefix arg, indent to that column."
 
 (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 +1413,11 @@ With prefix arg, indent to that column."
   (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)