;;; 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
(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))
(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" "")))
(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"
(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)