1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-16 09:50:25 +00:00

(isearch-update-ring): Take history-delete-duplicates

into consideration. Replace one arm ifs with whens.
This commit is contained in:
Dan Nicolaescu 2006-05-03 21:36:20 +00:00
parent 9d6bb9e0af
commit 5719a99df5
2 changed files with 19 additions and 13 deletions

View File

@ -1,3 +1,8 @@
2006-05-03 Dan Nicolaescu <dann@ics.uci.edu>
* isearch.el (isearch-update-ring): Take history-delete-duplicates
into consideration. Replace one arm ifs with whens.
2006-05-03 Nick Roberts <nickrob@snap.net.nz>
* progmodes/gdb-ui.el (gud-watch): Let user select an expression.

View File

@ -832,19 +832,20 @@ NOPUSH is t and EDIT is t."
"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.