diff options
author | Michael Kifer <kifer@cs.stonybrook.edu> | 2000-04-07 16:10:04 +0000 |
---|---|---|
committer | Michael Kifer <kifer@cs.stonybrook.edu> | 2000-04-07 16:10:04 +0000 |
commit | 00420437e218e7e1ae983d34e6a39a72fdc61491 (patch) | |
tree | aaaf967a41e10cee1081161374e6f59aa177eaac /lisp/emulation | |
parent | d6144c63b9453a45baf2668878a7c4cafeb727cd (diff) | |
download | emacs-00420437e218e7e1ae983d34e6a39a72fdc61491.tar.gz |
2000-04-07 Mikio Nakajima <minakaji@osaka.email.ne.jp>
* viper-util.el (viper-put-on-search-overlay): New subroutine.
(viper-flash-search-pattern): No operation when using Emacs
doesn't support face.
Use `viper-put-on-search-overlay'.
Diffstat (limited to 'lisp/emulation')
-rw-r--r-- | lisp/emulation/viper-ex.el | 14 | ||||
-rw-r--r-- | lisp/emulation/viper-util.el | 34 |
2 files changed, 32 insertions, 16 deletions
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. " (progn (while (and (not (eolp)) (re-search-forward pat eol-mark t)) - (if (or (not opt-c) (y-or-n-p "Replace? ")) + (if (or (not opt-c) + (progn + (viper-put-on-search-overlay (match-beginning 0) + (match-end 0)) + (y-or-n-p "Replace? "))) (progn + (viper-hide-search-overlay) (setq matched-pos (point)) (if (not (stringp repl)) (error "Can't perform Ex substitution: No previous replacement pattern")) @@ -1968,8 +1973,13 @@ Please contact your system administrator. " (error "Can't repeat Ex substitution: No previous regular expression")) (if (and (re-search-forward pat eol-mark t) - (or (not opt-c) (y-or-n-p "Replace? "))) + (or (not opt-c) + (progn + (viper-put-on-search-overlay (match-beginning 0) + (match-end 0)) + (y-or-n-p "Replace? ")))) (progn + (viper-hide-search-overlay) (setq matched-pos (point)) (if (not (stringp repl)) (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 @@ ;;; Overlays +(defun viper-put-on-search-overlay (beg end) + (if (viper-overlay-p viper-search-overlay) + (viper-move-overlay viper-search-overlay beg end) + (setq viper-search-overlay (viper-make-overlay beg end (current-buffer))) + (viper-overlay-put + viper-search-overlay 'priority viper-search-overlay-priority)) + (viper-overlay-put viper-search-overlay 'face viper-search-face)) ;; Search (defun viper-flash-search-pattern () - (if (viper-overlay-p viper-search-overlay) - (viper-move-overlay - viper-search-overlay (match-beginning 0) (match-end 0)) - (setq viper-search-overlay - (viper-make-overlay - (match-beginning 0) (match-end 0) (current-buffer)))) - - (viper-overlay-put - viper-search-overlay 'priority viper-search-overlay-priority) - (if (viper-has-face-support-p) + (if (not (viper-has-face-support-p)) + nil + (viper-put-on-search-overlay (match-beginning 0) (match-end 0)) + (sit-for 2) + (viper-overlay-put viper-search-overlay 'face nil))) + +(defun viper-hide-search-overlay () + (if (not (viper-overlay-p viper-search-overlay)) (progn - (viper-overlay-put viper-search-overlay 'face viper-search-face) - (sit-for 2) - (viper-overlay-put viper-search-overlay 'face nil)))) - + (setq viper-search-overlay + (viper-make-overlay beg end (current-buffer))) + (viper-overlay-put + viper-search-overlay 'priority viper-search-overlay-priority))) + (viper-overlay-put viper-search-overlay 'face nil)) ;; Replace state |