Mercurial > emacs
comparison lisp/emulation/cua-gmrk.el @ 49598:0d8b17d428b5
Trailing whitepace deleted.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Tue, 04 Feb 2003 13:24:35 +0000 |
parents | b5885da440b5 |
children | 695cf19ef79e d7ddb3e565de |
comparison
equal
deleted
inserted
replaced
49597:e88404e8f2cf | 49598:0d8b17d428b5 |
---|---|
31 (eval-when-compile | 31 (eval-when-compile |
32 (require 'cua-base) | 32 (require 'cua-base) |
33 (require 'cua-rect) | 33 (require 'cua-rect) |
34 ) | 34 ) |
35 | 35 |
36 ;;; Global Marker | 36 ;;; Global Marker |
37 | 37 |
38 ;; Non-nil when global marker is active. | 38 ;; Non-nil when global marker is active. |
39 (defvar cua--global-mark-active nil) | 39 (defvar cua--global-mark-active nil) |
40 | 40 |
41 ;; Global mark position marker. | 41 ;; Global mark position marker. |
70 (insert " ") | 70 (insert " ") |
71 (backward-char 1)) | 71 (backward-char 1)) |
72 (move-marker cua--global-mark-marker (point)) | 72 (move-marker cua--global-mark-marker (point)) |
73 (if (overlayp cua--global-mark-overlay) | 73 (if (overlayp cua--global-mark-overlay) |
74 (move-overlay cua--global-mark-overlay (point) (1+ (point))) | 74 (move-overlay cua--global-mark-overlay (point) (1+ (point))) |
75 (setq cua--global-mark-overlay | 75 (setq cua--global-mark-overlay |
76 (make-overlay (point) (1+ (point)))) | 76 (make-overlay (point) (1+ (point)))) |
77 (overlay-put cua--global-mark-overlay 'face 'cua-global-mark-face)) | 77 (overlay-put cua--global-mark-overlay 'face 'cua-global-mark-face)) |
78 (if (and cua-global-mark-blink-cursor-interval | 78 (if (and cua-global-mark-blink-cursor-interval |
79 (not cua--orig-blink-cursor-interval)) | 79 (not cua--orig-blink-cursor-interval)) |
80 (setq cua--orig-blink-cursor-interval blink-cursor-interval | 80 (setq cua--orig-blink-cursor-interval blink-cursor-interval |
81 blink-cursor-interval cua-global-mark-blink-cursor-interval)) | 81 blink-cursor-interval cua-global-mark-blink-cursor-interval)) |
82 (setq cua--global-mark-active t) | 82 (setq cua--global-mark-active t) |
83 (if msg | 83 (if msg |
84 (message "Global Mark Set"))) | 84 (message "Global Mark Set"))) |
85 | 85 |
323 (save-excursion | 323 (save-excursion |
324 (goto-char (marker-position cua--global-mark-marker)) | 324 (goto-char (marker-position cua--global-mark-marker)) |
325 (move-to-column col) | 325 (move-to-column col) |
326 (move-marker cua--global-mark-marker (point)) | 326 (move-marker cua--global-mark-marker (point)) |
327 (move-overlay cua--global-mark-overlay (point) (1+ (point)))))))) | 327 (move-overlay cua--global-mark-overlay (point) (1+ (point)))))))) |
328 | 328 |
329 | 329 |
330 (defun cua-cancel-global-mark () | 330 (defun cua-cancel-global-mark () |
331 "Cancel the global mark." | 331 "Cancel the global mark." |
332 (interactive) | 332 (interactive) |
333 (if mark-active | 333 (if mark-active |
344 ;; keep global mark position visible | 344 ;; keep global mark position visible |
345 (sit-for 0) | 345 (sit-for 0) |
346 (if (or (not (eq (current-buffer) (marker-buffer cua--global-mark-marker))) | 346 (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)))) | 347 (not (pos-visible-in-window-p (marker-position cua--global-mark-marker)))) |
348 (let ((w (selected-window)) (p (point)) h) | 348 (let ((w (selected-window)) (p (point)) h) |
349 ;; The following code is an attempt to keep the global mark visible in | 349 ;; The following code is an attempt to keep the global mark visible in |
350 ;; other window -- but it doesn't work. | 350 ;; other window -- but it doesn't work. |
351 (switch-to-buffer-other-window (marker-buffer cua--global-mark-marker) t) | 351 (switch-to-buffer-other-window (marker-buffer cua--global-mark-marker) t) |
352 (goto-char (marker-position cua--global-mark-marker)) | 352 (goto-char (marker-position cua--global-mark-marker)) |
353 (if (not (pos-visible-in-window-p (marker-position cua--global-mark-marker))) | 353 (if (not (pos-visible-in-window-p (marker-position cua--global-mark-marker))) |
354 (recenter (if (> (setq h (- (window-height) 4)) 1) h '(4)))) | 354 (recenter (if (> (setq h (- (window-height) 4)) 1) h '(4)))) |