33 |
(require 'cua-rect) |
(require 'cua-rect) |
34 |
) |
) |
35 |
|
|
36 |
;;; Global Marker |
;;; Global Marker |
37 |
|
|
38 |
;; Non-nil when global marker is active. |
;; Non-nil when global marker is active. |
39 |
(defvar cua--global-mark-active nil) |
(defvar cua--global-mark-active nil) |
72 |
(move-marker cua--global-mark-marker (point)) |
(move-marker cua--global-mark-marker (point)) |
73 |
(if (overlayp cua--global-mark-overlay) |
(if (overlayp cua--global-mark-overlay) |
74 |
(move-overlay cua--global-mark-overlay (point) (1+ (point))) |
(move-overlay cua--global-mark-overlay (point) (1+ (point))) |
75 |
(setq cua--global-mark-overlay |
(setq cua--global-mark-overlay |
76 |
(make-overlay (point) (1+ (point)))) |
(make-overlay (point) (1+ (point)))) |
77 |
(overlay-put cua--global-mark-overlay 'face 'cua-global-mark-face)) |
(overlay-put cua--global-mark-overlay 'face 'cua-global-mark-face)) |
78 |
(if (and cua-global-mark-blink-cursor-interval |
(if (and cua-global-mark-blink-cursor-interval |
79 |
(not cua--orig-blink-cursor-interval)) |
(not cua--orig-blink-cursor-interval)) |
80 |
(setq cua--orig-blink-cursor-interval blink-cursor-interval |
(setq cua--orig-blink-cursor-interval blink-cursor-interval |
81 |
blink-cursor-interval cua-global-mark-blink-cursor-interval)) |
blink-cursor-interval cua-global-mark-blink-cursor-interval)) |
82 |
(setq cua--global-mark-active t) |
(setq cua--global-mark-active t) |
83 |
(if msg |
(if msg |
325 |
(move-to-column col) |
(move-to-column col) |
326 |
(move-marker cua--global-mark-marker (point)) |
(move-marker cua--global-mark-marker (point)) |
327 |
(move-overlay cua--global-mark-overlay (point) (1+ (point)))))))) |
(move-overlay cua--global-mark-overlay (point) (1+ (point)))))))) |
328 |
|
|
329 |
|
|
330 |
(defun cua-cancel-global-mark () |
(defun cua-cancel-global-mark () |
331 |
"Cancel the global mark." |
"Cancel the global mark." |
346 |
(if (or (not (eq (current-buffer) (marker-buffer cua--global-mark-marker))) |
(if (or (not (eq (current-buffer) (marker-buffer cua--global-mark-marker))) |
347 |
(not (pos-visible-in-window-p (marker-position cua--global-mark-marker)))) |
(not (pos-visible-in-window-p (marker-position cua--global-mark-marker)))) |
348 |
(let ((w (selected-window)) (p (point)) h) |
(let ((w (selected-window)) (p (point)) h) |
349 |
;; 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 |
350 |
;; other window -- but it doesn't work. |
;; other window -- but it doesn't work. |
351 |
(switch-to-buffer-other-window (marker-buffer cua--global-mark-marker) t) |
(switch-to-buffer-other-window (marker-buffer cua--global-mark-marker) t) |
352 |
(goto-char (marker-position cua--global-mark-marker)) |
(goto-char (marker-position cua--global-mark-marker)) |