diff options
| -rw-r--r-- | doc/emacs/mini.texi | 97 |
1 files changed, 64 insertions, 33 deletions
diff --git a/doc/emacs/mini.texi b/doc/emacs/mini.texi index 3f6208c46ef..4a2febaa29b 100644 --- a/doc/emacs/mini.texi +++ b/doc/emacs/mini.texi | |||
| @@ -262,8 +262,8 @@ when completion is allowed. | |||
| 262 | @table @kbd | 262 | @table @kbd |
| 263 | @item @key{TAB} | 263 | @item @key{TAB} |
| 264 | @findex minibuffer-complete | 264 | @findex minibuffer-complete |
| 265 | Complete the text before point in the minibuffer as much as possible; | 265 | Complete the text in the minibuffer as much as possible; if unable to |
| 266 | if unable to complete, display a list of possible completions | 266 | complete, display a list of possible completions |
| 267 | (@code{minibuffer-complete}). | 267 | (@code{minibuffer-complete}). |
| 268 | @item @key{SPC} | 268 | @item @key{SPC} |
| 269 | Complete up to one word from the minibuffer text before point | 269 | Complete up to one word from the minibuffer text before point |
| @@ -284,6 +284,42 @@ Display a list of possible completions of the text before point | |||
| 284 | (@code{minibuffer-completion-help}). | 284 | (@code{minibuffer-completion-help}). |
| 285 | @end table | 285 | @end table |
| 286 | 286 | ||
| 287 | @kindex TAB | ||
| 288 | @findex minibuffer-complete | ||
| 289 | @key{TAB} (@code{minibuffer-complete}) is the most fundamental | ||
| 290 | completion command. It searches for all possible completion | ||
| 291 | alternatives that match the existing minibuffer text, and attempts to | ||
| 292 | complete as much as it can. The matching of completion alternatives | ||
| 293 | to the minibuffer text is performed according to somewhat intricate | ||
| 294 | rules, which are designed so that plausible completions are offered | ||
| 295 | under most circumstances. A valid completion alternative must satisfy | ||
| 296 | the following criteria: | ||
| 297 | |||
| 298 | @itemize @bullet | ||
| 299 | @item | ||
| 300 | The minibuffer text before point must be the same as the beginning of | ||
| 301 | the completion alternative. If there is any minibuffer text after | ||
| 302 | point, it must be a substring of the remainder of the completion | ||
| 303 | alternative. | ||
| 304 | |||
| 305 | @item | ||
| 306 | If no completion alternative satisfies the above rules, try using | ||
| 307 | @dfn{partial completion} rules: divide the minibuffer text into words | ||
| 308 | separated by hyphens or spaces, and complete each word separately. | ||
| 309 | Thus, when completing command names, @samp{em-l-m} completes to | ||
| 310 | @samp{emacs-lisp-mode}. | ||
| 311 | |||
| 312 | @item | ||
| 313 | If there is still no completion alternative, try the first rule again, | ||
| 314 | but ignore the minibuffer text after point (i.e., don't try matching | ||
| 315 | it). | ||
| 316 | @end itemize | ||
| 317 | |||
| 318 | @noindent | ||
| 319 | When performing these comparisons, a @samp{*} in the minibuffer text | ||
| 320 | acts as a @dfn{wildcard}---it matches any character at the | ||
| 321 | corresponding position in the completion alternative. | ||
| 322 | |||
| 287 | @kindex SPC | 323 | @kindex SPC |
| 288 | @findex minibuffer-complete-word | 324 | @findex minibuffer-complete-word |
| 289 | @key{SPC} (@code{minibuffer-complete-word}) completes like | 325 | @key{SPC} (@code{minibuffer-complete-word}) completes like |
| @@ -293,8 +329,9 @@ completion is @samp{auto-fill-mode}, but it only inserts @samp{ill-}, | |||
| 293 | giving @samp{auto-fill-}. Another @key{SPC} at this point completes | 329 | giving @samp{auto-fill-}. Another @key{SPC} at this point completes |
| 294 | all the way to @samp{auto-fill-mode}. | 330 | all the way to @samp{auto-fill-mode}. |
| 295 | 331 | ||
| 296 | When you display a list of possible completions, you can choose | 332 | If @key{TAB} or @key{SPC} is unable to complete, it displays a list |
| 297 | one from it: | 333 | of possible completions (if there are any) in a separate window. You |
| 334 | can choose a completion from this list using the following commands: | ||
| 298 | 335 | ||
| 299 | @table @kbd | 336 | @table @kbd |
| 300 | @findex mouse-choose-completion | 337 | @findex mouse-choose-completion |
| @@ -401,35 +438,29 @@ contents are ignored. Elements of | |||
| 401 | @code{completion-ignored-extensions} that do not end in a slash are | 438 | @code{completion-ignored-extensions} that do not end in a slash are |
| 402 | ordinary file names. | 439 | ordinary file names. |
| 403 | 440 | ||
| 404 | @cindex Partial Completion mode | 441 | @cindex case-sensitivity and completion |
| 405 | @vindex partial-completion-mode | 442 | @vindex read-file-name-completion-ignore-case |
| 406 | @findex partial-completion-mode | 443 | @vindex read-buffer-completion-ignore-case |
| 407 | Partial Completion mode implements a more powerful kind of | 444 | When completing file names, Emacs ignores case differences if the |
| 408 | completion that can complete multiple words in parallel. For example, | 445 | variable @code{read-file-name-completion-ignore-case} is |
| 409 | it can complete the command name abbreviation @code{p-b} into | 446 | non-@code{nil}. The default value is @code{nil} on systems that have |
| 410 | @code{print-buffer} if no other command starts with two words whose | 447 | case-sensitive file-names, such as GNU/Linux; it is non-@code{nil} on |
| 411 | initials are @samp{p} and @samp{b}. | 448 | systems that have case-insensitive file-names, such as Microsoft |
| 412 | 449 | Windows. When completing buffer names, Emacs ignores case differences | |
| 413 | To enable this mode, use @kbd{M-x partial-completion-mode} or | 450 | if @code{read-buffer-completion-ignore-case} is non-@code{nil} (the |
| 414 | customize the variable @code{partial-completion-mode}. This mode | 451 | default value is @code{nil}). |
| 415 | binds special partial completion commands to @key{TAB}, @key{SPC}, | 452 | |
| 416 | @key{RET}, and @kbd{?} in the minibuffer. The usual completion | 453 | @vindex completion-styles |
| 417 | commands are available on @kbd{M-@key{TAB}} (or @kbd{C-M-i}), | 454 | You can customize the matching rules for completion alternatives |
| 418 | @kbd{M-@key{SPC}}, @kbd{M-@key{RET}} and @kbd{M-?}. | 455 | using the variable @code{completion-styles}. Its value should be a |
| 419 | 456 | list of symbols, each representing a @dfn{completion style}; valid | |
| 420 | Partial completion of directories in file names uses @samp{*} to | 457 | style symbols are @code{basic}, @code{partial-completion}, |
| 421 | indicate the places for completion; thus, @file{/u*/b*/f*} might | 458 | @code{emacs22}, and @code{emacs21}. When completing, Emacs attempts |
| 422 | complete to @file{/usr/bin/foo}. For remote files, partial completion | 459 | to use the first completion style in the list; if this does not return |
| 423 | enables completion of methods, user names and host names. | 460 | any completion alternatives, it tries the next completion style in the |
| 424 | @xref{Remote Files}. | 461 | list, and so on. The completion rules described in @ref{Completion |
| 425 | 462 | Commands} correspond to the default value of @code{completion-styles}, | |
| 426 | @vindex PC-include-file-path | 463 | which is @code{(basic partial-completion emacs22)}. |
| 427 | @vindex PC-disable-includes | ||
| 428 | Partial Completion mode also extends @code{find-file} so that | ||
| 429 | @samp{<@var{include}>} looks for the file named @var{include} in the | ||
| 430 | directories in the path @code{PC-include-file-path}. If you set | ||
| 431 | @code{PC-disable-includes} to non-@code{nil}, this feature is | ||
| 432 | disabled. | ||
| 433 | 464 | ||
| 434 | @cindex Icomplete mode | 465 | @cindex Icomplete mode |
| 435 | @findex icomplete-mode | 466 | @findex icomplete-mode |