summaryrefslogtreecommitdiff
path: root/lisp/isearch.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2003-04-29 20:38:53 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2003-04-29 20:38:53 +0000
commitc789e60809a05bfc08c2e87313aa2ccffb167b49 (patch)
tree4c4745bce7b114b7484d16b222adba58d60bb952 /lisp/isearch.el
parent60f553d271886963447c518e6ded9635c6518975 (diff)
downloademacs-c789e60809a05bfc08c2e87313aa2ccffb167b49.tar.gz
(isearch-complete1): Don't allocate unnecessarily.
(isearch-complete-edit): Adjust to Emacs-21's new minibuffer handling. (isearch-update-ring): Use push.
Diffstat (limited to 'lisp/isearch.el')
-rw-r--r--lisp/isearch.el14
1 files changed, 6 insertions, 8 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el
index af4099d29d8..bb989a73f95 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -1,6 +1,6 @@
;;; isearch.el --- incremental search minor mode
-;; Copyright (C) 1992, 93, 94, 95, 96, 97, 1999, 2000, 2001
+;; Copyright (C) 1992, 93, 94, 95, 96, 97, 1999, 2000, 01, 2003
;; Free Software Foundation, Inc.
;; Author: Daniel LaLiberte <liberte@cs.uiuc.edu>
@@ -738,15 +738,14 @@ REGEXP says which ring to use."
(if (or (null regexp-search-ring)
(not (string= string (car regexp-search-ring))))
(progn
- (setq regexp-search-ring
- (cons string regexp-search-ring))
+ (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
- (setq search-ring (cons string search-ring))
+ (push string search-ring)
(if (> (length search-ring) search-ring-max)
(setcdr (nthcdr (1- search-ring-max) search-ring) nil))))))
@@ -1493,9 +1492,8 @@ With prefix arg N, insert the Nth element."
;; Helper for isearch-complete and isearch-complete-edit
;; Return t if completion OK, nil if no completion exists.
(let* ((ring (if isearch-regexp regexp-search-ring search-ring))
- (alist (mapcar (function (lambda (string) (list string))) ring))
(completion-ignore-case case-fold-search)
- (completion (try-completion isearch-string alist)))
+ (completion (try-completion isearch-string ring)))
(cond
((eq completion t)
;; isearch-string stays the same
@@ -1507,7 +1505,7 @@ With prefix arg N, insert the Nth element."
(if completion-auto-help
(with-output-to-temp-buffer "*Isearch completions*"
(display-completion-list
- (all-completions isearch-string alist))))
+ (all-completions isearch-string ring))))
t)
(and completion
(setq isearch-string completion))))
@@ -1529,7 +1527,7 @@ If there is no completion possible, say so and continue searching."
(defun isearch-complete-edit ()
"Same as `isearch-complete' except in the minibuffer."
(interactive)
- (setq isearch-string (buffer-string))
+ (setq isearch-string (field-string))
(if (isearch-complete1)
(progn
(delete-field)