aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/emacs/mini.texi97
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
265Complete the text before point in the minibuffer as much as possible; 265Complete the text in the minibuffer as much as possible; if unable to
266if unable to complete, display a list of possible completions 266complete, display a list of possible completions
267(@code{minibuffer-complete}). 267(@code{minibuffer-complete}).
268@item @key{SPC} 268@item @key{SPC}
269Complete up to one word from the minibuffer text before point 269Complete 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
290completion command. It searches for all possible completion
291alternatives that match the existing minibuffer text, and attempts to
292complete as much as it can. The matching of completion alternatives
293to the minibuffer text is performed according to somewhat intricate
294rules, which are designed so that plausible completions are offered
295under most circumstances. A valid completion alternative must satisfy
296the following criteria:
297
298@itemize @bullet
299@item
300The minibuffer text before point must be the same as the beginning of
301the completion alternative. If there is any minibuffer text after
302point, it must be a substring of the remainder of the completion
303alternative.
304
305@item
306If no completion alternative satisfies the above rules, try using
307@dfn{partial completion} rules: divide the minibuffer text into words
308separated by hyphens or spaces, and complete each word separately.
309Thus, when completing command names, @samp{em-l-m} completes to
310@samp{emacs-lisp-mode}.
311
312@item
313If there is still no completion alternative, try the first rule again,
314but ignore the minibuffer text after point (i.e., don't try matching
315it).
316@end itemize
317
318@noindent
319When performing these comparisons, a @samp{*} in the minibuffer text
320acts as a @dfn{wildcard}---it matches any character at the
321corresponding 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-},
293giving @samp{auto-fill-}. Another @key{SPC} at this point completes 329giving @samp{auto-fill-}. Another @key{SPC} at this point completes
294all the way to @samp{auto-fill-mode}. 330all 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
297one from it: 333of possible completions (if there are any) in a separate window. You
334can 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
402ordinary file names. 439ordinary 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
408completion that can complete multiple words in parallel. For example, 445variable @code{read-file-name-completion-ignore-case} is
409it can complete the command name abbreviation @code{p-b} into 446non-@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 447case-sensitive file-names, such as GNU/Linux; it is non-@code{nil} on
411initials are @samp{p} and @samp{b}. 448systems that have case-insensitive file-names, such as Microsoft
412 449Windows. When completing buffer names, Emacs ignores case differences
413 To enable this mode, use @kbd{M-x partial-completion-mode} or 450if @code{read-buffer-completion-ignore-case} is non-@code{nil} (the
414customize the variable @code{partial-completion-mode}. This mode 451default value is @code{nil}).
415binds 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
417commands 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-?}. 455using the variable @code{completion-styles}. Its value should be a
419 456list of symbols, each representing a @dfn{completion style}; valid
420 Partial completion of directories in file names uses @samp{*} to 457style symbols are @code{basic}, @code{partial-completion},
421indicate the places for completion; thus, @file{/u*/b*/f*} might 458@code{emacs22}, and @code{emacs21}. When completing, Emacs attempts
422complete to @file{/usr/bin/foo}. For remote files, partial completion 459to use the first completion style in the list; if this does not return
423enables completion of methods, user names and host names. 460any completion alternatives, it tries the next completion style in the
424@xref{Remote Files}. 461list, and so on. The completion rules described in @ref{Completion
425 462Commands} correspond to the default value of @code{completion-styles},
426@vindex PC-include-file-path 463which 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
430directories in the path @code{PC-include-file-path}. If you set
431@code{PC-disable-includes} to non-@code{nil}, this feature is
432disabled.
433 464
434@cindex Icomplete mode 465@cindex Icomplete mode
435@findex icomplete-mode 466@findex icomplete-mode