Mercurial > emacs
diff lisp/emulation/cua-base.el @ 90103:3ebd9bdb4fe5
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-13
Merge from emacs--cvs-trunk--0
Patches applied:
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-83
- miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-89
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-90
Update from CVS: man/calc.texi: Add macro for LaTeX for info output.
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-91
- miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-94
Update from CVS
author | Miles Bader <miles@gnu.org> |
---|---|
date | Sun, 13 Feb 2005 07:19:08 +0000 |
parents | eac554634bfa aac0a33f5772 |
children | 29e773288013 |
line wrap: on
line diff
--- a/lisp/emulation/cua-base.el Sun Feb 13 00:40:20 2005 +0000 +++ b/lisp/emulation/cua-base.el Sun Feb 13 07:19:08 2005 +0000 @@ -1,6 +1,6 @@ ;;; cua-base.el --- emulate CUA key bindings -;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 ;; Free Software Foundation, Inc. ;; Author: Kim F. Storm <storm@cua.dk> @@ -267,7 +267,7 @@ :group 'editing-basics :group 'convenience :group 'emulations - :version "21.4" + :version "22.1" :link '(emacs-commentary-link :tag "Commentary" "cua-base.el") :link '(emacs-library-link :tag "Lisp File" "cua-base.el")) @@ -392,11 +392,6 @@ "*Font used by CUA for highlighting the non-selected rectangle lines." :group 'cua) -(defcustom cua-undo-max 64 - "*Max no of undoable CUA rectangle changes (including undo)." - :type 'integer - :group 'cua) - ;;; Global Mark Customization @@ -739,15 +734,6 @@ (+ arg ?0))) (if cua--register nil arg)) -;;; Enhanced undo - restore rectangle selections - -(defun cua-undo (&optional arg) - "Undo some previous changes. -Knows about CUA rectangle highlighting in addition to standard undo." - (interactive "*P") - (if (fboundp 'cua--rectangle-undo) - (cua--rectangle-undo arg) - (undo arg))) ;;; Region specific commands @@ -988,21 +974,6 @@ (if cua-enable-region-auto-help (cua-help-for-region t))))) -(defvar cua--standard-movement-commands - '(forward-char backward-char - next-line previous-line - forward-word backward-word - end-of-line beginning-of-line - end-of-buffer beginning-of-buffer - scroll-up scroll-down cua-scroll-up cua-scroll-down - forward-sentence backward-sentence - forward-paragraph backward-paragraph) - "List of standard movement commands. -Extra commands should be added to `cua-movement-commands'") - -(defvar cua-movement-commands nil - "User may add additional movement commands to this list.") - ;;; Scrolling commands which does not signal errors at top/bottom ;;; of buffer at first key-press (instead moves to top/bottom ;;; of buffer). @@ -1025,6 +996,8 @@ (scroll-up arg) (end-of-buffer (goto-char (point-max))))))) +(put 'cua-scroll-up 'CUA 'move) + (defun cua-scroll-down (&optional arg) "Scroll text of current window downward ARG lines; or near full screen if no ARG. If window cannot be scrolled further, move cursor to top line instead. @@ -1043,6 +1016,8 @@ (scroll-down arg) (beginning-of-buffer (goto-char (point-min))))))) +(put 'cua-scroll-up 'CUA 'move) + ;;; Cursor indications (defun cua--update-indications () @@ -1073,8 +1048,7 @@ (defun cua--pre-command-handler () (condition-case nil - (let ((movement (or (memq this-command cua--standard-movement-commands) - (memq this-command cua-movement-commands)))) + (let ((movement (eq (get this-command 'CUA) 'move))) ;; Cancel prefix key timeout if user enters another key. (when cua--prefix-override-timer @@ -1251,9 +1225,6 @@ (define-key cua-global-keymap [remap yank-pop] 'cua-paste-pop) ;; set mark (define-key cua-global-keymap [remap set-mark-command] 'cua-set-mark) - ;; undo - (define-key cua-global-keymap [remap undo] 'cua-undo) - (define-key cua-global-keymap [remap advertised-undo] 'cua-undo) ;; scrolling (define-key cua-global-keymap [remap scroll-up] 'cua-scroll-up) @@ -1305,6 +1276,20 @@ (define-key cua--region-keymap [remap keyboard-quit] 'cua-cancel) ) + +;; Setup standard movement commands to be recognized by CUA. + +(dolist (cmd + '(forward-char backward-char + next-line previous-line + forward-word backward-word + end-of-line beginning-of-line + end-of-buffer beginning-of-buffer + scroll-up scroll-down + forward-sentence backward-sentence + forward-paragraph backward-paragraph)) + (put cmd 'CUA 'move)) + ;; State prior to enabling cua-mode ;; Value is a list with the following elements: ;; transient-mark-mode @@ -1350,9 +1335,6 @@ (add-to-list 'emulation-mode-map-alists 'cua--keymap-alist) (cua--select-keymaps)) - (if (fboundp 'cua--rectangle-on-off) - (cua--rectangle-on-off cua-mode)) - (cond (cua-mode (setq cua--saved-state @@ -1389,7 +1371,7 @@ (setq cua--debug (not cua--debug))) ;; Install run-time check for older versions of CUA-mode which does not -;; work with GNU Emacs version 21.4 and newer. +;; work with GNU Emacs version 22.1 and newer. ;; ;; Except for version 1.2, all of the 1.x and 2.x version of cua-mode ;; provided the `CUA-mode' feature. Since this is no longer true,