diff options
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/emulation/viper-ex.el | 14 | ||||
| -rw-r--r-- | lisp/emulation/viper-util.el | 34 |
3 files changed, 39 insertions, 16 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cdfe28cbd83..c7ea212af6c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2000-04-07 Mikio Nakajima <minakaji@osaka.email.ne.jp> | ||
| 2 | |||
| 3 | * viper-util.el (viper-put-on-search-overlay): New subroutine. | ||
| 4 | (viper-flash-search-pattern): No operation when using Emacs | ||
| 5 | doesn't support face. | ||
| 6 | Use `viper-put-on-search-overlay'. | ||
| 7 | |||
| 1 | 2000-04-04 Gerd Moellmann <gerd@gnu.org> | 8 | 2000-04-04 Gerd Moellmann <gerd@gnu.org> |
| 2 | 9 | ||
| 3 | * isearch.el (isearch-mode-map): Define M-C-s like C-s and M-C-r | 10 | * isearch.el (isearch-mode-map): Define M-C-s like C-s and M-C-r |
diff --git a/lisp/emulation/viper-ex.el b/lisp/emulation/viper-ex.el index ef57e8ceb95..2a0d40de71e 100644 --- a/lisp/emulation/viper-ex.el +++ b/lisp/emulation/viper-ex.el | |||
| @@ -1956,8 +1956,13 @@ Please contact your system administrator. " | |||
| 1956 | (progn | 1956 | (progn |
| 1957 | (while (and (not (eolp)) | 1957 | (while (and (not (eolp)) |
| 1958 | (re-search-forward pat eol-mark t)) | 1958 | (re-search-forward pat eol-mark t)) |
| 1959 | (if (or (not opt-c) (y-or-n-p "Replace? ")) | 1959 | (if (or (not opt-c) |
| 1960 | (progn | ||
| 1961 | (viper-put-on-search-overlay (match-beginning 0) | ||
| 1962 | (match-end 0)) | ||
| 1963 | (y-or-n-p "Replace? "))) | ||
| 1960 | (progn | 1964 | (progn |
| 1965 | (viper-hide-search-overlay) | ||
| 1961 | (setq matched-pos (point)) | 1966 | (setq matched-pos (point)) |
| 1962 | (if (not (stringp repl)) | 1967 | (if (not (stringp repl)) |
| 1963 | (error "Can't perform Ex substitution: No previous replacement pattern")) | 1968 | (error "Can't perform Ex substitution: No previous replacement pattern")) |
| @@ -1968,8 +1973,13 @@ Please contact your system administrator. " | |||
| 1968 | (error | 1973 | (error |
| 1969 | "Can't repeat Ex substitution: No previous regular expression")) | 1974 | "Can't repeat Ex substitution: No previous regular expression")) |
| 1970 | (if (and (re-search-forward pat eol-mark t) | 1975 | (if (and (re-search-forward pat eol-mark t) |
| 1971 | (or (not opt-c) (y-or-n-p "Replace? "))) | 1976 | (or (not opt-c) |
| 1977 | (progn | ||
| 1978 | (viper-put-on-search-overlay (match-beginning 0) | ||
| 1979 | (match-end 0)) | ||
| 1980 | (y-or-n-p "Replace? ")))) | ||
| 1972 | (progn | 1981 | (progn |
| 1982 | (viper-hide-search-overlay) | ||
| 1973 | (setq matched-pos (point)) | 1983 | (setq matched-pos (point)) |
| 1974 | (if (not (stringp repl)) | 1984 | (if (not (stringp repl)) |
| 1975 | (error "Can't perform Ex substitution: No previous replacement pattern")) | 1985 | (error "Can't perform Ex substitution: No previous replacement pattern")) |
diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el index b384710e1e3..8d7a749d15e 100644 --- a/lisp/emulation/viper-util.el +++ b/lisp/emulation/viper-util.el | |||
| @@ -680,25 +680,31 @@ | |||
| 680 | 680 | ||
| 681 | 681 | ||
| 682 | ;;; Overlays | 682 | ;;; Overlays |
| 683 | (defun viper-put-on-search-overlay (beg end) | ||
| 684 | (if (viper-overlay-p viper-search-overlay) | ||
| 685 | (viper-move-overlay viper-search-overlay beg end) | ||
| 686 | (setq viper-search-overlay (viper-make-overlay beg end (current-buffer))) | ||
| 687 | (viper-overlay-put | ||
| 688 | viper-search-overlay 'priority viper-search-overlay-priority)) | ||
| 689 | (viper-overlay-put viper-search-overlay 'face viper-search-face)) | ||
| 683 | 690 | ||
| 684 | ;; Search | 691 | ;; Search |
| 685 | 692 | ||
| 686 | (defun viper-flash-search-pattern () | 693 | (defun viper-flash-search-pattern () |
| 687 | (if (viper-overlay-p viper-search-overlay) | 694 | (if (not (viper-has-face-support-p)) |
| 688 | (viper-move-overlay | 695 | nil |
| 689 | viper-search-overlay (match-beginning 0) (match-end 0)) | 696 | (viper-put-on-search-overlay (match-beginning 0) (match-end 0)) |
| 690 | (setq viper-search-overlay | 697 | (sit-for 2) |
| 691 | (viper-make-overlay | 698 | (viper-overlay-put viper-search-overlay 'face nil))) |
| 692 | (match-beginning 0) (match-end 0) (current-buffer)))) | 699 | |
| 693 | 700 | (defun viper-hide-search-overlay () | |
| 694 | (viper-overlay-put | 701 | (if (not (viper-overlay-p viper-search-overlay)) |
| 695 | viper-search-overlay 'priority viper-search-overlay-priority) | ||
| 696 | (if (viper-has-face-support-p) | ||
| 697 | (progn | 702 | (progn |
| 698 | (viper-overlay-put viper-search-overlay 'face viper-search-face) | 703 | (setq viper-search-overlay |
| 699 | (sit-for 2) | 704 | (viper-make-overlay beg end (current-buffer))) |
| 700 | (viper-overlay-put viper-search-overlay 'face nil)))) | 705 | (viper-overlay-put |
| 701 | 706 | viper-search-overlay 'priority viper-search-overlay-priority))) | |
| 707 | (viper-overlay-put viper-search-overlay 'face nil)) | ||
| 702 | 708 | ||
| 703 | ;; Replace state | 709 | ;; Replace state |
| 704 | 710 | ||