changeset 1169:a40b54fcb2ff

*** empty log message ***
author Richard M. Stallman <rms@gnu.org>
date Sat, 19 Sep 1992 19:21:09 +0000
parents 2b07af77d7ec
children 54a44b2b9591
files lisp/isearch.el
diffstat 1 files changed, 15 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/isearch.el	Sat Sep 19 17:52:29 1992 +0000
+++ b/lisp/isearch.el	Sat Sep 19 19:21:09 1992 +0000
@@ -138,22 +138,8 @@
 (defconst isearch-pre-command-hook-exists (boundp 'pre-command-hook)) ;; lemacs
 (defconst isearch-event-data-type nil)  ;; lemacs
 
-
-;;;=========================================================================
-;;; The following, defined in loaddefs.el, are still used with isearch-mode.
-
-(defvar search-last-string ""
-  "Last string search for by a search command.
-This does not include direct calls to the primitive search functions,
-and does not include searches that are aborted.")
-
-(defvar search-last-regexp ""
-  "Last string searched for by a regexp search command.
-This does not include direct calls to the primitive search functions,
-and does not include searches that are aborted.")
-
 (defconst search-exit-option t
-  "Non-nil means random control characters terminate incremental search.")
+  "*Non-nil means random control characters terminate incremental search.")
 
 (defvar search-slow-window-lines 1
   "*Number of lines in slow search display windows.
@@ -185,8 +171,11 @@
   "*If non-nil, regular expression to match a sequence of whitespace chars.
 You might want to use something like \"[ \\t\\r\\n]+\" instead.")
 
+;; I removed the * from the doc string because highlighting is not 
+;; currently a clean thing to do.  Once highlighting is made clean, 
+;; this feature can be re-enabled and advertised.
 (defvar search-highlight nil
-  "*Whether isearch and query-replace should highlight the text which 
+  "Whether isearch and query-replace should highlight the text which 
 currently matches the search-string.")
 
 
@@ -592,16 +581,16 @@
   (if (> (length isearch-string) 0)
       ;; Update the ring data.
       (if isearch-regexp 
-	  (if (and regexp-search-ring
-		   (not (string= isearch-string (car regexp-search-ring))))
+	  (if (or (null regexp-search-ring)
+		  (not (string= isearch-string (car regexp-search-ring))))
 	      (progn
 		(setq regexp-search-ring
 		      (cons isearch-string regexp-search-ring))
 		(if (> (length regexp-search-ring) regexp-search-ring-max)
 		    (setcdr (nthcdr (1- search-ring-max) regexp-search-ring)
 			    nil))))
-	(if (and search-ring
-		 (not (string= isearch-string (car search-ring))))
+	(if (or (null search-ring)
+		(not (string= isearch-string (car search-ring))))
 	    (progn
 	      (setq search-ring (cons isearch-string search-ring))
 	      (if (> (length search-ring) search-ring-max)
@@ -757,12 +746,12 @@
 
 	;; Empty isearch-string means use default.
 	(if (= 0 (length isearch-string))
-	    (setq isearch-string (if isearch-regexp search-last-regexp
-				   search-last-string))
-	  ;; Set last search string now so it is set even if we fail.
-	  (if search-last-regexp
-	      (setq search-last-regexp isearch-string)
-	    (setq search-last-string isearch-string)))
+	    (setq isearch-string (car (if isearch-regexp regexp-search-ring
+					search-ring)))
+	  ;; This used to set the last search string,
+	  ;; but I think it is not right to do that here.
+	  ;; Only the string actually used should be saved.
+	  )
 
 	;; Reinvoke the pending search.
 	(isearch-push-state)