# HG changeset patch # User Dan Nicolaescu # Date 1146692180 0 # Node ID f98b5ff9f3cee7c9f4958357afbe363c61520241 # Parent 8e55901472d649c35ce2f012e7e6382e262c6343 (isearch-update-ring): Take history-delete-duplicates into consideration. Replace one arm ifs with whens. diff -r 8e55901472d6 -r f98b5ff9f3ce lisp/ChangeLog --- a/lisp/ChangeLog Wed May 03 00:17:35 2006 +0000 +++ b/lisp/ChangeLog Wed May 03 21:36:20 2006 +0000 @@ -1,3 +1,8 @@ +2006-05-03 Dan Nicolaescu + + * isearch.el (isearch-update-ring): Take history-delete-duplicates + into consideration. Replace one arm ifs with whens. + 2006-05-03 Nick Roberts * progmodes/gdb-ui.el (gud-watch): Let user select an expression. diff -r 8e55901472d6 -r f98b5ff9f3ce lisp/isearch.el --- a/lisp/isearch.el Wed May 03 00:17:35 2006 +0000 +++ b/lisp/isearch.el Wed May 03 21:36:20 2006 +0000 @@ -832,19 +832,20 @@ "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)))))) + (when (or (null regexp-search-ring) + (not (string= string (car regexp-search-ring)))) + (when history-delete-duplicates + (setq regexp-search-ring (delete string regexp-search-ring))) + (push string regexp-search-ring) + (when (> (length regexp-search-ring) regexp-search-ring-max) + (setcdr (nthcdr (1- search-ring-max) regexp-search-ring) nil))) + (when (or (null search-ring) + (not (string= string (car search-ring)))) + (when history-delete-duplicates + (setq search-ring (delete string search-ring))) + (push string search-ring) + (when (> (length search-ring) search-ring-max) + (setcdr (nthcdr (1- search-ring-max) search-ring) nil))))) ;; Switching buffers should first terminate isearch-mode. ;; ;; For Emacs 19, the frame switch event is handled.