diff options
| author | Glenn Morris | 2014-02-12 00:27:27 -0800 |
|---|---|---|
| committer | Glenn Morris | 2014-02-12 00:27:27 -0800 |
| commit | a8cb4247f9023dc1237854ee8f8727c82ec7d8a6 (patch) | |
| tree | f9daf2bf25369bfadc1a4ca20225355399e0d65c | |
| parent | a9a61c77b3effd0e00b20ff714e430ee6b2a937a (diff) | |
| download | emacs-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.
| -rw-r--r-- | doc/emacs/ChangeLog | 4 | ||||
| -rw-r--r-- | doc/emacs/mini.texi | 7 | ||||
| -rw-r--r-- | doc/emacs/modes.texi | 3 | ||||
| -rw-r--r-- | etc/NEWS | 24 | ||||
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/icomplete.el | 71 |
6 files changed, 64 insertions, 50 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 0a17567865d..f60ce671728 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | 2014-02-12 Glenn Morris <rgm@gnu.org> | 1 | 2014-02-12 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * mini.texi (Completion Options): No longer mention icomplete, | ||
| 4 | which has its own section now. | ||
| 5 | * modes.texi (Minor Modes): Update Icomplete xref. | ||
| 6 | |||
| 3 | * help.texi (Package Keywords): Mention describe-package buttons. | 7 | * help.texi (Package Keywords): Mention describe-package buttons. |
| 4 | 8 | ||
| 5 | * package.texi (Package Menu): Mention package-menu-filter. | 9 | * package.texi (Package Menu): Mention package-menu-filter. |
diff --git a/doc/emacs/mini.texi b/doc/emacs/mini.texi index 6fc501a903e..b575e4adbd3 100644 --- a/doc/emacs/mini.texi +++ b/doc/emacs/mini.texi | |||
| @@ -575,13 +575,6 @@ in a cyclic manner. If you give @code{completion-cycle-threshold} a | |||
| 575 | numeric value @var{n}, completion commands switch to this cycling | 575 | numeric value @var{n}, completion commands switch to this cycling |
| 576 | behavior only when there are @var{n} or fewer alternatives. | 576 | behavior only when there are @var{n} or fewer alternatives. |
| 577 | 577 | ||
| 578 | @cindex Icomplete mode | ||
| 579 | @findex icomplete-mode | ||
| 580 | Icomplete mode presents a constantly-updated display that tells you | ||
| 581 | what completions are available for the text you've entered so far. The | ||
| 582 | command to enable or disable this minor mode is @kbd{M-x | ||
| 583 | icomplete-mode}. | ||
| 584 | |||
| 585 | @node Minibuffer History | 578 | @node Minibuffer History |
| 586 | @section Minibuffer History | 579 | @section Minibuffer History |
| 587 | @cindex minibuffer history | 580 | @cindex minibuffer history |
diff --git a/doc/emacs/modes.texi b/doc/emacs/modes.texi index 7409222f7c8..b21be99e16c 100644 --- a/doc/emacs/modes.texi +++ b/doc/emacs/modes.texi | |||
| @@ -263,8 +263,7 @@ in the region, if the region is active. @xref{Using Region}. | |||
| 263 | 263 | ||
| 264 | @item | 264 | @item |
| 265 | Icomplete mode displays an indication of available completions when | 265 | Icomplete mode displays an indication of available completions when |
| 266 | you are in the minibuffer and completion is active. @xref{Completion | 266 | you are in the minibuffer and completion is active. @xref{Icomplete}. |
| 267 | Options}. | ||
| 268 | 267 | ||
| 269 | @item | 268 | @item |
| 270 | Line Number mode enables display of the current line number in the | 269 | Line Number mode enables display of the current line number in the |
| @@ -232,6 +232,7 @@ equivalent to setting `(eval-expression-)print-length' and | |||
| 232 | `(eval-expression-)print-level' to nil. Additionally, it causes integers | 232 | `(eval-expression-)print-level' to nil. Additionally, it causes integers |
| 233 | to be printed in other formats (octal, hexadecimal, and character). | 233 | to be printed in other formats (octal, hexadecimal, and character). |
| 234 | 234 | ||
| 235 | --- | ||
| 235 | *** New hook `eval-expression-minibuffer-setup-hook' run by | 236 | *** New hook `eval-expression-minibuffer-setup-hook' run by |
| 236 | `eval-expression' on entering the minibuffer. | 237 | `eval-expression' on entering the minibuffer. |
| 237 | 238 | ||
| @@ -554,17 +555,26 @@ module. | |||
| 554 | --- | 555 | --- |
| 555 | ** New F90 mode option `f90-smart-end-names'. | 556 | ** New F90 mode option `f90-smart-end-names'. |
| 556 | 557 | ||
| 557 | ** Icomplete is a bit more like Ido. | 558 | ** Icomplete |
| 558 | 559 | ||
| 559 | *** Key bindings to navigate through and select the completions. | 560 | *** Icomplete by default now applies to all forms of minibuffer completion. |
| 561 | The variable `icomplete-with-completion-tables' (now a user option) | ||
| 562 | controls this. To restore the old behavior, set it back to | ||
| 563 | '(internal-complete-buffer). | ||
| 560 | 564 | ||
| 561 | *** The icomplete-separator is customizable, and its default has changed. | 565 | *** You can navigate through and select completions using the keys |
| 566 | from `icomplete-minibuffer-map'. | ||
| 562 | 567 | ||
| 563 | *** Removed `icomplete-show-key-bindings'. | 568 | --- |
| 569 | *** The string that separates potential completions is now a customizable | ||
| 570 | option (`icomplete-separator'). The default is " | " rather than ",". | ||
| 564 | 571 | ||
| 565 | *** Icomplete-mode by defaults applies to all forms of minibuffer completion. | 572 | --- |
| 566 | (setq icomplete-with-completion-tables '(internal-complete-buffer)) | 573 | *** New face `icomplete-first-match'; and new options |
| 567 | will revert to the old behavior. | 574 | `icomplete-hide-common-prefix' and `icomplete-show-matches-on-no-input'. |
| 575 | |||
| 576 | --- | ||
| 577 | *** The option `icomplete-show-key-bindings' has been removed. | ||
| 568 | 578 | ||
| 569 | ** Ido | 579 | ** Ido |
| 570 | 580 | ||
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fe51d85d1a8..997786e567b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -5,6 +5,11 @@ | |||
| 5 | 5 | ||
| 6 | 2014-02-12 Glenn Morris <rgm@gnu.org> | 6 | 2014-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. | ||
| 81 | If this is t, Icomplete operates on all tables. | ||
| 82 | Otherwise 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 | |||
| 120 | with other features and packages. For instance: | 123 | with 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 | ||
| 128 | will constrain Emacs to a maximum minibuffer height of 3 lines when | 128 | will constrain Emacs to a maximum minibuffer height of 3 lines when |
| 129 | icompletion is occurring." | 129 | icompletion 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 | |||
| 153 | If this variable is a list, Icomplete will not operate with any | ||
| 154 | specialized completion tables except those on this list. If this | ||
| 155 | variable 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). |
| 200 | With a prefix argument ARG, enable Icomplete mode if ARG is | 190 | With a prefix argument ARG, enable Icomplete mode if ARG is |
| 201 | positive, and disable it otherwise. If called from Lisp, enable | 191 | positive, and disable it otherwise. If called from Lisp, enable |
| 202 | the mode if ARG is omitted or nil." | 192 | the mode if ARG is omitted or nil. |
| 193 | |||
| 194 | When this global minor mode is enabled, typing in the minibuffer | ||
| 195 | continuously displays a list of possible completions that match | ||
| 196 | the string you have typed. See `icomplete-completions' for a | ||
| 197 | description of how prospective completions are displayed. | ||
| 198 | |||
| 199 | For more information, see Info node `(emacs)Icomplete'. | ||
| 200 | For options you can set, `M-x customize-group icomplete'. | ||
| 201 | |||
| 202 | You can use the following key bindings to navigate and select | ||
| 203 | completions: | ||
| 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 | ||
| 235 | Conditions are: | 238 | Conditions 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 | ||
| 362 | If there are multiple possibilities, `icomplete-separator' separates them. | ||
| 363 | |||
| 359 | The displays for unambiguous matches have ` [Matched]' appended | 364 | The 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 |
| 361 | matches exist. \(Keybindings for uniquely matched commands | 366 | matches exist." |
| 362 | are 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))) |