changeset 28510:6fb7a3864791

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'.
author Michael Kifer <kifer@cs.stonybrook.edu>
date Fri, 07 Apr 2000 16:10:04 +0000
parents 022a7fd54bfe
children 7a9707590ccd
files lisp/ChangeLog lisp/emulation/viper-ex.el lisp/emulation/viper-util.el man/viper.texi
diffstat 4 files changed, 52 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Apr 05 18:53:39 2000 +0000
+++ b/lisp/ChangeLog	Fri Apr 07 16:10:04 2000 +0000
@@ -1,3 +1,10 @@
+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'.
+	
 2000-04-04  Gerd Moellmann  <gerd@gnu.org>
 
 	* isearch.el (isearch-mode-map): Define M-C-s like C-s and M-C-r
--- a/lisp/emulation/viper-ex.el	Wed Apr 05 18:53:39 2000 +0000
+++ b/lisp/emulation/viper-ex.el	Fri Apr 07 16:10:04 2000 +0000
@@ -1956,8 +1956,13 @@
 		(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 @@
 		  (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"))
--- a/lisp/emulation/viper-util.el	Wed Apr 05 18:53:39 2000 +0000
+++ b/lisp/emulation/viper-util.el	Fri Apr 07 16:10:04 2000 +0000
@@ -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
 
--- a/man/viper.texi	Wed Apr 05 18:53:39 2000 +0000
+++ b/man/viper.texi	Fri Apr 07 16:10:04 2000 +0000
@@ -1739,6 +1739,19 @@
 
 Setting this variable too high may slow down your typing.  Setting it too
 low may make it hard to type macros quickly enough.
+@item viper-translate-all-ESC-keysequences t on tty, nil on windowing display
+Normally, Viper lets Emacs translate only those ESC key sequences that are
+defined in the low-level key-translation-map or function-key-map, such as those
+emitted by the arrow and function keys. Other sequences, e.g., @kbd{\\e/}, are
+treated as @kbd{ESC} command followed by a @kbd{/}. This is good for people
+who type fast and tend to hit other characters right after they hit
+ESC. Other people like Emacs to translate @kbd{ESC} sequences all the time. 
+The default is to translate all sequences only when using a dumb terminal.
+This permits you to use @kbd{ESC} as a meta key in insert mode. For instance,
+hitting @kbd{ESC x} fast would have the effect of typing @kbd{M-x}.
+If your dumb terminal is not so dumb and understands the meta key, then you
+probably will be better off setting this variable to nil. Try and see which
+way suits you best.
 @item viper-ex-style-motion t
 Set this to @code{nil}, if you want @kbd{l,h} to cross
 lines, etc.  @xref{Movement and Markers}, for more info.