[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/emulation/cua-base.el
From: |
Kim F . Storm |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/emulation/cua-base.el |
Date: |
Thu, 08 Dec 2005 17:24:36 -0500 |
Index: emacs/lisp/emulation/cua-base.el
diff -c emacs/lisp/emulation/cua-base.el:1.64
emacs/lisp/emulation/cua-base.el:1.65
*** emacs/lisp/emulation/cua-base.el:1.64 Thu Dec 8 14:12:12 2005
--- emacs/lisp/emulation/cua-base.el Thu Dec 8 22:24:35 2005
***************
*** 329,343 ****
:type 'boolean
:group 'cua)
- (defcustom cua-use-hyper-key nil
- "*If non-nil, bind rectangle commands to H-... instead of M-....
- If set to `also', toggle region command is also on C-return.
- Must be set prior to enabling CUA."
- :type '(choice (const :tag "Meta key and C-return" nil)
- (const :tag "Hyper key only" only)
- (const :tag "Hyper key and C-return" also))
- :group 'cua)
-
(defcustom cua-enable-region-auto-help nil
"*If non-nil, automatically show help for active region."
:type 'boolean
--- 329,334 ----
***************
*** 379,384 ****
--- 370,384 ----
(other :tag "Enabled" t))
:group 'cua)
+ (defcustom cua-rectangle-modifier-key 'meta
+ "*Modifier key used for rectangle commands bindings.
+ On non-window systems, always use the meta modifier.
+ Must be set prior to enabling CUA."
+ :type '(choice (const :tag "Meta key" meta)
+ (const :tag "Hyper key" hyper )
+ (const :tag "Super key" super))
+ :group 'cua)
+
(defcustom cua-enable-rectangle-auto-help t
"*If non-nil, automatically show help for region, rectangle and global
mark."
:type 'boolean
***************
*** 1180,1190 ****
;;; Keymaps
(defun cua--M/H-key (map key fct)
;; bind H-KEY or M-KEY to FCT in MAP
- (if (eq key 'space) (setq key ?\s))
(unless (listp key) (setq key (list key)))
! (define-key map (vector (cons (if cua-use-hyper-key 'hyper 'meta) key))
fct))
(defun cua--self-insert-char-p (def)
;; Return DEF if current key sequence is self-inserting in
--- 1180,1192 ----
;;; Keymaps
+ ;; Cached value of actual cua-rectangle-modifier-key
+ (defvar cua--rectangle-modifier-key 'meta)
+
(defun cua--M/H-key (map key fct)
;; bind H-KEY or M-KEY to FCT in MAP
(unless (listp key) (setq key (list key)))
! (define-key map (vector (cons cua--rectangle-modifier-key key)) fct))
(defun cua--self-insert-char-p (def)
;; Return DEF if current key sequence is self-inserting in
***************
*** 1266,1276 ****
(cua--shift-control-prefix ?\C-x arg))
(defun cua--init-keymaps ()
! (unless (eq cua-use-hyper-key 'only)
! (define-key cua-global-keymap [(control return)]
'cua-set-rectangle-mark))
! (when cua-use-hyper-key
! (cua--M/H-key cua-global-keymap 'space 'cua-set-rectangle-mark)
! (define-key cua-global-keymap [(hyper mouse-1)]
'cua-mouse-set-rectangle-mark))
(define-key cua-global-keymap [(shift control ?\s)] 'cua-toggle-global-mark)
--- 1268,1285 ----
(cua--shift-control-prefix ?\C-x arg))
(defun cua--init-keymaps ()
! ;; Cache actual rectangle modifier key.
! (setq cua--rectangle-modifier-key
! (if (and cua-rectangle-modifier-key
! (memq window-system '(x)))
! cua-rectangle-modifier-key
! 'meta))
! ;; C-return always toggles rectangle mark
! (define-key cua-global-keymap [(control return)] 'cua-set-rectangle-mark)
! (unless (eq cua--rectangle-modifier-key 'meta)
! (cua--M/H-key cua-global-keymap ?\s
'cua-set-rectangle-mark)
! (define-key cua-global-keymap
! (vector (list cua--rectangle-modifier-key 'mouse-1))
'cua-mouse-set-rectangle-mark))
(define-key cua-global-keymap [(shift control ?\s)] 'cua-toggle-global-mark)
***************
*** 1387,1393 ****
the prefix fallback behavior."
:global t
:group 'cua
! :set-after '(cua-enable-modeline-indications cua-use-hyper-key)
:require 'cua-base
:link '(emacs-commentary-link "cua-base.el")
(setq mark-even-if-inactive t)
--- 1396,1402 ----
the prefix fallback behavior."
:global t
:group 'cua
! :set-after '(cua-enable-modeline-indications cua-rectangle-modifier-key)
:require 'cua-base
:link '(emacs-commentary-link "cua-base.el")
(setq mark-even-if-inactive t)