]> code.delx.au - gnu-emacs/blobdiff - lisp/emulation/cua-gmrk.el
Merged in changes from CVS trunk.
[gnu-emacs] / lisp / emulation / cua-gmrk.el
index a1e9d312bdd51087c9410c7d4a6a68f25765c41b..8280691ae18025376e7d09c7040a3d6e806c5ba9 100644 (file)
@@ -33,7 +33,7 @@
   (require 'cua-rect)
   )
 
-;;; Global Marker 
+;;; Global Marker
 
 ;; Non-nil when global marker is active.
 (defvar cua--global-mark-active nil)
   (move-marker cua--global-mark-marker (point))
   (if (overlayp cua--global-mark-overlay)
       (move-overlay cua--global-mark-overlay (point) (1+ (point)))
-    (setq cua--global-mark-overlay 
+    (setq cua--global-mark-overlay
          (make-overlay (point) (1+ (point))))
     (overlay-put cua--global-mark-overlay 'face 'cua-global-mark-face))
   (if (and cua-global-mark-blink-cursor-interval
           (not cua--orig-blink-cursor-interval))
-      (setq cua--orig-blink-cursor-interval blink-cursor-interval 
+      (setq cua--orig-blink-cursor-interval blink-cursor-interval
            blink-cursor-interval cua-global-mark-blink-cursor-interval))
   (setq cua--global-mark-active t)
   (if msg
@@ -325,7 +325,7 @@ With prefix argument, don't jump to global mark when cancelling it."
              (move-to-column col)
              (move-marker cua--global-mark-marker (point))
              (move-overlay cua--global-mark-overlay (point) (1+ (point))))))))
-           
+
 
 (defun cua-cancel-global-mark ()
   "Cancel the global mark."
@@ -346,7 +346,7 @@ With prefix argument, don't jump to global mark when cancelling it."
     (if (or (not (eq (current-buffer) (marker-buffer cua--global-mark-marker)))
            (not (pos-visible-in-window-p (marker-position cua--global-mark-marker))))
        (let ((w (selected-window)) (p (point)) h)
-         ;; The following code is an attempt to keep the global mark visible in 
+         ;; The following code is an attempt to keep the global mark visible in
          ;; other window -- but it doesn't work.
          (switch-to-buffer-other-window (marker-buffer cua--global-mark-marker) t)
          (goto-char (marker-position cua--global-mark-marker))
@@ -377,6 +377,11 @@ With prefix argument, don't jump to global mark when cancelling it."
   (define-key cua--global-mark-keymap [remap backward-delete-char-untabify] 'cua-delete-backward-char-at-global-mark)
   (define-key cua--global-mark-keymap [remap self-insert-command]      'cua-insert-char-at-global-mark)
   (define-key cua--global-mark-keymap [remap self-insert-iso]          'cua-insert-char-at-global-mark)
+
+  ;; Catch self-inserting characters which are "stolen" by other modes
+  (define-key cua--global-mark-keymap [t]
+    '(menu-item "sic" cua-insert-char-at-global-mark :filter cua--self-insert-char-p))
+
   (define-key cua--global-mark-keymap [remap newline]                  'cua-insert-newline-at-global-mark)
   (define-key cua--global-mark-keymap [remap newline-and-indent]       'cua-insert-newline-at-global-mark)
   (define-key cua--global-mark-keymap "\r"                             'cua-insert-newline-at-global-mark)
@@ -385,4 +390,5 @@ With prefix argument, don't jump to global mark when cancelling it."
 
   (setq cua--global-mark-initialized t))
 
+;;; arch-tag: 553d8076-a91d-48ae-825d-6cb962a5f67f
 ;;; cua-gmrk.el ends here