diff options
author | Karoly Lorentey <lorentey@elte.hu> | 2006-05-05 10:30:28 +0000 |
---|---|---|
committer | Karoly Lorentey <lorentey@elte.hu> | 2006-05-05 10:30:28 +0000 |
commit | ccaa691f6c297164c6206bb40691848f5c24099b (patch) | |
tree | d3cc39272ff8041ce0e7ba688537dca08afa0e7d /lisp/isearch.el | |
parent | 1c26df5682cf8ba62f0c303da1f296a7e85d0551 (diff) | |
parent | af30c609d642c73e1368593efd1220a579c5e9d2 (diff) | |
download | emacs-ccaa691f6c297164c6206bb40691848f5c24099b.tar.gz |
Merged from emacs@sv.gnu.org
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-263
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-264
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-265
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/gnus--rel--5.10--patch-99
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-100
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-555
Diffstat (limited to 'lisp/isearch.el')
-rw-r--r-- | lisp/isearch.el | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el index 13b54a02467..78b523f3845 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -830,21 +830,22 @@ NOPUSH is t and EDIT is t." (defun isearch-update-ring (string &optional regexp) "Add STRING to the beginning of the search ring. -REGEXP says which ring to use." +REGEXP if non-nil says use the regexp search ring." (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. |