emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/emulation/cua-base.el


From: Juanma Barranquero
Subject: [Emacs-diffs] Changes to emacs/lisp/emulation/cua-base.el
Date: Tue, 04 Feb 2003 07:56:05 -0500

Index: emacs/lisp/emulation/cua-base.el
diff -c emacs/lisp/emulation/cua-base.el:1.16 
emacs/lisp/emulation/cua-base.el:1.17
*** emacs/lisp/emulation/cua-base.el:1.16       Sat Jan 25 06:41:43 2003
--- emacs/lisp/emulation/cua-base.el    Tue Feb  4 07:56:02 2003
***************
*** 54,60 ****
  ;; This probably sounds strange and difficult to get used to - but
  ;; based on my own experience and the feedback from many users of
  ;; this package, it actually works very well and users adapt to it
! ;; instantly - or at least very quickly.  So give it a try!  
  ;; ... and in the few cases where you make a mistake and accidentally
  ;; delete the region - you just undo the mistake (with C-z).
  ;;
--- 54,60 ----
  ;; This probably sounds strange and difficult to get used to - but
  ;; based on my own experience and the feedback from many users of
  ;; this package, it actually works very well and users adapt to it
! ;; instantly - or at least very quickly.  So give it a try!
  ;; ... and in the few cases where you make a mistake and accidentally
  ;; delete the region - you just undo the mistake (with C-z).
  ;;
***************
*** 120,134 ****
  ;; --------------------
  ;; Emacs' standard register support is also based on a separate set of
  ;; "register commands".
! ;; 
  ;; CUA's register support is activated by providing a numeric
  ;; prefix argument to the C-x, C-c, and C-v commands. For example,
  ;; to copy the selected region to register 2, enter [M-2 C-c].
  ;; Or if you have activated the keypad prefix mode, enter [kp-2 C-c].
! ;; 
  ;; And CUA will copy and paste normal region as well as rectangles
  ;; into the registers, i.e. you use exactly the same command for both.
! ;; 
  ;; In addition, the last highlighted text that is deleted (not
  ;; copied), e.g. by [delete] or by typing text over a highlighted
  ;; region, is automatically saved in register 0, so you can insert it
--- 120,134 ----
  ;; --------------------
  ;; Emacs' standard register support is also based on a separate set of
  ;; "register commands".
! ;;
  ;; CUA's register support is activated by providing a numeric
  ;; prefix argument to the C-x, C-c, and C-v commands. For example,
  ;; to copy the selected region to register 2, enter [M-2 C-c].
  ;; Or if you have activated the keypad prefix mode, enter [kp-2 C-c].
! ;;
  ;; And CUA will copy and paste normal region as well as rectangles
  ;; into the registers, i.e. you use exactly the same command for both.
! ;;
  ;; In addition, the last highlighted text that is deleted (not
  ;; copied), e.g. by [delete] or by typing text over a highlighted
  ;; region, is automatically saved in register 0, so you can insert it
***************
*** 140,146 ****
  ;; between the mark and point as a "virtual rectangle", and using a
  ;; completely separate set of "rectangle commands" [C-x r ...] on the
  ;; region to copy, kill, fill a.s.o. the virtual rectangle.
! ;; 
  ;; cua-mode's superior rectangle support is based on using a true visual
  ;; representation of the selected rectangle. To start a rectangle, use
  ;; [S-return] and extend it using the normal movement keys (up, down,
--- 140,146 ----
  ;; between the mark and point as a "virtual rectangle", and using a
  ;; completely separate set of "rectangle commands" [C-x r ...] on the
  ;; region to copy, kill, fill a.s.o. the virtual rectangle.
! ;;
  ;; cua-mode's superior rectangle support is based on using a true visual
  ;; representation of the selected rectangle. To start a rectangle, use
  ;; [S-return] and extend it using the normal movement keys (up, down,
***************
*** 154,165 ****
  ;; the rectangle is inserted into the existing lines in the buffer.
  ;; If overwrite-mode is active when you paste a rectangle, it is
  ;; inserted as normal (multi-line) text.
! ;; 
  ;; Furthermore, cua-mode's rectangles are not limited to the actual
  ;; contents of the buffer, so if the cursor is currently at the end of a
  ;; short line, you can still extend the rectangle to include more columns
  ;; of longer lines in the same rectangle.  Sounds strange? Try it!
! ;; 
  ;; You can enable padding for just this rectangle by pressing [M-p];
  ;; this works like entering `picture-mode' where the tabs and spaces
  ;; are automatically converted/inserted to make the rectangle truly
--- 154,165 ----
  ;; the rectangle is inserted into the existing lines in the buffer.
  ;; If overwrite-mode is active when you paste a rectangle, it is
  ;; inserted as normal (multi-line) text.
! ;;
  ;; Furthermore, cua-mode's rectangles are not limited to the actual
  ;; contents of the buffer, so if the cursor is currently at the end of a
  ;; short line, you can still extend the rectangle to include more columns
  ;; of longer lines in the same rectangle.  Sounds strange? Try it!
! ;;
  ;; You can enable padding for just this rectangle by pressing [M-p];
  ;; this works like entering `picture-mode' where the tabs and spaces
  ;; are automatically converted/inserted to make the rectangle truly
***************
*** 185,191 ****
  ;; paragraph like this one, just place the cursor on the first character
  ;; of the first line, and enter the following:
  ;;     S-return M-} ; ; <space>  S-return
!  
  ;; cua-mode's rectangle support also includes all the normal rectangle
  ;; functions with easy access:
  ;;
--- 185,191 ----
  ;; paragraph like this one, just place the cursor on the first character
  ;; of the first line, and enter the following:
  ;;     S-return M-} ; ; <space>  S-return
! 
  ;; cua-mode's rectangle support also includes all the normal rectangle
  ;; functions with easy access:
  ;;
***************
*** 202,208 ****
  ;; [M-m] copies the rectangle as normal multi-line text (for paste)
  ;; [M-n] fills each line of the rectangle with increasing numbers using
  ;;       a supplied format string (prompt)
! ;; [M-o] opens the rectangle by moving the highlighted text to the 
  ;;       right of the rectangle and filling the rectangle with blanks.
  ;; [M-p] toggles rectangle padding, i.e. insert tabs and spaces to
  ;;       make rectangles truly rectangular
--- 202,208 ----
  ;; [M-m] copies the rectangle as normal multi-line text (for paste)
  ;; [M-n] fills each line of the rectangle with increasing numbers using
  ;;       a supplied format string (prompt)
! ;; [M-o] opens the rectangle by moving the highlighted text to the
  ;;       right of the rectangle and filling the rectangle with blanks.
  ;; [M-p] toggles rectangle padding, i.e. insert tabs and spaces to
  ;;       make rectangles truly rectangular
***************
*** 222,235 ****
  ;; are lost, but can be recovered using [C-z].
  
  ;; CUA Global Mark
! ;; --------------- 
  ;; The final feature provided by CUA is the "global mark", which
  ;; makes it very easy to copy bits and pieces from the same and other
  ;; files into the current text.  To enable and cancel the global mark,
  ;; use [S-C-space].  The cursor will blink when the global mark
  ;; is active.  The following commands behave differently when the global
  ;; mark is set:
! ;; <ch>  All characters (including newlines) you type are inserted 
  ;;       at the global mark!
  ;; [C-x] If you cut a region or rectangle, it is automatically inserted
  ;;       at the global mark, and the global mark is advanced.
--- 222,235 ----
  ;; are lost, but can be recovered using [C-z].
  
  ;; CUA Global Mark
! ;; ---------------
  ;; The final feature provided by CUA is the "global mark", which
  ;; makes it very easy to copy bits and pieces from the same and other
  ;; files into the current text.  To enable and cancel the global mark,
  ;; use [S-C-space].  The cursor will blink when the global mark
  ;; is active.  The following commands behave differently when the global
  ;; mark is set:
! ;; <ch>  All characters (including newlines) you type are inserted
  ;;       at the global mark!
  ;; [C-x] If you cut a region or rectangle, it is automatically inserted
  ;;       at the global mark, and the global mark is advanced.
***************
*** 289,295 ****
  'shift, these keys are only enabled if the last region was marked with
  a shifted movement key.  If the value is nil, these keys are never
  enabled."
!   :type '(choice (const :tag "Disabled" nil) 
                 (const :tag "Shift region only" shift)
                 (other :tag "Enabled" t))
    :group 'cua)
--- 289,295 ----
  'shift, these keys are only enabled if the last region was marked with
  a shifted movement key.  If the value is nil, these keys are never
  enabled."
!   :type '(choice (const :tag "Disabled" nil)
                 (const :tag "Shift region only" shift)
                 (other :tag "Enabled" t))
    :group 'cua)
***************
*** 303,309 ****
    :type 'boolean
    :group 'cua)
  
! (defcustom cua-prefix-override-inhibit-delay 
    (if (featurep 'lisp-float-type) (/ (float 1) (float 5)) nil)
    "*If non-nil, time in seconds to delay before overriding prefix key.
  If there is additional input within this time, the prefix key is
--- 303,309 ----
    :type 'boolean
    :group 'cua)
  
! (defcustom cua-prefix-override-inhibit-delay
    (if (featurep 'lisp-float-type) (/ (float 1) (float 5)) nil)
    "*If non-nil, time in seconds to delay before overriding prefix key.
  If there is additional input within this time, the prefix key is
***************
*** 325,336 ****
  (defcustom cua-enable-register-prefix 'not-ctrl-u
    "*If non-nil, registers are supported via numeric prefix arg.
  If the value is t, any numeric prefix arg in the range 0 to 9 will be
! interpreted as a register number. 
  If the value is not-ctrl-u, using C-u to enter a numeric prefix is not
! interpreted as a register number. 
  If the value is ctrl-u-only, only numeric prefix entered with C-u is
  interpreted as a register number."
!   :type '(choice (const :tag "Disabled" nil) 
                 (const :tag "Enabled, but C-u arg is not a register" 
not-ctrl-u)
                 (const :tag "Enabled, but only for C-u arg" ctrl-u-only)
                 (other :tag "Enabled" t))
--- 325,336 ----
  (defcustom cua-enable-register-prefix 'not-ctrl-u
    "*If non-nil, registers are supported via numeric prefix arg.
  If the value is t, any numeric prefix arg in the range 0 to 9 will be
! interpreted as a register number.
  If the value is not-ctrl-u, using C-u to enter a numeric prefix is not
! interpreted as a register number.
  If the value is ctrl-u-only, only numeric prefix entered with C-u is
  interpreted as a register number."
!   :type '(choice (const :tag "Disabled" nil)
                 (const :tag "Enabled, but C-u arg is not a register" 
not-ctrl-u)
                 (const :tag "Enabled, but only for C-u arg" ctrl-u-only)
                 (other :tag "Enabled" t))
***************
*** 404,410 ****
    :type 'boolean
    :group 'cua)
  
! (defface cua-global-mark-face '((((class color)) 
                                    (:foreground "black")
                                  (:background "yellow"))
                                   (t (:bold t)))
--- 404,410 ----
    :type 'boolean
    :group 'cua)
  
! (defface cua-global-mark-face '((((class color))
                                    (:foreground "black")
                                  (:background "yellow"))
                                   (t (:bold t)))
***************
*** 576,582 ****
           (not (numberp cua-prefix-override-inhibit-delay))
           (<= cua-prefix-override-inhibit-delay 0)
           ;; In state [1], start [T] and change to state [2]
!          (run-with-timer cua-prefix-override-inhibit-delay nil 
                           'cua--prefix-override-timeout)))
      ;; Don't record this command
      (setq this-command last-command)
--- 576,582 ----
           (not (numberp cua-prefix-override-inhibit-delay))
           (<= cua-prefix-override-inhibit-delay 0)
           ;; In state [1], start [T] and change to state [2]
!          (run-with-timer cua-prefix-override-inhibit-delay nil
                           'cua--prefix-override-timeout)))
      ;; Don't record this command
      (setq this-command last-command)
***************
*** 604,610 ****
        (cua-copy-rectangle arg)
      (cua-copy-region arg))
    (let ((keys (this-single-command-keys)))
!     (setq unread-command-events 
          (cons (aref keys (1- (length keys))) unread-command-events))))
  
  (defun cua--prefix-cut-handler (arg)
--- 604,610 ----
        (cua-copy-rectangle arg)
      (cua-copy-region arg))
    (let ((keys (this-single-command-keys)))
!     (setq unread-command-events
          (cons (aref keys (1- (length keys))) unread-command-events))))
  
  (defun cua--prefix-cut-handler (arg)
***************
*** 614,620 ****
        (cua-cut-rectangle arg)
      (cua-cut-region arg))
    (let ((keys (this-single-command-keys)))
!     (setq unread-command-events 
          (cons (aref keys (1- (length keys))) unread-command-events))))
  
  (defun cua--prefix-override-timeout ()
--- 614,620 ----
        (cua-cut-rectangle arg)
      (cua-cut-region arg))
    (let ((keys (this-single-command-keys)))
!     (setq unread-command-events
          (cons (aref keys (1- (length keys))) unread-command-events))))
  
  (defun cua--prefix-override-timeout ()
***************
*** 633,639 ****
    ;; Execute original command
    (setq this-command this-original-command)
    (call-interactively this-command))
!   
  (defun cua--keep-active ()
    (setq mark-active t
        deactivate-mark nil))
--- 633,639 ----
    ;; Execute original command
    (setq this-command this-original-command)
    (call-interactively this-command))
! 
  (defun cua--keep-active ()
    (setq mark-active t
        deactivate-mark nil))
***************
*** 650,662 ****
  (defvar cua--register nil)
  
  (defun cua--prefix-arg (arg)
!   (setq cua--register  
        (and cua-enable-register-prefix
             (integerp arg) (>= arg 0) (< arg 10)
             (let* ((prefix (aref (this-command-keys) 0))
                    (ctrl-u-prefix (and (integerp prefix)
                                        (= prefix ?\C-u))))
!              (cond 
                ((eq cua-enable-register-prefix 'not-ctrl-u)
                 (not ctrl-u-prefix))
                ((eq cua-enable-register-prefix 'ctrl-u-only)
--- 650,662 ----
  (defvar cua--register nil)
  
  (defun cua--prefix-arg (arg)
!   (setq cua--register
        (and cua-enable-register-prefix
             (integerp arg) (>= arg 0) (< arg 10)
             (let* ((prefix (aref (this-command-keys) 0))
                    (ctrl-u-prefix (and (integerp prefix)
                                        (= prefix ?\C-u))))
!              (cond
                ((eq cua-enable-register-prefix 'not-ctrl-u)
                 (not ctrl-u-prefix))
                ((eq cua-enable-register-prefix 'ctrl-u-only)
***************
*** 691,697 ****
      (if cua-delete-copy-to-register-0
        (set-register ?0 cua--last-deleted-region-text))
      (delete-region start end)
!     (setq cua--last-deleted-region-pos 
          (cons (current-buffer)
                (and (consp buffer-undo-list)
                     (car buffer-undo-list))))
--- 691,697 ----
      (if cua-delete-copy-to-register-0
        (set-register ?0 cua--last-deleted-region-text))
      (delete-region start end)
!     (setq cua--last-deleted-region-pos
          (cons (current-buffer)
                (and (consp buffer-undo-list)
                     (car buffer-undo-list))))
***************
*** 861,867 ****
  (defun cua-help-for-region (&optional help)
    "Show region specific help in echo area."
    (interactive)
!   (message 
     (concat (if help "C-?:help " "")
           "C-z:undo C-x:cut C-c:copy C-v:paste S-ret:rect")))
  
--- 861,867 ----
  (defun cua-help-for-region (&optional help)
    "Show region specific help in echo area."
    (interactive)
!   (message
     (concat (if help "C-?:help " "")
           "C-z:undo C-x:cut C-c:copy C-v:paste S-ret:rect")))
  
***************
*** 959,965 ****
              (unless mark-active
                (push-mark-command nil nil)))
             (t
!             ;; If we set mark-active to nil here, the region highlight will 
not be 
              ;; removed by the direct_output_ commands.
              (setq deactivate-mark t)))
  
--- 959,965 ----
              (unless mark-active
                (push-mark-command nil nil)))
             (t
!             ;; If we set mark-active to nil here, the region highlight will 
not be
              ;; removed by the direct_output_ commands.
              (setq deactivate-mark t)))
  
***************
*** 969,975 ****
                             (get this-command 'pending-delete)))
                     (nc (cond
                          ((not ds) nil)
!                         ((eq ds 'yank) 
                           'cua-paste)
                          ((eq ds 'kill)
                           (if cua--rectangle
--- 969,975 ----
                             (get this-command 'pending-delete)))
                     (nc (cond
                          ((not ds) nil)
!                         ((eq ds 'yank)
                           'cua-paste)
                          ((eq ds 'kill)
                           (if cua--rectangle
***************
*** 986,994 ****
                (if nc
                    (setq this-original-command this-command
                          this-command nc)))))
!         
        ;; Detect extension of rectangles by mouse or other movement
!       (setq cua--buffer-and-point-before-command 
              (if cua--rectangle (cons (current-buffer) (point))))
        )
      (error nil)))
--- 986,994 ----
                (if nc
                    (setq this-original-command this-command
                          this-command nc)))))
! 
        ;; Detect extension of rectangles by mouse or other movement
!       (setq cua--buffer-and-point-before-command
              (if cua--rectangle (cons (current-buffer) (point))))
        )
      (error nil)))
***************
*** 1008,1014 ****
  
        ;; Debugging
        (if cua--debug
!           (cond 
             (cua--rectangle (cua--rectangle-assert))
             (mark-active (message "Mark=%d Point=%d Expl=%s"
                                   (mark t) (point) 
cua--explicit-region-start))))
--- 1008,1014 ----
  
        ;; Debugging
        (if cua--debug
!           (cond
             (cua--rectangle (cua--rectangle-assert))
             (mark-active (message "Mark=%d Point=%d Expl=%s"
                                   (mark t) (point) 
cua--explicit-region-start))))
***************
*** 1123,1129 ****
  
    (define-key cua--prefix-override-keymap [(control x)] 
'cua--prefix-override-handler)
    (define-key cua--prefix-override-keymap [(control c)] 
'cua--prefix-override-handler)
!   
    (define-key cua--prefix-repeat-keymap [(control x) (control x)] 
'cua--prefix-repeat-handler)
    (define-key cua--prefix-repeat-keymap [(control x) up]    
'cua--prefix-cut-handler)
    (define-key cua--prefix-repeat-keymap [(control x) down]  
'cua--prefix-cut-handler)
--- 1123,1129 ----
  
    (define-key cua--prefix-override-keymap [(control x)] 
'cua--prefix-override-handler)
    (define-key cua--prefix-override-keymap [(control c)] 
'cua--prefix-override-handler)
! 
    (define-key cua--prefix-repeat-keymap [(control x) (control x)] 
'cua--prefix-repeat-handler)
    (define-key cua--prefix-repeat-keymap [(control x) up]    
'cua--prefix-cut-handler)
    (define-key cua--prefix-repeat-keymap [(control x) down]  
'cua--prefix-cut-handler)
***************
*** 1135,1141 ****
    (define-key cua--prefix-repeat-keymap [(control c) left]  
'cua--prefix-copy-handler)
    (define-key cua--prefix-repeat-keymap [(control c) right] 
'cua--prefix-copy-handler)
  
!   ;; Enable shifted fallbacks for C-x and C-c when region is active 
    (define-key cua--region-keymap [(shift control x)] 'Control-X-prefix)
    (define-key cua--region-keymap [(shift control c)] 
'mode-specific-command-prefix)
    ;; replace current region
--- 1135,1141 ----
    (define-key cua--prefix-repeat-keymap [(control c) left]  
'cua--prefix-copy-handler)
    (define-key cua--prefix-repeat-keymap [(control c) right] 
'cua--prefix-copy-handler)
  
!   ;; Enable shifted fallbacks for C-x and C-c when region is active
    (define-key cua--region-keymap [(shift control x)] 'Control-X-prefix)
    (define-key cua--region-keymap [(shift control c)] 
'mode-specific-command-prefix)
    ;; replace current region




reply via email to

[Prev in Thread] Current Thread [Next in Thread]