Mercurial > emacs
comparison lisp/view.el @ 13167:c378e215f4d0
(view-highlight-face): New variable.
(view-search): Use that variable.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 09 Oct 1995 19:42:19 +0000 |
parents | 02b3310fc081 |
children | aa2fb1aa0c94 |
comparison
equal
deleted
inserted
replaced
13166:c61ffdb6d9df | 13167:c378e215f4d0 |
---|---|
25 | 25 |
26 ;; This package provides the `view' minor mode documented in the Emacs | 26 ;; This package provides the `view' minor mode documented in the Emacs |
27 ;; user's manual. | 27 ;; user's manual. |
28 | 28 |
29 ;;; Code: | 29 ;;; Code: |
30 | |
31 ;;;###autoload | |
32 (defvar view-highlight-face 'highlight | |
33 "*The overlay face used for highlighting the match found by View mode search.") | |
30 | 34 |
31 (defvar view-mode nil "Non-nil if View mode is enabled.") | 35 (defvar view-mode nil "Non-nil if View mode is enabled.") |
32 (make-variable-buffer-local 'view-mode) | 36 (make-variable-buffer-local 'view-mode) |
33 | 37 |
34 (defvar view-mode-auto-exit nil | 38 (defvar view-mode-auto-exit nil |
52 (make-variable-buffer-local 'view-return-here) | 56 (make-variable-buffer-local 'view-return-here) |
53 (defvar view-exit-position nil) | 57 (defvar view-exit-position nil) |
54 (make-variable-buffer-local 'view-exit-position) | 58 (make-variable-buffer-local 'view-exit-position) |
55 | 59 |
56 (defvar view-overlay nil | 60 (defvar view-overlay nil |
57 "Overlay used to display where a search operation found its match.") | 61 "Overlay used to display where a search operation found its match. |
62 This is local in each buffer, once it is used.") | |
58 (make-variable-buffer-local 'view-overlay) | 63 (make-variable-buffer-local 'view-overlay) |
59 | 64 |
60 (or (assq 'view-mode minor-mode-alist) | 65 (or (assq 'view-mode minor-mode-alist) |
61 (setq minor-mode-alist | 66 (setq minor-mode-alist |
62 (cons '(view-mode " View") minor-mode-alist))) | 67 (cons '(view-mode " View") minor-mode-alist))) |
423 (goto-char where) | 428 (goto-char where) |
424 (if view-overlay | 429 (if view-overlay |
425 (move-overlay view-overlay (match-beginning 0) (match-end 0)) | 430 (move-overlay view-overlay (match-beginning 0) (match-end 0)) |
426 (setq view-overlay | 431 (setq view-overlay |
427 (make-overlay (match-beginning 0) (match-end 0)))) | 432 (make-overlay (match-beginning 0) (match-end 0)))) |
428 (overlay-put view-overlay 'face 'highlight) | 433 (overlay-put view-overlay 'face view-highlight-face) |
429 (beginning-of-line) | 434 (beginning-of-line) |
430 (recenter (/ (view-window-size) 2))) | 435 (recenter (/ (view-window-size) 2))) |
431 (message "Can't find occurrence %d of %s" times regexp) | 436 (message "Can't find occurrence %d of %s" times regexp) |
432 (sit-for 4)))) | 437 (sit-for 4)))) |
433 | 438 |