aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorGlenn Morris2014-02-12 00:27:27 -0800
committerGlenn Morris2014-02-12 00:27:27 -0800
commita8cb4247f9023dc1237854ee8f8727c82ec7d8a6 (patch)
treef9daf2bf25369bfadc1a4ca20225355399e0d65c /lisp
parenta9a61c77b3effd0e00b20ff714e430ee6b2a937a (diff)
downloademacs-a8cb4247f9023dc1237854ee8f8727c82ec7d8a6.tar.gz
emacs-a8cb4247f9023dc1237854ee8f8727c82ec7d8a6.zip
Some icomplete doc
* doc/emacs/mini.texi (Completion Options): No longer mention icomplete, which has its own section now. * doc/emacs/modes.texi (Minor Modes): Update Icomplete xref. * lisp/icomplete.el: Commentary updates. (icomplete): Add info-link to defgroup. (icomplete-with-completion-tables, icomplete-minibuffer-setup-hook) (icomplete-minibuffer-map, icomplete-mode) (icomplete-simple-completing-p, icomplete-completions): Doc fixes. * etc/NEWS: Related edits.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/icomplete.el71
2 files changed, 42 insertions, 34 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index fe51d85d1a8..997786e567b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -5,6 +5,11 @@
5 5
62014-02-12 Glenn Morris <rgm@gnu.org> 62014-02-12 Glenn Morris <rgm@gnu.org>
7 7
8 * icomplete.el (icomplete): Add info-link to defgroup.
9 (icomplete-with-completion-tables, icomplete-minibuffer-setup-hook)
10 (icomplete-minibuffer-map, icomplete-mode)
11 (icomplete-simple-completing-p, icomplete-completions): Doc fixes.
12
8 * emacs-lisp/package.el (package-menu-mode-map): Tweak menu. 13 * emacs-lisp/package.el (package-menu-mode-map): Tweak menu.
9 (package-menu-filter): Rename from package-menu-filter-interactive. 14 (package-menu-filter): Rename from package-menu-filter-interactive.
10 Doc fix. 15 Doc fix.
diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index a02a156009c..18bdd899e6e 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -1,12 +1,11 @@
1;;; icomplete.el --- minibuffer completion incremental feedback 1;;; icomplete.el --- minibuffer completion incremental feedback
2 2
3;; Copyright (C) 1992-1994, 1997, 1999, 2001-2014 Free Software 3;; Copyright (C) 1992-1994, 1997, 1999, 2001-2014
4;; Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Author: Ken Manheimer <klm@i.am> 6;; Author: Ken Manheimer <klm@i.am>
7;; Maintainer: Ken Manheimer <klm@i.am> 7;; Maintainer: Ken Manheimer <klm@i.am>
8;; Created: Mar 1993 Ken Manheimer, klm@nist.gov - first release to usenet 8;; Created: Mar 1993 Ken Manheimer, klm@nist.gov - first release to usenet
9;; Last update: Ken Manheimer <klm@i.am>, 11/18/1999.
10;; Keywords: help, abbrev 9;; Keywords: help, abbrev
11 10
12;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
@@ -26,7 +25,7 @@
26 25
27;;; Commentary: 26;;; Commentary:
28 27
29;; Loading this package implements a more fine-grained minibuffer 28;; Enabling this package implements a more fine-grained minibuffer
30;; completion feedback scheme. Prospective completions are concisely 29;; completion feedback scheme. Prospective completions are concisely
31;; indicated within the minibuffer itself, with each successive 30;; indicated within the minibuffer itself, with each successive
32;; keystroke. 31;; keystroke.
@@ -38,14 +37,7 @@
38;; customize icomplete setup for interoperation with other 37;; customize icomplete setup for interoperation with other
39;; minibuffer-oriented packages. 38;; minibuffer-oriented packages.
40 39
41;; To activate icomplete mode, load the package and use the 40;; To enable/disable icomplete mode, use the `icomplete-mode' function.
42;; `icomplete-mode' function. You can subsequently deactivate it by
43;; invoking the function icomplete-mode with a negative prefix-arg
44;; (C-U -1 ESC-x icomplete-mode). Also, you can prevent activation of
45;; the mode during package load by first setting the variable
46;; `icomplete-mode' to nil. Icompletion can be enabled any time after
47;; the package is loaded by invoking icomplete-mode without a prefix
48;; arg.
49 41
50;; Thanks to everyone for their suggestions for refinements of this 42;; Thanks to everyone for their suggestions for refinements of this
51;; package. I particularly have to credit Michael Cook, who 43;; package. I particularly have to credit Michael Cook, who
@@ -61,6 +53,7 @@
61(defgroup icomplete nil 53(defgroup icomplete nil
62 "Show completions dynamically in minibuffer." 54 "Show completions dynamically in minibuffer."
63 :prefix "icomplete-" 55 :prefix "icomplete-"
56 :link '(info-link "(emacs)Icomplete")
64 :group 'minibuffer) 57 :group 'minibuffer)
65 58
66(defvar icomplete-prospects-length 80) 59(defvar icomplete-prospects-length 80)
@@ -83,7 +76,17 @@ When nil, show candidates in full."
83 :type 'boolean 76 :type 'boolean
84 :version "24.4") 77 :version "24.4")
85 78
86(defface icomplete-first-match '((t :weight bold)) 79(defcustom icomplete-with-completion-tables t
80 "Specialized completion tables with which icomplete should operate.
81If this is t, Icomplete operates on all tables.
82Otherwise this should be a list of the completion tables (e.g.,
83`internal-complete-buffer') on which Icomplete should operate."
84 ;; Prior to 24.4, not a user-option, default '(internal-complete-buffer).
85 :version "24.4"
86 :type '(choice (const :tag "All" t)
87 (repeat function)))
88
89(defface icomplete-first-match '((t :weight bold))
87 "Face used by icomplete for highlighting first match." 90 "Face used by icomplete for highlighting first match."
88 :version "24.4") 91 :version "24.4")
89 92
@@ -120,10 +123,7 @@ It is intended for use in customizing icomplete for interoperation
120with other features and packages. For instance: 123with other features and packages. For instance:
121 124
122 \(add-hook 'icomplete-minibuffer-setup-hook 125 \(add-hook 'icomplete-minibuffer-setup-hook
123 \(function 126 \(lambda () (setq-local max-mini-window-height 3)))
124 \(lambda ()
125 \(make-local-variable 'max-mini-window-height)
126 \(setq max-mini-window-height 3))))
127 127
128will constrain Emacs to a maximum minibuffer height of 3 lines when 128will constrain Emacs to a maximum minibuffer height of 3 lines when
129icompletion is occurring." 129icompletion is occurring."
@@ -146,24 +146,14 @@ icompletion is occurring."
146 (let ((non-essential t)) ;E.g. don't prompt for password! 146 (let ((non-essential t)) ;E.g. don't prompt for password!
147 (icomplete-exhibit))) 147 (icomplete-exhibit)))
148 148
149;;;_ = icomplete-with-completion-tables
150(defcustom icomplete-with-completion-tables t
151 "Specialized completion tables with which icomplete should operate.
152
153If this variable is a list, Icomplete will not operate with any
154specialized completion tables except those on this list. If this
155variable is t, it won't restrict completion tables."
156 :version "24.4"
157 :type '(choice (const :tag "All" t)
158 (repeat function)))
159
160(defvar icomplete-minibuffer-map 149(defvar icomplete-minibuffer-map
161 (let ((map (make-sparse-keymap))) 150 (let ((map (make-sparse-keymap)))
162 (define-key map [?\M-\t] 'minibuffer-force-complete) 151 (define-key map [?\M-\t] 'minibuffer-force-complete)
163 (define-key map [?\C-j] 'minibuffer-force-complete-and-exit) 152 (define-key map [?\C-j] 'minibuffer-force-complete-and-exit)
164 (define-key map [?\C-.] 'icomplete-forward-completions) 153 (define-key map [?\C-.] 'icomplete-forward-completions)
165 (define-key map [?\C-,] 'icomplete-backward-completions) 154 (define-key map [?\C-,] 'icomplete-backward-completions)
166 map)) 155 map)
156 "Keymap used by `icomplete-mode' in the minibuffer.")
167 157
168(defun icomplete-forward-completions () 158(defun icomplete-forward-completions ()
169 "Step forward completions by one entry. 159 "Step forward completions by one entry.
@@ -199,7 +189,20 @@ Last entry becomes the first and can be selected with
199 "Toggle incremental minibuffer completion (Icomplete mode). 189 "Toggle incremental minibuffer completion (Icomplete mode).
200With a prefix argument ARG, enable Icomplete mode if ARG is 190With a prefix argument ARG, enable Icomplete mode if ARG is
201positive, and disable it otherwise. If called from Lisp, enable 191positive, and disable it otherwise. If called from Lisp, enable
202the mode if ARG is omitted or nil." 192the mode if ARG is omitted or nil.
193
194When this global minor mode is enabled, typing in the minibuffer
195continuously displays a list of possible completions that match
196the string you have typed. See `icomplete-completions' for a
197description of how prospective completions are displayed.
198
199For more information, see Info node `(emacs)Icomplete'.
200For options you can set, `M-x customize-group icomplete'.
201
202You can use the following key bindings to navigate and select
203completions:
204
205\\{icomplete-minibuffer-map}"
203 :global t :group 'icomplete 206 :global t :group 'icomplete
204 (remove-hook 'minibuffer-setup-hook #'icomplete-minibuffer-setup) 207 (remove-hook 'minibuffer-setup-hook #'icomplete-minibuffer-setup)
205 (remove-hook 'completion-in-region-mode-hook #'icomplete--in-region-setup) 208 (remove-hook 'completion-in-region-mode-hook #'icomplete--in-region-setup)
@@ -230,7 +233,7 @@ the mode if ARG is omitted or nil."
230 233
231;;;_ > icomplete-simple-completing-p () 234;;;_ > icomplete-simple-completing-p ()
232(defun icomplete-simple-completing-p () 235(defun icomplete-simple-completing-p ()
233 "Non-nil if current window is minibuffer that's doing simple completion. 236 "Non-nil if current window is a minibuffer that's doing simple completion.
234 237
235Conditions are: 238Conditions are:
236 the selected window is a minibuffer, 239 the selected window is a minibuffer,
@@ -356,11 +359,11 @@ one of \(), \[], or \{} pairs. The choice of brackets is as follows:
356 \{...} - multiple prospects, separated by commas, are indicated, and 359 \{...} - multiple prospects, separated by commas, are indicated, and
357 further input is required to distinguish a single one. 360 further input is required to distinguish a single one.
358 361
362If there are multiple possibilities, `icomplete-separator' separates them.
363
359The displays for unambiguous matches have ` [Matched]' appended 364The displays for unambiguous matches have ` [Matched]' appended
360\(whether complete or not), or ` \[No matches]', if no eligible 365\(whether complete or not), or ` \[No matches]', if no eligible
361matches exist. \(Keybindings for uniquely matched commands 366matches exist."
362are exhibited within the square braces.)"
363
364 (let* ((minibuffer-completion-table candidates) 367 (let* ((minibuffer-completion-table candidates)
365 (minibuffer-completion-predicate predicate) 368 (minibuffer-completion-predicate predicate)
366 (md (completion--field-metadata (icomplete--field-beg))) 369 (md (completion--field-metadata (icomplete--field-beg)))