]> code.delx.au - gnu-emacs/blobdiff - lisp/emulation/cua-base.el
* cua-base.el, cua-gmrk.el: Fix use of `filter-buffer-substring'.
[gnu-emacs] / lisp / emulation / cua-base.el
index 8a366a25d753018ac9a8185593ba69856b9b49c7..d8b36adf730591f06fb8bb79831546808a2ddf1c 100644 (file)
@@ -1,7 +1,7 @@
 ;;; cua-base.el --- emulate CUA key bindings
 
 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;;   2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 
 ;; Author: Kim F. Storm <storm@cua.dk>
 ;; Keywords: keyboard emulation convenience cua
@@ -1040,7 +1040,9 @@ of text."
                  (setq s (car u) e (cdr u)))))))
          (cond ((and s e (<= s e) (= s (mark t)))
                 (setq cua--repeat-replace-text
-                      (filter-buffer-substring s e nil t)))
+                      (filter-buffer-substring s e))
+                (set-text-properties 0 (length cua--repeat-replace-text)
+                                     nil cua--repeat-replace-text))
                ((and (null s) (eq u elt)) ;; nothing inserted
                 (setq cua--repeat-replace-text
                       ""))
@@ -1196,8 +1198,8 @@ If ARG is the atom `-', scroll upward by nearly full screen."
        (set-cursor-color color))
     (if (and type
             (symbolp type)
-            (not (eq type default-cursor-type)))
-       (setq default-cursor-type type))))
+            (not (eq type (default-value 'cursor-type))))
+       (setq-default cursor-type type))))
 
 
 ;;; Pre-command hook
@@ -1440,6 +1442,8 @@ If ARG is the atom `-', scroll upward by nearly full screen."
   ;; scrolling
   (define-key cua-global-keymap [remap scroll-up]      'cua-scroll-up)
   (define-key cua-global-keymap [remap scroll-down]    'cua-scroll-down)
+  (define-key cua-global-keymap [remap scroll-up-command]   'cua-scroll-up)
+  (define-key cua-global-keymap [remap scroll-down-command] 'cua-scroll-down)
 
   (define-key cua--cua-keys-keymap [(control x) timeout] 'kill-region)
   (define-key cua--cua-keys-keymap [(control c) timeout] 'copy-region-as-kill)
@@ -1495,15 +1499,22 @@ If ARG is the atom `-', scroll upward by nearly full screen."
    next-line previous-line
    forward-word backward-word
    end-of-line beginning-of-line
+   end-of-visual-line beginning-of-visual-line
    move-end-of-line move-beginning-of-line
    end-of-buffer beginning-of-buffer
    scroll-up scroll-down
+   scroll-up-command scroll-down-command
    up-list down-list backward-up-list
    end-of-defun beginning-of-defun
    forward-sexp backward-sexp
    forward-list backward-list
    forward-sentence backward-sentence
-   forward-paragraph backward-paragraph))
+   forward-paragraph backward-paragraph
+   ;; CC mode motion commands
+   c-forward-conditional c-backward-conditional
+   c-down-conditional c-up-conditional
+   c-down-conditional-with-else c-up-conditional-with-else
+   c-beginning-of-statement c-end-of-statement))
   (put cmd 'CUA 'move))
 
 ;; State prior to enabling cua-mode
@@ -1598,7 +1609,7 @@ shifted movement key, set `cua-highlight-region-shift-only'."
     (if (nth 2 cua--saved-state)
        (pc-selection-mode 1))
     (setq shift-select-mode (nth 3 cua--saved-state))
-    (if (interactive-p)
+    (if (called-interactively-p 'interactive)
        (message "CUA mode disabled.%s%s%s%s"
                 (if (nth 1 cua--saved-state) " Delete-Selection" "")
                 (if (and (nth 1 cua--saved-state) (nth 2 cua--saved-state)) " and" "")