]> code.delx.au - gnu-emacs/blobdiff - lisp/icomplete.el
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-257
[gnu-emacs] / lisp / icomplete.el
index 9e9662c16977f9d9a960a21eb87b5a17d5648867..f53ef7c91d17c93dac17a25fd88a541f8d8f59e5 100644 (file)
@@ -1,7 +1,7 @@
 ;;; icomplete.el --- minibuffer completion incremental feedback
 
-;; Copyright (C) 1992, 1993, 1994, 1997, 1999, 2001, 2005
-;;   Free Software Foundation, Inc.
+;; Copyright (C) 1992, 1993, 1994, 1997, 1999, 2001, 2002, 2003,
+;;   2004, 2005, 2006 Free Software Foundation, Inc.
 
 ;; Author: Ken Manheimer <klm@i.am>
 ;; Maintainer: Ken Manheimer <klm@i.am>
@@ -146,7 +146,7 @@ is minibuffer."
   (if (commandp func-name)
     (save-excursion
       (let* ((sym (intern func-name))
-            (buf (other-buffer))
+            (buf (other-buffer nil t))
             (map (save-excursion (set-buffer buf) (current-local-map)))
             (keys (where-is-internal sym map)))
        (if keys
@@ -243,13 +243,15 @@ and `minibuffer-setup-hook'."
                ;; embarking on computing completions:
                (sit-for icomplete-compute-delay)))
          (let ((text (while-no-input
-                       (icomplete-completions
-                        (field-string)
-                        minibuffer-completion-table
-                        minibuffer-completion-predicate
-                        (not minibuffer-completion-confirm))))
+                       (list
+                        (icomplete-completions
+                         (field-string)
+                         minibuffer-completion-table
+                         minibuffer-completion-predicate
+                         (not minibuffer-completion-confirm)))))
                (buffer-undo-list t))
-           (if text (insert text)))))))
+           ;; Do nothing if while-no-input was aborted.
+           (if (consp text) (insert (car text))))))))
 
 ;;;_ > icomplete-completions (name candidates predicate require-match)
 (defun icomplete-completions (name candidates predicate require-match)
@@ -323,7 +325,7 @@ are exhibited within the square braces.)"
 
 ;;;_* Local emacs vars.
 ;;;Local variables:
-;;;outline-layout: (-2 :)
+;;;allout-layout: (-2 :)
 ;;;End:
 
 ;; arch-tag: 339ec25a-0741-4eb6-be63-997532e89b0f