/[emacs]/emacs/lisp/emulation/cua-base.el
ViewVC logotype

Diff of /emacs/lisp/emulation/cua-base.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by kfstorm, Sat May 25 00:06:56 2002 UTC revision 1.9 by kfstorm, Sun May 26 00:54:10 2002 UTC
# Line 30  Line 30 
30  ;; manipulating the region where S-<movement> is used to highlight &  ;; manipulating the region where S-<movement> is used to highlight &
31  ;; extend the region.  ;; extend the region.
32    
33  ;; This package allow the C-z, C-x, C-c, and C-v keys to be  ;; CUA style key bindings for cut and paste
34    ;; ----------------------------------------
35    
36    ;; This package allows the C-z, C-x, C-c, and C-v keys to be
37  ;; bound appropriately according to the Motif/Windows GUI, i.e.  ;; bound appropriately according to the Motif/Windows GUI, i.e.
38  ;;      C-z     -> undo  ;;      C-z     -> undo
39  ;;      C-x     -> cut  ;;      C-x     -> cut
# Line 71  Line 74 
74  ;; If you prefer to use the standard emacs cut, copy, paste, and undo  ;; If you prefer to use the standard emacs cut, copy, paste, and undo
75  ;; bindings, customize cua-enable-cua-keys to nil.  ;; bindings, customize cua-enable-cua-keys to nil.
76    
77    
78    ;; Typing text replaces the region
79    ;; -------------------------------
80    
81    ;; When the region is active, i.e. highlighted, the text in region is
82    ;; replaced by the text you type.
83    
84    ;; The replaced text is saved in register 0 which can be inserted using
85    ;; the key sequence M-0 C-v (see the section on register support below).
86    
87    ;; If you have just replaced a highlighted region with typed text,
88    ;; you can repeat the replace with M-v.  This will search forward
89    ;; for a streach of text identical to the previous contents of the
90    ;; region (i.e. the contents of register 0) and replace it with the
91    ;; text you typed to replace the original region.  Repeating M-v will
92    ;; replace the next matching region and so on.
93    ;;
94    ;; Example:  Suppose you have a line like this
95    ;;   The redo operation will redo the last redoable command
96    ;; which you want to change into
97    ;;   The repeat operation will repeat the last repeatable command
98    ;; This is done by highlighting the first occurrence of "redo"
99    ;; and type "repeat" M-v M-v.
100    
101    ;; Note: Since CUA-mode duplicates the functionality of the
102    ;; delete-selection-mode, that mode is automatically disabled when
103    ;; CUA-mode is enabled.
104    
105    
106  ;; CUA mode indications  ;; CUA mode indications
107  ;; --------------------  ;; --------------------
108  ;; You can choose to let CUA use different cursor colors to indicate  ;; You can choose to let CUA use different cursor colors to indicate
# Line 775  Activates the mark if a prefix argument Line 807  Activates the mark if a prefix argument
807        (if cua--rectangle        (if cua--rectangle
808            (cua--rectangle-corner 0)))))            (cua--rectangle-corner 0)))))
809    
810    ;; Typed text that replaced the highlighted region.
811    (defvar cua--repeat-replace-text nil)
812    
813    (defun cua-repeat-replace-region (arg)
814      "Repeat replacing text of highlighted region with typed text.
815    Searches for the next streach of text identical to the region last
816    replaced by typing text over it and replaces it with the same streach
817    of text.  Note: Works reliable only when repeated immediately after
818    typing the last character."
819      (interactive "P")
820      (unless (eq this-command last-command)
821        (setq cua--repeat-replace-text
822              (and (mark t)
823                   (/= (point) (mark t))
824                   (buffer-substring-no-properties (point) (mark t)))))
825      (let ((old (get-register ?0)))
826        (if (and old
827                 cua--repeat-replace-text
828                 (search-forward old nil t nil))
829            (replace-match cua--repeat-replace-text arg t))))
830    
831  (defun cua-help-for-region (&optional help)  (defun cua-help-for-region (&optional help)
832    "Show region specific help in echo area."    "Show region specific help in echo area."
833    (interactive)    (interactive)
# Line 1038  Extra commands should be added to `cua-u Line 1091  Extra commands should be added to `cua-u
1091    (define-key cua--cua-keys-keymap [(shift control c)] 'mode-specific-command-prefix)    (define-key cua--cua-keys-keymap [(shift control c)] 'mode-specific-command-prefix)
1092    (define-key cua--cua-keys-keymap [(control z)] 'undo)    (define-key cua--cua-keys-keymap [(control z)] 'undo)
1093    (define-key cua--cua-keys-keymap [(control v)] 'yank)    (define-key cua--cua-keys-keymap [(control v)] 'yank)
1094      (define-key cua--cua-keys-keymap [(meta v)] 'cua-repeat-replace-region)
1095    (define-key cua--cua-keys-keymap [remap exchange-point-and-mark] 'cua-exchange-point-and-mark)    (define-key cua--cua-keys-keymap [remap exchange-point-and-mark] 'cua-exchange-point-and-mark)
1096    
1097    (define-key cua--prefix-override-keymap [(control x)] 'cua--prefix-override-handler)    (define-key cua--prefix-override-keymap [(control x)] 'cua--prefix-override-handler)

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26