diff lisp/isearch.el @ 90389:146cd8369025

Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-60 Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 259-273) - Update from CVS - lisp/replace.el (occur-engine): Bind `inhibit-field-text-motion' to t - Merge from gnus--rel--5.10 - Rename "field-at-point" to "field-at-pos" - (comint-insert-input): Remove redundant calls to setq and goto-char * gnus--rel--5.10 (patch 99-100) - Merge from emacs--devo--0 - Update from CVS
author Miles Bader <miles@gnu.org>
date Wed, 10 May 2006 20:42:41 +0000
parents e3bacb89536a 4e1a43edc7bc
children 8a8e69664178
line wrap: on
line diff
--- a/lisp/isearch.el	Tue May 02 08:50:29 2006 +0000
+++ b/lisp/isearch.el	Wed May 10 20:42:41 2006 +0000
@@ -826,21 +826,11 @@
 
 (defun isearch-update-ring (string &optional regexp)
   "Add STRING to the beginning of the search ring.
-REGEXP says which ring to use."
-  (if regexp
-      (if (or (null regexp-search-ring)
-	      (not (string= string (car regexp-search-ring))))
-	  (progn
-	    (push string regexp-search-ring)
-	    (if (> (length regexp-search-ring) regexp-search-ring-max)
-		(setcdr (nthcdr (1- search-ring-max) regexp-search-ring)
-			nil))))
-    (if (or (null search-ring)
-	    (not (string= string (car search-ring))))
-	(progn
-	  (push string search-ring)
-	  (if (> (length search-ring) search-ring-max)
-	      (setcdr (nthcdr (1- search-ring-max) search-ring) nil))))))
+REGEXP if non-nil says use the regexp search ring."
+  (add-to-history
+   (if regexp 'regexp-search-ring 'search-ring)
+   string
+   (if regexp regexp-search-ring-max search-ring-max)))
 
 ;; Switching buffers should first terminate isearch-mode.
 ;; ;; For Emacs 19, the frame switch event is handled.