]> code.delx.au - gnu-emacs/blobdiff - lisp/icomplete.el
Delete the hilit19 support--it doesn't work.
[gnu-emacs] / lisp / icomplete.el
index e7d53a1f8a57f6b45a9f96183b56d8c65768f82b..f23a9d43fdef9e0d7122ffe7249fdf8a944c8667 100644 (file)
@@ -1,12 +1,11 @@
-;;;_. icomplete.el - minibuffer completion incremental feedback
+;;; icomplete.el --- minibuffer completion incremental feedback
 
-;;; Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
 
-;;; Author: Ken Manheimer <klm@nist.gov>
-;;; Maintainer: Ken Manheimer <klm@nist.gov>
-;;; Version: Id: icomplete.el,v 4.3 1994/08/31 18:48:29 klm Exp 
-;;; Created: Mar 1993 klm@nist.gov - first release to usenet
-;;; Keywords: help, abbrev
+;; Author: Ken Manheimer <klm@nist.gov>
+;; Maintainer: Ken Manheimer <klm@nist.gov>
+;; Created: Mar 1993 klm@nist.gov - first release to usenet
+;; Keywords: help, abbrev
 
 ;; This file is part of GNU Emacs.
 
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 ;;; Commentary:
 
-;;; Loading this package implements a more fine-grained minibuffer
-;;; completion feedback scheme.  Prospective completions are concisely
-;;; indicated within the minibuffer itself, with each successive
-;;; keystroke.
+;; Loading this package implements a more fine-grained minibuffer
+;; completion feedback scheme.  Prospective completions are concisely
+;; indicated within the minibuffer itself, with each successive
+;; keystroke.
 
-;;; See 'icomplete-completions' docstring for a description of the
-;;; icomplete display format.
+;; See 'icomplete-completions' docstring for a description of the
+;; icomplete display format.
 
-;;; See the `icomplete-minibuffer-setup-hook' docstring for a means to
-;;; customize icomplete setup for interoperation with other
-;;; minibuffer-oriented packages.
+;; See the `icomplete-minibuffer-setup-hook' docstring for a means to
+;; customize icomplete setup for interoperation with other
+;; minibuffer-oriented packages.
 
-;;; To activate icomplete mode, simply load the package.  You can
-;;; subsequently deactivate it by invoking the function icomplete-mode
-;;; with a negative prefix-arg (C-U -1 ESC-x icomplete-mode).  Also,
-;;; you can prevent activation of the mode during package load by
-;;; first setting the variable `icomplete-mode' to nil.  Icompletion
-;;; can be enabled any time after the package is loaded by invoking
-;;; icomplete-mode without a prefix arg.
+;; To activate icomplete mode, simply load the package.  You can
+;; subsequently deactivate it by invoking the function icomplete-mode
+;; with a negative prefix-arg (C-U -1 ESC-x icomplete-mode).  Also,
+;; you can prevent activation of the mode during package load by
+;; first setting the variable `icomplete-mode' to nil.  Icompletion
+;; can be enabled any time after the package is loaded by invoking
+;; icomplete-mode without a prefix arg.
 
-;;; Thanks to everyone for their suggestions for refinements of this
-;;; package.  I particularly have to credit Michael Cook, who
-;;; implemented an incremental completion style in his 'iswitch'
-;;; functions that served as a model for icomplete.  Some other
-;;; contributors: Noah Freidman (restructuring as minor mode), Colin
-;;; Rafferty (lemacs reconciliation), Lars Lindberg, RMS, and
-;;; others.
+;; Thanks to everyone for their suggestions for refinements of this
+;; package.  I particularly have to credit Michael Cook, who
+;; implemented an incremental completion style in his 'iswitch'
+;; functions that served as a model for icomplete.  Some other
+;; contributors: Noah Freidman (restructuring as minor mode), Colin
+;; Rafferty (lemacs reconciliation), Lars Lindberg, RMS, and
+;; others.
 
-;;; klm.
+;; klm.
 
 ;;; Code:
 
@@ -130,40 +130,37 @@ Conditions are:
    the selected window is a minibuffer,
    and not in the middle of macro execution,
    and minibuffer-completion-table is not a symbol (which would
-       indicate some non-standard, non-simple completion mechansm,
+       indicate some non-standard, non-simple completion mechanism,
        like file-name and other custom-func completions)."
 
   (and (window-minibuffer-p (selected-window))
        (not executing-macro)
        (not (symbolp minibuffer-completion-table))))
+
 ;;;_ > icomplete-minibuffer-setup ()
 ;;;###autoload
 (defun icomplete-minibuffer-setup ()
-
   "Run in minibuffer on activation to establish incremental completion.
-
-Usually run by inclusion in minibuffer-setup-hook."
-
+Usually run by inclusion in `minibuffer-setup-hook'."
   (cond ((and icomplete-mode (icomplete-simple-completing-p))
-        (make-local-variable 'pre-command-hook)
-        (setq pre-command-hook (copy-sequence pre-command-hook))
+        (make-local-hook 'pre-command-hook)
         (add-hook 'pre-command-hook
                   (function (lambda ()
-                              (run-hooks 'icomplete-pre-command-hook))))
-        (make-local-variable 'post-command-hook)
-        (setq post-command-hook (copy-sequence post-command-hook))
+                              (run-hooks 'icomplete-pre-command-hook)))
+                  nil t)
+        (make-local-hook 'post-command-hook)
         (add-hook 'post-command-hook
                   (function (lambda ()
-                              (run-hooks 'icomplete-post-command-hook))))
+                              (run-hooks 'icomplete-post-command-hook)))
+                  nil t)
         (run-hooks 'icomplete-minibuffer-setup-hook))))
-
+\f
 ;;;_* Completion
 
 ;;;_ > icomplete-tidy ()
 (defun icomplete-tidy ()
   "Remove completions display \(if any) prior to new user input.
-
-Should be run in on the minibuffer pre-command-hook.  See `icomplete-mode'
+Should be run in on the minibuffer `pre-command-hook'.  See `icomplete-mode'
 and `minibuffer-setup-hook'."
   (if (icomplete-simple-completing-p)
       (if (and (boundp 'icomplete-eoinput)
@@ -178,11 +175,11 @@ and `minibuffer-setup-hook'."
        ;; Reestablish the local variable 'cause minibuffer-setup is weird:
        (make-local-variable 'icomplete-eoinput)
        (setq icomplete-eoinput 1))))
+
 ;;;_ > icomplete-exhibit ()
 (defun icomplete-exhibit ()
   "Insert icomplete completions display.
-
-Should be run via minibuffer post-command-hook.  See `icomplete-mode'
+Should be run via minibuffer `post-command-hook'.  See `icomplete-mode'
 and `minibuffer-setup-hook'."
   (if (icomplete-simple-completing-p)
       (let ((contents (buffer-substring (point-min)(point-max)))
@@ -204,6 +201,7 @@ and `minibuffer-setup-hook'."
                                      minibuffer-completion-predicate
                                      (not
                                       minibuffer-completion-confirm))))))))
+
 ;;;_ > icomplete-completions (name candidates predicate require-match)
 (defun icomplete-completions (name candidates predicate require-match)
   "Identify prospective candidates for minibuffer completion.
@@ -217,10 +215,10 @@ one of \(), \[], or \{} pairs.  The choice of brackets is as follows:
   \(...) - a single prospect is identified and matching is enforced,
   \[...] - a single prospect is identified but matching is optional, or
   \{...} - multiple prospects, separated by commas, are indicated, and
-          further input is required to distingish a single one.
+          further input is required to distinguish a single one.
 
-The displays for disambiguous matches have \" [Matched]\" appended
-\(whether complete or not), or \" \[No matches]\", if no eligible
+The displays for unambiguous matches have ` [Matched]' appended
+\(whether complete or not), or ` \[No matches]', if no eligible
 matches exist."
 
   (let ((comps (all-completions name candidates predicate))