aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kifer2000-04-07 16:10:04 +0000
committerMichael Kifer2000-04-07 16:10:04 +0000
commitd35bee0ea6fd4db8a1ff830a34d64b4ffc87ccb4 (patch)
treedeca25f42677671610517d7d62bcef3a3d91b001
parentc0333abccb3e0997fad7d6a62bc317a49fbf6d07 (diff)
downloademacs-d35bee0ea6fd4db8a1ff830a34d64b4ffc87ccb4.tar.gz
emacs-d35bee0ea6fd4db8a1ff830a34d64b4ffc87ccb4.zip
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'.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/emulation/viper-ex.el14
-rw-r--r--lisp/emulation/viper-util.el34
-rw-r--r--man/viper.texi13
4 files changed, 52 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 @@
12000-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
12000-04-04 Gerd Moellmann <gerd@gnu.org> 82000-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
diff --git a/man/viper.texi b/man/viper.texi
index 273382ec71c..655a8c5983b 100644
--- a/man/viper.texi
+++ b/man/viper.texi
@@ -1739,6 +1739,19 @@ executed. Otherwise, it is processed as an ordinary sequence of typed keys.
1739 1739
1740Setting this variable too high may slow down your typing. Setting it too 1740Setting this variable too high may slow down your typing. Setting it too
1741low may make it hard to type macros quickly enough. 1741low may make it hard to type macros quickly enough.
1742@item viper-translate-all-ESC-keysequences t on tty, nil on windowing display
1743Normally, Viper lets Emacs translate only those ESC key sequences that are
1744defined in the low-level key-translation-map or function-key-map, such as those
1745emitted by the arrow and function keys. Other sequences, e.g., @kbd{\\e/}, are
1746treated as @kbd{ESC} command followed by a @kbd{/}. This is good for people
1747who type fast and tend to hit other characters right after they hit
1748ESC. Other people like Emacs to translate @kbd{ESC} sequences all the time.
1749The default is to translate all sequences only when using a dumb terminal.
1750This permits you to use @kbd{ESC} as a meta key in insert mode. For instance,
1751hitting @kbd{ESC x} fast would have the effect of typing @kbd{M-x}.
1752If your dumb terminal is not so dumb and understands the meta key, then you
1753probably will be better off setting this variable to nil. Try and see which
1754way suits you best.
1742@item viper-ex-style-motion t 1755@item viper-ex-style-motion t
1743Set this to @code{nil}, if you want @kbd{l,h} to cross 1756Set this to @code{nil}, if you want @kbd{l,h} to cross
1744lines, etc. @xref{Movement and Markers}, for more info. 1757lines, etc. @xref{Movement and Markers}, for more info.