/[emacs]/emacs/lisp/isearch.el
ViewVC logotype

Diff of /emacs/lisp/isearch.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.218 by lektu, Fri Jan 24 17:12:00 2003 UTC revision 1.219 by monnier, Tue Apr 29 20:38:53 2003 UTC
# Line 1  Line 1 
1  ;;; isearch.el --- incremental search minor mode  ;;; isearch.el --- incremental search minor mode
2    
3  ;; Copyright (C) 1992, 93, 94, 95, 96, 97, 1999, 2000, 2001  ;; Copyright (C) 1992, 93, 94, 95, 96, 97, 1999, 2000, 01, 2003
4  ;;   Free Software Foundation, Inc.  ;;   Free Software Foundation, Inc.
5    
6  ;; Author: Daniel LaLiberte <liberte@cs.uiuc.edu>  ;; Author: Daniel LaLiberte <liberte@cs.uiuc.edu>
# Line 738  REGEXP says which ring to use." Line 738  REGEXP says which ring to use."
738        (if (or (null regexp-search-ring)        (if (or (null regexp-search-ring)
739                (not (string= string (car regexp-search-ring))))                (not (string= string (car regexp-search-ring))))
740            (progn            (progn
741              (setq regexp-search-ring              (push string regexp-search-ring)
                   (cons string regexp-search-ring))  
742              (if (> (length regexp-search-ring) regexp-search-ring-max)              (if (> (length regexp-search-ring) regexp-search-ring-max)
743                  (setcdr (nthcdr (1- search-ring-max) regexp-search-ring)                  (setcdr (nthcdr (1- search-ring-max) regexp-search-ring)
744                          nil))))                          nil))))
745      (if (or (null search-ring)      (if (or (null search-ring)
746              (not (string= string (car search-ring))))              (not (string= string (car search-ring))))
747          (progn          (progn
748            (setq search-ring (cons string search-ring))            (push string search-ring)
749            (if (> (length search-ring) search-ring-max)            (if (> (length search-ring) search-ring-max)
750                (setcdr (nthcdr (1- search-ring-max) search-ring) nil))))))                (setcdr (nthcdr (1- search-ring-max) search-ring) nil))))))
751    
# Line 1493  With prefix arg N, insert the Nth elemen Line 1492  With prefix arg N, insert the Nth elemen
1492    ;; Helper for isearch-complete and isearch-complete-edit    ;; Helper for isearch-complete and isearch-complete-edit
1493    ;; Return t if completion OK, nil if no completion exists.    ;; Return t if completion OK, nil if no completion exists.
1494    (let* ((ring (if isearch-regexp regexp-search-ring search-ring))    (let* ((ring (if isearch-regexp regexp-search-ring search-ring))
          (alist (mapcar (function (lambda (string) (list string))) ring))  
1495           (completion-ignore-case case-fold-search)           (completion-ignore-case case-fold-search)
1496           (completion (try-completion isearch-string alist)))           (completion (try-completion isearch-string ring)))
1497      (cond      (cond
1498       ((eq completion t)       ((eq completion t)
1499        ;; isearch-string stays the same        ;; isearch-string stays the same
# Line 1507  With prefix arg N, insert the Nth elemen Line 1505  With prefix arg N, insert the Nth elemen
1505              (if completion-auto-help              (if completion-auto-help
1506                  (with-output-to-temp-buffer "*Isearch completions*"                  (with-output-to-temp-buffer "*Isearch completions*"
1507                    (display-completion-list                    (display-completion-list
1508                     (all-completions isearch-string alist))))                     (all-completions isearch-string ring))))
1509              t)              t)
1510          (and completion          (and completion
1511               (setq isearch-string completion))))               (setq isearch-string completion))))
# Line 1529  If there is no completion possible, say Line 1527  If there is no completion possible, say
1527  (defun isearch-complete-edit ()  (defun isearch-complete-edit ()
1528    "Same as `isearch-complete' except in the minibuffer."    "Same as `isearch-complete' except in the minibuffer."
1529    (interactive)    (interactive)
1530    (setq isearch-string (buffer-string))    (setq isearch-string (field-string))
1531    (if (isearch-complete1)    (if (isearch-complete1)
1532        (progn        (progn
1533          (delete-field)          (delete-field)

Legend:
Removed from v.1.218  
changed lines
  Added in v.1.219

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26