annotate man/mini.texi @ 70656:182680a57573

(Fnext_single_char_property_change) (Fprevious_single_char_property_change): Don't allow returning value beyond LIMIT in any cases. (Fnext_char_property_change, Fprevious_char_property_change): Doc fix.
author Richard M. Stallman <rms@gnu.org>
date Sun, 14 May 2006 21:55:34 +0000
parents 737e59692915
children c550ef173e58 146cd8369025
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
1 @c This is part of the Emacs manual.
64890
3723093a21fd Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 64375
diff changeset
2 @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001,
68639
dc2d5a6655a3 Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 68458
diff changeset
3 @c 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
4 @c See file emacs.texi for copying conditions.
Dave Love <fx@gnu.org>
parents:
diff changeset
5 @node Minibuffer, M-x, Basic, Top
Dave Love <fx@gnu.org>
parents:
diff changeset
6 @chapter The Minibuffer
Dave Love <fx@gnu.org>
parents:
diff changeset
7 @cindex minibuffer
Dave Love <fx@gnu.org>
parents:
diff changeset
8
Dave Love <fx@gnu.org>
parents:
diff changeset
9 The @dfn{minibuffer} is the facility used by Emacs commands to read
Dave Love <fx@gnu.org>
parents:
diff changeset
10 arguments more complicated than a single number. Minibuffer arguments
Dave Love <fx@gnu.org>
parents:
diff changeset
11 can be file names, buffer names, Lisp function names, Emacs command
Dave Love <fx@gnu.org>
parents:
diff changeset
12 names, Lisp expressions, and many other things, depending on the command
Dave Love <fx@gnu.org>
parents:
diff changeset
13 reading the argument. You can use the usual Emacs editing commands in
Dave Love <fx@gnu.org>
parents:
diff changeset
14 the minibuffer to edit the argument text.
Dave Love <fx@gnu.org>
parents:
diff changeset
15
Dave Love <fx@gnu.org>
parents:
diff changeset
16 @cindex prompt
Dave Love <fx@gnu.org>
parents:
diff changeset
17 When the minibuffer is in use, it appears in the echo area, and the
Dave Love <fx@gnu.org>
parents:
diff changeset
18 terminal's cursor moves there. The beginning of the minibuffer line
60245
78a1812a9fd5 (Minibuffer): Prompts are highlighted.
Richard M. Stallman <rms@gnu.org>
parents: 59798
diff changeset
19 displays a @dfn{prompt} in a special color, to say what kind of input
78a1812a9fd5 (Minibuffer): Prompts are highlighted.
Richard M. Stallman <rms@gnu.org>
parents: 59798
diff changeset
20 you should supply and how it will be used. Often this prompt is
78a1812a9fd5 (Minibuffer): Prompts are highlighted.
Richard M. Stallman <rms@gnu.org>
parents: 59798
diff changeset
21 derived from the name of the command that the argument is for. The
78a1812a9fd5 (Minibuffer): Prompts are highlighted.
Richard M. Stallman <rms@gnu.org>
parents: 59798
diff changeset
22 prompt normally ends with a colon.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
23
Dave Love <fx@gnu.org>
parents:
diff changeset
24 @cindex default argument
65757
ee26002f84d8 (Minibuffer): The default value now appears before the colon in
Romain Francoise <romain@orebokech.com>
parents: 64890
diff changeset
25 Sometimes a @dfn{default argument} appears in parentheses before the
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
26 colon; it too is part of the prompt. The default will be used as the
38461
23f63206a867 Proofreading fixes from Chris Green <chris_e_green@yahoo.com>.
Eli Zaretskii <eliz@gnu.org>
parents: 36727
diff changeset
27 argument value if you enter an empty argument (that is, just type
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
28 @key{RET}). For example, commands that read buffer names always show a
Dave Love <fx@gnu.org>
parents:
diff changeset
29 default, which is the name of the buffer that will be used if you type
Dave Love <fx@gnu.org>
parents:
diff changeset
30 just @key{RET}.
Dave Love <fx@gnu.org>
parents:
diff changeset
31
Dave Love <fx@gnu.org>
parents:
diff changeset
32 The simplest way to enter a minibuffer argument is to type the text
Dave Love <fx@gnu.org>
parents:
diff changeset
33 you want, terminated by @key{RET} which exits the minibuffer. You can
Dave Love <fx@gnu.org>
parents:
diff changeset
34 cancel the command that wants the argument, and get out of the
Dave Love <fx@gnu.org>
parents:
diff changeset
35 minibuffer, by typing @kbd{C-g}.
Dave Love <fx@gnu.org>
parents:
diff changeset
36
Dave Love <fx@gnu.org>
parents:
diff changeset
37 Since the minibuffer uses the screen space of the echo area, it can
Dave Love <fx@gnu.org>
parents:
diff changeset
38 conflict with other ways Emacs customarily uses the echo area. Here is how
Dave Love <fx@gnu.org>
parents:
diff changeset
39 Emacs handles such conflicts:
Dave Love <fx@gnu.org>
parents:
diff changeset
40
Dave Love <fx@gnu.org>
parents:
diff changeset
41 @itemize @bullet
Dave Love <fx@gnu.org>
parents:
diff changeset
42 @item
Dave Love <fx@gnu.org>
parents:
diff changeset
43 If a command gets an error while you are in the minibuffer, this does
Dave Love <fx@gnu.org>
parents:
diff changeset
44 not cancel the minibuffer. However, the echo area is needed for the
Dave Love <fx@gnu.org>
parents:
diff changeset
45 error message and therefore the minibuffer itself is hidden for a
Dave Love <fx@gnu.org>
parents:
diff changeset
46 while. It comes back after a few seconds, or as soon as you type
Dave Love <fx@gnu.org>
parents:
diff changeset
47 anything.
Dave Love <fx@gnu.org>
parents:
diff changeset
48
Dave Love <fx@gnu.org>
parents:
diff changeset
49 @item
38870
d44abb4e68b2 Don't use "print" for displaying a message.
Richard M. Stallman <rms@gnu.org>
parents: 38786
diff changeset
50 If in the minibuffer you use a command whose purpose is to display a
d44abb4e68b2 Don't use "print" for displaying a message.
Richard M. Stallman <rms@gnu.org>
parents: 38786
diff changeset
51 message in the echo area, such as @kbd{C-x =}, the message hides the
d44abb4e68b2 Don't use "print" for displaying a message.
Richard M. Stallman <rms@gnu.org>
parents: 38786
diff changeset
52 minibuffer for a while. The minibuffer contents come back after a few
d44abb4e68b2 Don't use "print" for displaying a message.
Richard M. Stallman <rms@gnu.org>
parents: 38786
diff changeset
53 seconds, or as soon as you type anything.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
54
Dave Love <fx@gnu.org>
parents:
diff changeset
55 @item
Dave Love <fx@gnu.org>
parents:
diff changeset
56 Echoing of keystrokes does not take place while the minibuffer is in
Dave Love <fx@gnu.org>
parents:
diff changeset
57 use.
Dave Love <fx@gnu.org>
parents:
diff changeset
58 @end itemize
Dave Love <fx@gnu.org>
parents:
diff changeset
59
Dave Love <fx@gnu.org>
parents:
diff changeset
60 @menu
Dave Love <fx@gnu.org>
parents:
diff changeset
61 * File: Minibuffer File. Entering file names with the minibuffer.
Dave Love <fx@gnu.org>
parents:
diff changeset
62 * Edit: Minibuffer Edit. How to edit in the minibuffer.
Dave Love <fx@gnu.org>
parents:
diff changeset
63 * Completion:: An abbreviation facility for minibuffer input.
Dave Love <fx@gnu.org>
parents:
diff changeset
64 * Minibuffer History:: Reusing recent minibuffer arguments.
Dave Love <fx@gnu.org>
parents:
diff changeset
65 * Repetition:: Re-executing commands that used the minibuffer.
Dave Love <fx@gnu.org>
parents:
diff changeset
66 @end menu
Dave Love <fx@gnu.org>
parents:
diff changeset
67
Dave Love <fx@gnu.org>
parents:
diff changeset
68 @node Minibuffer File
Dave Love <fx@gnu.org>
parents:
diff changeset
69 @section Minibuffers for File Names
Dave Love <fx@gnu.org>
parents:
diff changeset
70
Dave Love <fx@gnu.org>
parents:
diff changeset
71 Sometimes the minibuffer starts out with text in it. For example, when
Dave Love <fx@gnu.org>
parents:
diff changeset
72 you are supposed to give a file name, the minibuffer starts out containing
Dave Love <fx@gnu.org>
parents:
diff changeset
73 the @dfn{default directory}, which ends with a slash. This is to inform
Dave Love <fx@gnu.org>
parents:
diff changeset
74 you which directory the file will be found in if you do not specify a
Dave Love <fx@gnu.org>
parents:
diff changeset
75 directory.
Dave Love <fx@gnu.org>
parents:
diff changeset
76
39265
523edbd58655 Spelling correction.
Richard M. Stallman <rms@gnu.org>
parents: 38870
diff changeset
77 @c Separate paragraph to clean up ugly page break--rms
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
78 @need 1500
Dave Love <fx@gnu.org>
parents:
diff changeset
79 For example, the minibuffer might start out with these contents:
Dave Love <fx@gnu.org>
parents:
diff changeset
80
Dave Love <fx@gnu.org>
parents:
diff changeset
81 @example
Dave Love <fx@gnu.org>
parents:
diff changeset
82 Find File: /u2/emacs/src/
Dave Love <fx@gnu.org>
parents:
diff changeset
83 @end example
Dave Love <fx@gnu.org>
parents:
diff changeset
84
Dave Love <fx@gnu.org>
parents:
diff changeset
85 @noindent
44373
5be168598322 Minor change for TeX filling improvement.
Richard M. Stallman <rms@gnu.org>
parents: 39880
diff changeset
86 where @samp{Find File:@: } is the prompt. Typing @kbd{buffer.c} as
5be168598322 Minor change for TeX filling improvement.
Richard M. Stallman <rms@gnu.org>
parents: 39880
diff changeset
87 input specifies the file @file{/u2/emacs/src/buffer.c}. To find files
5be168598322 Minor change for TeX filling improvement.
Richard M. Stallman <rms@gnu.org>
parents: 39880
diff changeset
88 in nearby directories, use @kbd{..}; thus, if you type
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
89 @kbd{../lisp/simple.el}, you will get the file named
Dave Love <fx@gnu.org>
parents:
diff changeset
90 @file{/u2/emacs/lisp/simple.el}. Alternatively, you can kill with
Dave Love <fx@gnu.org>
parents:
diff changeset
91 @kbd{M-@key{DEL}} the directory names you don't want (@pxref{Words}).
Dave Love <fx@gnu.org>
parents:
diff changeset
92
Dave Love <fx@gnu.org>
parents:
diff changeset
93 If you don't want any of the default, you can kill it with @kbd{C-a
Dave Love <fx@gnu.org>
parents:
diff changeset
94 C-k}. But you don't need to kill the default; you can simply ignore it.
Dave Love <fx@gnu.org>
parents:
diff changeset
95 Insert an absolute file name, one starting with a slash or a tilde,
Dave Love <fx@gnu.org>
parents:
diff changeset
96 after the default directory. For example, to specify the file
Dave Love <fx@gnu.org>
parents:
diff changeset
97 @file{/etc/termcap}, just insert that name, giving these minibuffer
Dave Love <fx@gnu.org>
parents:
diff changeset
98 contents:
Dave Love <fx@gnu.org>
parents:
diff changeset
99
Dave Love <fx@gnu.org>
parents:
diff changeset
100 @example
Dave Love <fx@gnu.org>
parents:
diff changeset
101 Find File: /u2/emacs/src//etc/termcap
Dave Love <fx@gnu.org>
parents:
diff changeset
102 @end example
Dave Love <fx@gnu.org>
parents:
diff changeset
103
Dave Love <fx@gnu.org>
parents:
diff changeset
104 @noindent
Dave Love <fx@gnu.org>
parents:
diff changeset
105 @cindex // in file name
Dave Love <fx@gnu.org>
parents:
diff changeset
106 @cindex double slash in file name
Dave Love <fx@gnu.org>
parents:
diff changeset
107 @cindex slashes repeated in file name
66991
83e12e37521d (Minibuffer File): Clarify previous change. Add @findex.
Richard M. Stallman <rms@gnu.org>
parents: 66953
diff changeset
108 @findex file-name-shadow-mode
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
109 GNU Emacs gives a special meaning to a double slash (which is not
66991
83e12e37521d (Minibuffer File): Clarify previous change. Add @findex.
Richard M. Stallman <rms@gnu.org>
parents: 66953
diff changeset
110 normally a useful thing to write): it means, ``ignore everything
83e12e37521d (Minibuffer File): Clarify previous change. Add @findex.
Richard M. Stallman <rms@gnu.org>
parents: 66953
diff changeset
111 before the second slash in the pair.'' Thus, @samp{/u2/emacs/src/} is
83e12e37521d (Minibuffer File): Clarify previous change. Add @findex.
Richard M. Stallman <rms@gnu.org>
parents: 66953
diff changeset
112 ignored in the example above, and you get the file
83e12e37521d (Minibuffer File): Clarify previous change. Add @findex.
Richard M. Stallman <rms@gnu.org>
parents: 66953
diff changeset
113 @file{/etc/termcap}. The ignored part of the file name is dimmed if
83e12e37521d (Minibuffer File): Clarify previous change. Add @findex.
Richard M. Stallman <rms@gnu.org>
parents: 66953
diff changeset
114 the terminal allows it; to disable this, turn off
66953
2ce8310aed56 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 65757
diff changeset
115 @code{file-name-shadow-mode} minor mode.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
116
68458
eab2da67a471 Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents: 67395
diff changeset
117 If you set @code{insert-default-directory} to @code{nil}, the
eab2da67a471 Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents: 67395
diff changeset
118 default directory is never inserted in the minibuffer---so the
eab2da67a471 Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents: 67395
diff changeset
119 minibuffer starts out empty. But the name you type, if relative, is
eab2da67a471 Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents: 67395
diff changeset
120 still interpreted with respect to the same default directory.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
121
Dave Love <fx@gnu.org>
parents:
diff changeset
122 @node Minibuffer Edit
Dave Love <fx@gnu.org>
parents:
diff changeset
123 @section Editing in the Minibuffer
Dave Love <fx@gnu.org>
parents:
diff changeset
124
Dave Love <fx@gnu.org>
parents:
diff changeset
125 The minibuffer is an Emacs buffer (albeit a peculiar one), and the usual
Dave Love <fx@gnu.org>
parents:
diff changeset
126 Emacs commands are available for editing the text of an argument you are
Dave Love <fx@gnu.org>
parents:
diff changeset
127 entering.
Dave Love <fx@gnu.org>
parents:
diff changeset
128
Dave Love <fx@gnu.org>
parents:
diff changeset
129 Since @key{RET} in the minibuffer is defined to exit the minibuffer,
Dave Love <fx@gnu.org>
parents:
diff changeset
130 you can't use it to insert a newline in the minibuffer. To do that,
68458
eab2da67a471 Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents: 67395
diff changeset
131 type @kbd{C-o} or @kbd{C-q C-j}. (The newline character is really the
eab2da67a471 Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents: 67395
diff changeset
132 @acronym{ASCII} character control-J.)
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
133
68458
eab2da67a471 Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents: 67395
diff changeset
134 The minibuffer has its own window, which normally has space on the
eab2da67a471 Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents: 67395
diff changeset
135 Emacs frame at all times, but it only acts like an Emacs window when
eab2da67a471 Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents: 67395
diff changeset
136 the minibuffer is really in use. At those times, its window is much
eab2da67a471 Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents: 67395
diff changeset
137 like any other Emacs window; you can switch from the minibuffer window
eab2da67a471 Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents: 67395
diff changeset
138 to another window with @kbd{C-x o}, and edit text in other windows,
eab2da67a471 Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents: 67395
diff changeset
139 before returning to the minibuffer to submit the argument. You can
eab2da67a471 Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents: 67395
diff changeset
140 kill text in another window, return to the minibuffer window, and then
eab2da67a471 Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents: 67395
diff changeset
141 yank the text to use it in the argument. @xref{Windows}.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
142
Dave Love <fx@gnu.org>
parents:
diff changeset
143 @cindex height of minibuffer
Dave Love <fx@gnu.org>
parents:
diff changeset
144 @cindex size of minibuffer
Dave Love <fx@gnu.org>
parents:
diff changeset
145 @cindex growing minibuffer
27216
99ca9ac9c31a Minibuffer resizing now automatic.
Dave Love <fx@gnu.org>
parents: 25829
diff changeset
146 @cindex resizing minibuffer
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
147 There are some restrictions on the use of the minibuffer window,
Dave Love <fx@gnu.org>
parents:
diff changeset
148 however. You cannot switch buffers in it---the minibuffer and its
Dave Love <fx@gnu.org>
parents:
diff changeset
149 window are permanently attached. Also, you cannot split or kill the
Dave Love <fx@gnu.org>
parents:
diff changeset
150 minibuffer window. But you can make it taller in the normal fashion
33310
7476be16909f (Minibuffer Edit): Add description of
Gerd Moellmann <gerd@gnu.org>
parents: 31050
diff changeset
151 with @kbd{C-x ^}.
7476be16909f (Minibuffer Edit): Add description of
Gerd Moellmann <gerd@gnu.org>
parents: 31050
diff changeset
152
7476be16909f (Minibuffer Edit): Add description of
Gerd Moellmann <gerd@gnu.org>
parents: 31050
diff changeset
153 @vindex resize-mini-windows
38461
23f63206a867 Proofreading fixes from Chris Green <chris_e_green@yahoo.com>.
Eli Zaretskii <eliz@gnu.org>
parents: 36727
diff changeset
154 The minibuffer window expands vertically as necessary to hold the
60245
78a1812a9fd5 (Minibuffer): Prompts are highlighted.
Richard M. Stallman <rms@gnu.org>
parents: 59798
diff changeset
155 text that you put in the minibuffer. If @code{resize-mini-windows} is
78a1812a9fd5 (Minibuffer): Prompts are highlighted.
Richard M. Stallman <rms@gnu.org>
parents: 59798
diff changeset
156 @code{t} (the default), the window is always resized to fit the size
78a1812a9fd5 (Minibuffer): Prompts are highlighted.
Richard M. Stallman <rms@gnu.org>
parents: 59798
diff changeset
157 of the text it displays. If its value is the symbol @code{grow-only},
78a1812a9fd5 (Minibuffer): Prompts are highlighted.
Richard M. Stallman <rms@gnu.org>
parents: 59798
diff changeset
158 the window grows when the size of displayed text increases, but
78a1812a9fd5 (Minibuffer): Prompts are highlighted.
Richard M. Stallman <rms@gnu.org>
parents: 59798
diff changeset
159 shrinks (back to the normal size) only when the minibuffer becomes
78a1812a9fd5 (Minibuffer): Prompts are highlighted.
Richard M. Stallman <rms@gnu.org>
parents: 59798
diff changeset
160 inactive. If its value is @code{nil}, you have to adjust the height
78a1812a9fd5 (Minibuffer): Prompts are highlighted.
Richard M. Stallman <rms@gnu.org>
parents: 59798
diff changeset
161 yourself.
33310
7476be16909f (Minibuffer Edit): Add description of
Gerd Moellmann <gerd@gnu.org>
parents: 31050
diff changeset
162
7476be16909f (Minibuffer Edit): Add description of
Gerd Moellmann <gerd@gnu.org>
parents: 31050
diff changeset
163 @vindex max-mini-window-height
36166
7ce22edfb862 Clean up max-mini-window-height and Partial Completion mode.
Richard M. Stallman <rms@gnu.org>
parents: 33310
diff changeset
164 The variable @code{max-mini-window-height} controls the maximum
7ce22edfb862 Clean up max-mini-window-height and Partial Completion mode.
Richard M. Stallman <rms@gnu.org>
parents: 33310
diff changeset
165 height for resizing the minibuffer window: a floating-point number
7ce22edfb862 Clean up max-mini-window-height and Partial Completion mode.
Richard M. Stallman <rms@gnu.org>
parents: 33310
diff changeset
166 specifies a fraction of the frame's height; an integer specifies the
7ce22edfb862 Clean up max-mini-window-height and Partial Completion mode.
Richard M. Stallman <rms@gnu.org>
parents: 33310
diff changeset
167 maximum number of lines; @code{nil} means do not resize the minibuffer
7ce22edfb862 Clean up max-mini-window-height and Partial Completion mode.
Richard M. Stallman <rms@gnu.org>
parents: 33310
diff changeset
168 window automatically. The default value is 0.25.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
169
60245
78a1812a9fd5 (Minibuffer): Prompts are highlighted.
Richard M. Stallman <rms@gnu.org>
parents: 59798
diff changeset
170 If, while in the minibuffer, you issue a command that displays help
78a1812a9fd5 (Minibuffer): Prompts are highlighted.
Richard M. Stallman <rms@gnu.org>
parents: 59798
diff changeset
171 text of any sort in another window, you can use the @kbd{C-M-v}
78a1812a9fd5 (Minibuffer): Prompts are highlighted.
Richard M. Stallman <rms@gnu.org>
parents: 59798
diff changeset
172 command while in the minibuffer to scroll the help text.
78a1812a9fd5 (Minibuffer): Prompts are highlighted.
Richard M. Stallman <rms@gnu.org>
parents: 59798
diff changeset
173 (@kbd{M-@key{PAGEUP}} and @kbd{M-@key{PAGEDOWN}} also operate on that
78a1812a9fd5 (Minibuffer): Prompts are highlighted.
Richard M. Stallman <rms@gnu.org>
parents: 59798
diff changeset
174 help text.) This lasts until you exit the minibuffer. This feature
78a1812a9fd5 (Minibuffer): Prompts are highlighted.
Richard M. Stallman <rms@gnu.org>
parents: 59798
diff changeset
175 is especially useful when you display a buffer listing possible
78a1812a9fd5 (Minibuffer): Prompts are highlighted.
Richard M. Stallman <rms@gnu.org>
parents: 59798
diff changeset
176 completions. @xref{Other Window}.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
177
Dave Love <fx@gnu.org>
parents:
diff changeset
178 @vindex enable-recursive-minibuffers
Dave Love <fx@gnu.org>
parents:
diff changeset
179 Emacs normally disallows most commands that use the minibuffer while
Dave Love <fx@gnu.org>
parents:
diff changeset
180 the minibuffer is active. This rule is to prevent recursive minibuffers
Dave Love <fx@gnu.org>
parents:
diff changeset
181 from confusing novice users. If you want to be able to use such
Dave Love <fx@gnu.org>
parents:
diff changeset
182 commands in the minibuffer, set the variable
Dave Love <fx@gnu.org>
parents:
diff changeset
183 @code{enable-recursive-minibuffers} to a non-@code{nil} value.
Dave Love <fx@gnu.org>
parents:
diff changeset
184
Dave Love <fx@gnu.org>
parents:
diff changeset
185 @node Completion
Dave Love <fx@gnu.org>
parents:
diff changeset
186 @section Completion
Dave Love <fx@gnu.org>
parents:
diff changeset
187 @cindex completion
Dave Love <fx@gnu.org>
parents:
diff changeset
188
Dave Love <fx@gnu.org>
parents:
diff changeset
189 For certain kinds of arguments, you can use @dfn{completion} to enter
Dave Love <fx@gnu.org>
parents:
diff changeset
190 the argument value. Completion means that you type part of the
Dave Love <fx@gnu.org>
parents:
diff changeset
191 argument, then Emacs visibly fills in the rest, or as much as
Dave Love <fx@gnu.org>
parents:
diff changeset
192 can be determined from the part you have typed.
Dave Love <fx@gnu.org>
parents:
diff changeset
193
Dave Love <fx@gnu.org>
parents:
diff changeset
194 When completion is available, certain keys---@key{TAB}, @key{RET}, and
46038
3d861934169e Completion operates on text before point.
Richard M. Stallman <rms@gnu.org>
parents: 44373
diff changeset
195 @key{SPC}---are rebound to complete the text in the minibuffer before point
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
196 into a longer string that it stands for, by matching it against a set of
Dave Love <fx@gnu.org>
parents:
diff changeset
197 @dfn{completion alternatives} provided by the command reading the
Dave Love <fx@gnu.org>
parents:
diff changeset
198 argument. @kbd{?} is defined to display a list of possible completions
Dave Love <fx@gnu.org>
parents:
diff changeset
199 of what you have inserted.
Dave Love <fx@gnu.org>
parents:
diff changeset
200
67395
9768435a278a (Completion Commands, Completion):
Richard M. Stallman <rms@gnu.org>
parents: 66991
diff changeset
201 For example, when @kbd{M-x} uses the minibuffer to read the name of
9768435a278a (Completion Commands, Completion):
Richard M. Stallman <rms@gnu.org>
parents: 66991
diff changeset
202 a command, it provides a list of all available Emacs command names to
46038
3d861934169e Completion operates on text before point.
Richard M. Stallman <rms@gnu.org>
parents: 44373
diff changeset
203 complete against. The completion keys match the minibuffer text
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
204 against all the command names, find any additional name characters
Dave Love <fx@gnu.org>
parents:
diff changeset
205 implied by the ones already present in the minibuffer, and add those
Dave Love <fx@gnu.org>
parents:
diff changeset
206 characters to the ones you have given. This is what makes it possible
Dave Love <fx@gnu.org>
parents:
diff changeset
207 to type @kbd{M-x ins @key{SPC} b @key{RET}} instead of @kbd{M-x
67395
9768435a278a (Completion Commands, Completion):
Richard M. Stallman <rms@gnu.org>
parents: 66991
diff changeset
208 insert-buffer @key{RET}} (for example). (@key{SPC} does not do
9768435a278a (Completion Commands, Completion):
Richard M. Stallman <rms@gnu.org>
parents: 66991
diff changeset
209 completion in reading file names, because it is common to use spaces
9768435a278a (Completion Commands, Completion):
Richard M. Stallman <rms@gnu.org>
parents: 66991
diff changeset
210 in file names on some systems.)
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
211
Dave Love <fx@gnu.org>
parents:
diff changeset
212 Case is normally significant in completion, because it is significant
Dave Love <fx@gnu.org>
parents:
diff changeset
213 in most of the names that you can complete (buffer names, file names and
Dave Love <fx@gnu.org>
parents:
diff changeset
214 command names). Thus, @samp{fo} does not complete to @samp{Foo}.
Dave Love <fx@gnu.org>
parents:
diff changeset
215 Completion does ignore case distinctions for certain arguments in which
Dave Love <fx@gnu.org>
parents:
diff changeset
216 case does not matter.
Dave Love <fx@gnu.org>
parents:
diff changeset
217
60798
e6d77fce1453 (Completion): Completion acts on text before point.
Richard M. Stallman <rms@gnu.org>
parents: 60473
diff changeset
218 Completion acts only on the text before point. If there is text in
e6d77fce1453 (Completion): Completion acts on text before point.
Richard M. Stallman <rms@gnu.org>
parents: 60473
diff changeset
219 the minibuffer after point---i.e., if you move point backward after
e6d77fce1453 (Completion): Completion acts on text before point.
Richard M. Stallman <rms@gnu.org>
parents: 60473
diff changeset
220 typing some text into the minibuffer---it remains unchanged.
e6d77fce1453 (Completion): Completion acts on text before point.
Richard M. Stallman <rms@gnu.org>
parents: 60473
diff changeset
221
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
222 @menu
54474
3264fbd6f6f5 (Completion): Add description for menu items.
Juri Linkov <juri@jurta.org>
parents: 52401
diff changeset
223 * Example: Completion Example. Examples of using completion.
3264fbd6f6f5 (Completion): Add description for menu items.
Juri Linkov <juri@jurta.org>
parents: 52401
diff changeset
224 * Commands: Completion Commands. A list of completion commands.
3264fbd6f6f5 (Completion): Add description for menu items.
Juri Linkov <juri@jurta.org>
parents: 52401
diff changeset
225 * Strict Completion:: Different types of completion.
3264fbd6f6f5 (Completion): Add description for menu items.
Juri Linkov <juri@jurta.org>
parents: 52401
diff changeset
226 * Options: Completion Options. Options for completion.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
227 @end menu
Dave Love <fx@gnu.org>
parents:
diff changeset
228
Dave Love <fx@gnu.org>
parents:
diff changeset
229 @node Completion Example
Dave Love <fx@gnu.org>
parents:
diff changeset
230 @subsection Completion Example
Dave Love <fx@gnu.org>
parents:
diff changeset
231
Dave Love <fx@gnu.org>
parents:
diff changeset
232 @kindex TAB @r{(completion)}
Dave Love <fx@gnu.org>
parents:
diff changeset
233 @findex minibuffer-complete
Dave Love <fx@gnu.org>
parents:
diff changeset
234 A concrete example may help here. If you type @kbd{M-x au @key{TAB}},
Dave Love <fx@gnu.org>
parents:
diff changeset
235 the @key{TAB} looks for alternatives (in this case, command names) that
Dave Love <fx@gnu.org>
parents:
diff changeset
236 start with @samp{au}. There are several, including
Dave Love <fx@gnu.org>
parents:
diff changeset
237 @code{auto-fill-mode} and @code{auto-save-mode}---but they are all the
Dave Love <fx@gnu.org>
parents:
diff changeset
238 same as far as @code{auto-}, so the @samp{au} in the minibuffer changes
Dave Love <fx@gnu.org>
parents:
diff changeset
239 to @samp{auto-}.@refill
Dave Love <fx@gnu.org>
parents:
diff changeset
240
Dave Love <fx@gnu.org>
parents:
diff changeset
241 If you type @key{TAB} again immediately, there are multiple
Dave Love <fx@gnu.org>
parents:
diff changeset
242 possibilities for the very next character---it could be any of
Dave Love <fx@gnu.org>
parents:
diff changeset
243 @samp{cfilrs}---so no more characters are added; instead, @key{TAB}
Dave Love <fx@gnu.org>
parents:
diff changeset
244 displays a list of all possible completions in another window.
Dave Love <fx@gnu.org>
parents:
diff changeset
245
Dave Love <fx@gnu.org>
parents:
diff changeset
246 If you go on to type @kbd{f @key{TAB}}, this @key{TAB} sees
Dave Love <fx@gnu.org>
parents:
diff changeset
247 @samp{auto-f}. The only command name starting this way is
Dave Love <fx@gnu.org>
parents:
diff changeset
248 @code{auto-fill-mode}, so completion fills in the rest of that. You now
Dave Love <fx@gnu.org>
parents:
diff changeset
249 have @samp{auto-fill-mode} in the minibuffer after typing just @kbd{au
Dave Love <fx@gnu.org>
parents:
diff changeset
250 @key{TAB} f @key{TAB}}. Note that @key{TAB} has this effect because in
Dave Love <fx@gnu.org>
parents:
diff changeset
251 the minibuffer it is bound to the command @code{minibuffer-complete}
Dave Love <fx@gnu.org>
parents:
diff changeset
252 when completion is available.
Dave Love <fx@gnu.org>
parents:
diff changeset
253
Dave Love <fx@gnu.org>
parents:
diff changeset
254 @node Completion Commands
Dave Love <fx@gnu.org>
parents:
diff changeset
255 @subsection Completion Commands
Dave Love <fx@gnu.org>
parents:
diff changeset
256
Dave Love <fx@gnu.org>
parents:
diff changeset
257 Here is a list of the completion commands defined in the minibuffer
Dave Love <fx@gnu.org>
parents:
diff changeset
258 when completion is available.
Dave Love <fx@gnu.org>
parents:
diff changeset
259
Dave Love <fx@gnu.org>
parents:
diff changeset
260 @table @kbd
Dave Love <fx@gnu.org>
parents:
diff changeset
261 @item @key{TAB}
46038
3d861934169e Completion operates on text before point.
Richard M. Stallman <rms@gnu.org>
parents: 44373
diff changeset
262 Complete the text before point in the minibuffer as much as possible
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
263 (@code{minibuffer-complete}).
Dave Love <fx@gnu.org>
parents:
diff changeset
264 @item @key{SPC}
67395
9768435a278a (Completion Commands, Completion):
Richard M. Stallman <rms@gnu.org>
parents: 66991
diff changeset
265 Complete the minibuffer text before point, but don't go beyond one
9768435a278a (Completion Commands, Completion):
Richard M. Stallman <rms@gnu.org>
parents: 66991
diff changeset
266 word (@code{minibuffer-complete-word}). @key{SPC} for completion is
9768435a278a (Completion Commands, Completion):
Richard M. Stallman <rms@gnu.org>
parents: 66991
diff changeset
267 not available when entering a file name, since some users often put
9768435a278a (Completion Commands, Completion):
Richard M. Stallman <rms@gnu.org>
parents: 66991
diff changeset
268 spaces in filenames.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
269 @item @key{RET}
Dave Love <fx@gnu.org>
parents:
diff changeset
270 Submit the text in the minibuffer as the argument, possibly completing
62333
80f8fd5fdea6 (Completion Commands): Correct reference.
Luc Teirlinck <teirllm@auburn.edu>
parents: 60798
diff changeset
271 first as described
80f8fd5fdea6 (Completion Commands): Correct reference.
Luc Teirlinck <teirllm@auburn.edu>
parents: 60798
diff changeset
272 @iftex
80f8fd5fdea6 (Completion Commands): Correct reference.
Luc Teirlinck <teirllm@auburn.edu>
parents: 60798
diff changeset
273 in the next subsection (@code{minibuffer-complete-and-exit}).
80f8fd5fdea6 (Completion Commands): Correct reference.
Luc Teirlinck <teirllm@auburn.edu>
parents: 60798
diff changeset
274 @end iftex
80f8fd5fdea6 (Completion Commands): Correct reference.
Luc Teirlinck <teirllm@auburn.edu>
parents: 60798
diff changeset
275 @ifnottex
80f8fd5fdea6 (Completion Commands): Correct reference.
Luc Teirlinck <teirllm@auburn.edu>
parents: 60798
diff changeset
276 in the next node (@code{minibuffer-complete-and-exit}). @xref{Strict
80f8fd5fdea6 (Completion Commands): Correct reference.
Luc Teirlinck <teirllm@auburn.edu>
parents: 60798
diff changeset
277 Completion}.
80f8fd5fdea6 (Completion Commands): Correct reference.
Luc Teirlinck <teirllm@auburn.edu>
parents: 60798
diff changeset
278 @end ifnottex
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
279 @item ?
38870
d44abb4e68b2 Don't use "print" for displaying a message.
Richard M. Stallman <rms@gnu.org>
parents: 38786
diff changeset
280 Display a list of all possible completions of the text in the minibuffer
64375
32f868f94f5a (Completion Commands): Fix command name for ?.
Richard M. Stallman <rms@gnu.org>
parents: 62333
diff changeset
281 (@code{minibuffer-completion-help}).
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
282 @end table
Dave Love <fx@gnu.org>
parents:
diff changeset
283
Dave Love <fx@gnu.org>
parents:
diff changeset
284 @kindex SPC
Dave Love <fx@gnu.org>
parents:
diff changeset
285 @findex minibuffer-complete-word
Dave Love <fx@gnu.org>
parents:
diff changeset
286 @key{SPC} completes much like @key{TAB}, but never goes beyond the
Dave Love <fx@gnu.org>
parents:
diff changeset
287 next hyphen or space. If you have @samp{auto-f} in the minibuffer and
Dave Love <fx@gnu.org>
parents:
diff changeset
288 type @key{SPC}, it finds that the completion is @samp{auto-fill-mode},
Dave Love <fx@gnu.org>
parents:
diff changeset
289 but it stops completing after @samp{fill-}. This gives
Dave Love <fx@gnu.org>
parents:
diff changeset
290 @samp{auto-fill-}. Another @key{SPC} at this point completes all the
38786
4d3fd773cd30 Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents: 38490
diff changeset
291 way to @samp{auto-fill-mode}. The command that implements this
4d3fd773cd30 Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents: 38490
diff changeset
292 behavior is called @code{minibuffer-complete-word}.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
293
Dave Love <fx@gnu.org>
parents:
diff changeset
294 Here are some commands you can use to choose a completion from a
Dave Love <fx@gnu.org>
parents:
diff changeset
295 window that displays a list of completions:
Dave Love <fx@gnu.org>
parents:
diff changeset
296
Dave Love <fx@gnu.org>
parents:
diff changeset
297 @table @kbd
Dave Love <fx@gnu.org>
parents:
diff changeset
298 @findex mouse-choose-completion
60245
78a1812a9fd5 (Minibuffer): Prompts are highlighted.
Richard M. Stallman <rms@gnu.org>
parents: 59798
diff changeset
299 @item Mouse-1
78a1812a9fd5 (Minibuffer): Prompts are highlighted.
Richard M. Stallman <rms@gnu.org>
parents: 59798
diff changeset
300 @itemx Mouse-2
78a1812a9fd5 (Minibuffer): Prompts are highlighted.
Richard M. Stallman <rms@gnu.org>
parents: 59798
diff changeset
301 Clicking mouse button 1 or 2 on a completion in the list of possible
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
302 completions chooses that completion (@code{mouse-choose-completion}).
38461
23f63206a867 Proofreading fixes from Chris Green <chris_e_green@yahoo.com>.
Eli Zaretskii <eliz@gnu.org>
parents: 36727
diff changeset
303 You normally use this command while point is in the minibuffer, but you
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
304 must click in the list of completions, not in the minibuffer itself.
Dave Love <fx@gnu.org>
parents:
diff changeset
305
Dave Love <fx@gnu.org>
parents:
diff changeset
306 @findex switch-to-completions
Dave Love <fx@gnu.org>
parents:
diff changeset
307 @item @key{PRIOR}
Dave Love <fx@gnu.org>
parents:
diff changeset
308 @itemx M-v
Dave Love <fx@gnu.org>
parents:
diff changeset
309 Typing @key{PRIOR} or @key{PAGE-UP}, or @kbd{M-v}, while in the
Dave Love <fx@gnu.org>
parents:
diff changeset
310 minibuffer, selects the window showing the completion list buffer
Dave Love <fx@gnu.org>
parents:
diff changeset
311 (@code{switch-to-completions}). This paves the way for using the
Dave Love <fx@gnu.org>
parents:
diff changeset
312 commands below. (Selecting that window in the usual ways has the same
Dave Love <fx@gnu.org>
parents:
diff changeset
313 effect, but this way is more convenient.)
Dave Love <fx@gnu.org>
parents:
diff changeset
314
Dave Love <fx@gnu.org>
parents:
diff changeset
315 @findex choose-completion
Dave Love <fx@gnu.org>
parents:
diff changeset
316 @item @key{RET}
Dave Love <fx@gnu.org>
parents:
diff changeset
317 Typing @key{RET} @emph{in the completion list buffer} chooses the
Dave Love <fx@gnu.org>
parents:
diff changeset
318 completion that point is in or next to (@code{choose-completion}). To
Dave Love <fx@gnu.org>
parents:
diff changeset
319 use this command, you must first switch windows to the window that shows
Dave Love <fx@gnu.org>
parents:
diff changeset
320 the list of completions.
Dave Love <fx@gnu.org>
parents:
diff changeset
321
Dave Love <fx@gnu.org>
parents:
diff changeset
322 @findex next-completion
Dave Love <fx@gnu.org>
parents:
diff changeset
323 @item @key{RIGHT}
Dave Love <fx@gnu.org>
parents:
diff changeset
324 Typing the right-arrow key @key{RIGHT} @emph{in the completion list
Dave Love <fx@gnu.org>
parents:
diff changeset
325 buffer} moves point to the following completion (@code{next-completion}).
Dave Love <fx@gnu.org>
parents:
diff changeset
326
Dave Love <fx@gnu.org>
parents:
diff changeset
327 @findex previous-completion
Dave Love <fx@gnu.org>
parents:
diff changeset
328 @item @key{LEFT}
Dave Love <fx@gnu.org>
parents:
diff changeset
329 Typing the left-arrow key @key{LEFT} @emph{in the completion list
Dave Love <fx@gnu.org>
parents:
diff changeset
330 buffer} moves point toward the beginning of the buffer, to the previous
Dave Love <fx@gnu.org>
parents:
diff changeset
331 completion (@code{previous-completion}).
Dave Love <fx@gnu.org>
parents:
diff changeset
332 @end table
Dave Love <fx@gnu.org>
parents:
diff changeset
333
Dave Love <fx@gnu.org>
parents:
diff changeset
334 @node Strict Completion
Dave Love <fx@gnu.org>
parents:
diff changeset
335 @subsection Strict Completion
Dave Love <fx@gnu.org>
parents:
diff changeset
336
Dave Love <fx@gnu.org>
parents:
diff changeset
337 There are three different ways that @key{RET} can work in completing
Dave Love <fx@gnu.org>
parents:
diff changeset
338 minibuffers, depending on how the argument will be used.
Dave Love <fx@gnu.org>
parents:
diff changeset
339
Dave Love <fx@gnu.org>
parents:
diff changeset
340 @itemize @bullet
Dave Love <fx@gnu.org>
parents:
diff changeset
341 @item
Dave Love <fx@gnu.org>
parents:
diff changeset
342 @dfn{Strict} completion is used when it is meaningless to give any
Dave Love <fx@gnu.org>
parents:
diff changeset
343 argument except one of the known alternatives. For example, when
Dave Love <fx@gnu.org>
parents:
diff changeset
344 @kbd{C-x k} reads the name of a buffer to kill, it is meaningless to
Dave Love <fx@gnu.org>
parents:
diff changeset
345 give anything but the name of an existing buffer. In strict
Dave Love <fx@gnu.org>
parents:
diff changeset
346 completion, @key{RET} refuses to exit if the text in the minibuffer
Dave Love <fx@gnu.org>
parents:
diff changeset
347 does not complete to an exact match.
Dave Love <fx@gnu.org>
parents:
diff changeset
348
Dave Love <fx@gnu.org>
parents:
diff changeset
349 @item
Dave Love <fx@gnu.org>
parents:
diff changeset
350 @dfn{Cautious} completion is similar to strict completion, except that
Dave Love <fx@gnu.org>
parents:
diff changeset
351 @key{RET} exits only if the text was an exact match already, not
Dave Love <fx@gnu.org>
parents:
diff changeset
352 needing completion. If the text is not an exact match, @key{RET} does
Dave Love <fx@gnu.org>
parents:
diff changeset
353 not exit, but it does complete the text. If it completes to an exact
Dave Love <fx@gnu.org>
parents:
diff changeset
354 match, a second @key{RET} will exit.
Dave Love <fx@gnu.org>
parents:
diff changeset
355
Dave Love <fx@gnu.org>
parents:
diff changeset
356 Cautious completion is used for reading file names for files that must
Dave Love <fx@gnu.org>
parents:
diff changeset
357 already exist.
Dave Love <fx@gnu.org>
parents:
diff changeset
358
Dave Love <fx@gnu.org>
parents:
diff changeset
359 @item
Dave Love <fx@gnu.org>
parents:
diff changeset
360 @dfn{Permissive} completion is used when any string whatever is
Dave Love <fx@gnu.org>
parents:
diff changeset
361 meaningful, and the list of completion alternatives is just a guide.
Dave Love <fx@gnu.org>
parents:
diff changeset
362 For example, when @kbd{C-x C-f} reads the name of a file to visit, any
Dave Love <fx@gnu.org>
parents:
diff changeset
363 file name is allowed, in case you want to create a file. In
Dave Love <fx@gnu.org>
parents:
diff changeset
364 permissive completion, @key{RET} takes the text in the minibuffer
Dave Love <fx@gnu.org>
parents:
diff changeset
365 exactly as given, without completing it.
Dave Love <fx@gnu.org>
parents:
diff changeset
366 @end itemize
Dave Love <fx@gnu.org>
parents:
diff changeset
367
Dave Love <fx@gnu.org>
parents:
diff changeset
368 The completion commands display a list of all possible completions in
Dave Love <fx@gnu.org>
parents:
diff changeset
369 a window whenever there is more than one possibility for the very next
Dave Love <fx@gnu.org>
parents:
diff changeset
370 character. Also, typing @kbd{?} explicitly requests such a list. If
Dave Love <fx@gnu.org>
parents:
diff changeset
371 the list of completions is long, you can scroll it with @kbd{C-M-v}
Dave Love <fx@gnu.org>
parents:
diff changeset
372 (@pxref{Other Window}).
Dave Love <fx@gnu.org>
parents:
diff changeset
373
Dave Love <fx@gnu.org>
parents:
diff changeset
374 @node Completion Options
Dave Love <fx@gnu.org>
parents:
diff changeset
375 @subsection Completion Options
Dave Love <fx@gnu.org>
parents:
diff changeset
376
Dave Love <fx@gnu.org>
parents:
diff changeset
377 @vindex completion-ignored-extensions
36289
931b5c1e2d14 (Completion Options): Add an index for "ignored file names".
Eli Zaretskii <eliz@gnu.org>
parents: 36167
diff changeset
378 @cindex ignored file names, in completion
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
379 When completion is done on file names, certain file names are usually
Dave Love <fx@gnu.org>
parents:
diff changeset
380 ignored. The variable @code{completion-ignored-extensions} contains a
Dave Love <fx@gnu.org>
parents:
diff changeset
381 list of strings; a file whose name ends in any of those strings is
Dave Love <fx@gnu.org>
parents:
diff changeset
382 ignored as a possible completion. The standard value of this variable
Dave Love <fx@gnu.org>
parents:
diff changeset
383 has several elements including @code{".o"}, @code{".elc"}, @code{".dvi"}
Dave Love <fx@gnu.org>
parents:
diff changeset
384 and @code{"~"}. The effect is that, for example, @samp{foo} can
Dave Love <fx@gnu.org>
parents:
diff changeset
385 complete to @samp{foo.c} even though @samp{foo.o} exists as well.
Dave Love <fx@gnu.org>
parents:
diff changeset
386 However, if @emph{all} the possible completions end in ``ignored''
Dave Love <fx@gnu.org>
parents:
diff changeset
387 strings, then they are not ignored. Ignored extensions do not apply to
Dave Love <fx@gnu.org>
parents:
diff changeset
388 lists of completions---those always mention all possible completions.
Dave Love <fx@gnu.org>
parents:
diff changeset
389
39880
de2f745df406 (Completion Options): Document the significance of a trailing slash
Eli Zaretskii <eliz@gnu.org>
parents: 39265
diff changeset
390 If an element of the list in @code{completion-ignored-extensions} ends
de2f745df406 (Completion Options): Document the significance of a trailing slash
Eli Zaretskii <eliz@gnu.org>
parents: 39265
diff changeset
391 in a slash @file{/}, it indicates a subdirectory that should be ignored
68458
eab2da67a471 Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents: 67395
diff changeset
392 when completing file names. Elements of
39880
de2f745df406 (Completion Options): Document the significance of a trailing slash
Eli Zaretskii <eliz@gnu.org>
parents: 39265
diff changeset
393 @code{completion-ignored-extensions} which do not end in a slash are
de2f745df406 (Completion Options): Document the significance of a trailing slash
Eli Zaretskii <eliz@gnu.org>
parents: 39265
diff changeset
394 never considered when a completion candidate is a directory; thus,
de2f745df406 (Completion Options): Document the significance of a trailing slash
Eli Zaretskii <eliz@gnu.org>
parents: 39265
diff changeset
395 completion returns directories whose names end in @file{.elc} even
68458
eab2da67a471 Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents: 67395
diff changeset
396 though there's an element @code{".elc"} in the list.
39880
de2f745df406 (Completion Options): Document the significance of a trailing slash
Eli Zaretskii <eliz@gnu.org>
parents: 39265
diff changeset
397
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
398 @vindex completion-auto-help
38786
4d3fd773cd30 Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents: 38490
diff changeset
399 Normally, a completion command that cannot determine even one
4d3fd773cd30 Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents: 38490
diff changeset
400 additional character automatically displays a list of all possible
38461
23f63206a867 Proofreading fixes from Chris Green <chris_e_green@yahoo.com>.
Eli Zaretskii <eliz@gnu.org>
parents: 36727
diff changeset
401 completions. If the variable @code{completion-auto-help} is set to
38786
4d3fd773cd30 Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents: 38490
diff changeset
402 @code{nil}, this automatic display is disabled, so you must type
4d3fd773cd30 Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents: 38490
diff changeset
403 @kbd{?} to display the list of completions.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
404
28129
25e19c5c91f8 More on partial completion.
Dave Love <fx@gnu.org>
parents: 27216
diff changeset
405 @cindex Partial Completion mode
25e19c5c91f8 More on partial completion.
Dave Love <fx@gnu.org>
parents: 27216
diff changeset
406 @vindex partial-completion-mode
25e19c5c91f8 More on partial completion.
Dave Love <fx@gnu.org>
parents: 27216
diff changeset
407 @findex partial-completion-mode
36166
7ce22edfb862 Clean up max-mini-window-height and Partial Completion mode.
Richard M. Stallman <rms@gnu.org>
parents: 33310
diff changeset
408 Partial Completion mode implements a more powerful kind of
7ce22edfb862 Clean up max-mini-window-height and Partial Completion mode.
Richard M. Stallman <rms@gnu.org>
parents: 33310
diff changeset
409 completion that can complete multiple words in parallel. For example,
7ce22edfb862 Clean up max-mini-window-height and Partial Completion mode.
Richard M. Stallman <rms@gnu.org>
parents: 33310
diff changeset
410 it can complete the command name abbreviation @code{p-b} into
7ce22edfb862 Clean up max-mini-window-height and Partial Completion mode.
Richard M. Stallman <rms@gnu.org>
parents: 33310
diff changeset
411 @code{print-buffer}, because no other command starts with two words
7ce22edfb862 Clean up max-mini-window-height and Partial Completion mode.
Richard M. Stallman <rms@gnu.org>
parents: 33310
diff changeset
412 whose initials are @samp{p} and @samp{b}.
7ce22edfb862 Clean up max-mini-window-height and Partial Completion mode.
Richard M. Stallman <rms@gnu.org>
parents: 33310
diff changeset
413
7ce22edfb862 Clean up max-mini-window-height and Partial Completion mode.
Richard M. Stallman <rms@gnu.org>
parents: 33310
diff changeset
414 Partial completion of directories in file names uses @samp{*} to
7ce22edfb862 Clean up max-mini-window-height and Partial Completion mode.
Richard M. Stallman <rms@gnu.org>
parents: 33310
diff changeset
415 indicate the places for completion; thus, @file{/u*/b*/f*} might
7ce22edfb862 Clean up max-mini-window-height and Partial Completion mode.
Richard M. Stallman <rms@gnu.org>
parents: 33310
diff changeset
416 complete to @file{/usr/bin/foo}.
7ce22edfb862 Clean up max-mini-window-height and Partial Completion mode.
Richard M. Stallman <rms@gnu.org>
parents: 33310
diff changeset
417
70487
737e59692915 * mini.texi (Completion Options):
Michael Albinus <michael.albinus@gmx.de>
parents: 68639
diff changeset
418 For remote files, partial completion enables completion of methods,
737e59692915 * mini.texi (Completion Options):
Michael Albinus <michael.albinus@gmx.de>
parents: 68639
diff changeset
419 user names and host names. @xref{Remote Files}.
737e59692915 * mini.texi (Completion Options):
Michael Albinus <michael.albinus@gmx.de>
parents: 68639
diff changeset
420
36166
7ce22edfb862 Clean up max-mini-window-height and Partial Completion mode.
Richard M. Stallman <rms@gnu.org>
parents: 33310
diff changeset
421 To enable this mode, use the command @kbd{M-x
59798
0816b427495a Don't say just "option" when talking about variables.
Richard M. Stallman <rms@gnu.org>
parents: 57080
diff changeset
422 partial-completion-mode}, or customize the variable
36166
7ce22edfb862 Clean up max-mini-window-height and Partial Completion mode.
Richard M. Stallman <rms@gnu.org>
parents: 33310
diff changeset
423 @code{partial-completion-mode}. This binds the partial completion
7ce22edfb862 Clean up max-mini-window-height and Partial Completion mode.
Richard M. Stallman <rms@gnu.org>
parents: 33310
diff changeset
424 commands to @key{TAB}, @key{SPC}, @key{RET}, and @kbd{?}. The usual
60431
a594df6fa00e (Completion Options): C-M-i like M-TAB.
Richard M. Stallman <rms@gnu.org>
parents: 60245
diff changeset
425 completion commands are available on @kbd{M-@key{TAB}} (or
60473
737e494abed6 (Completion Options): Fix typo.
Luc Teirlinck <teirllm@auburn.edu>
parents: 60431
diff changeset
426 @kbd{C-M-i}), @kbd{M-@key{SPC}}, @kbd{M-@key{RET}} and @kbd{M-?}.
36166
7ce22edfb862 Clean up max-mini-window-height and Partial Completion mode.
Richard M. Stallman <rms@gnu.org>
parents: 33310
diff changeset
427
28129
25e19c5c91f8 More on partial completion.
Dave Love <fx@gnu.org>
parents: 27216
diff changeset
428 @vindex PC-include-file-path
25e19c5c91f8 More on partial completion.
Dave Love <fx@gnu.org>
parents: 27216
diff changeset
429 @vindex PC-disable-includes
36166
7ce22edfb862 Clean up max-mini-window-height and Partial Completion mode.
Richard M. Stallman <rms@gnu.org>
parents: 33310
diff changeset
430 Another feature of Partial Completion mode is to extend
62333
80f8fd5fdea6 (Completion Commands): Correct reference.
Luc Teirlinck <teirllm@auburn.edu>
parents: 60798
diff changeset
431 @code{find-file} so that @samp{<@var{include}>} stands for the
36166
7ce22edfb862 Clean up max-mini-window-height and Partial Completion mode.
Richard M. Stallman <rms@gnu.org>
parents: 33310
diff changeset
432 file named @var{include} in some directory in the path
7ce22edfb862 Clean up max-mini-window-height and Partial Completion mode.
Richard M. Stallman <rms@gnu.org>
parents: 33310
diff changeset
433 @code{PC-include-file-path}. If you set @code{PC-disable-includes} to
36653
fb78f82ca9c8 (Completion Options): Fix a typo.
Eli Zaretskii <eliz@gnu.org>
parents: 36383
diff changeset
434 non-@code{nil}, this feature is disabled.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
435
Dave Love <fx@gnu.org>
parents:
diff changeset
436 @cindex Icomplete mode
28129
25e19c5c91f8 More on partial completion.
Dave Love <fx@gnu.org>
parents: 27216
diff changeset
437 @findex icomplete-mode
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
438 Icomplete mode presents a constantly-updated display that tells you
Dave Love <fx@gnu.org>
parents:
diff changeset
439 what completions are available for the text you've entered so far. The
Dave Love <fx@gnu.org>
parents:
diff changeset
440 command to enable or disable this minor mode is @kbd{M-x
Dave Love <fx@gnu.org>
parents:
diff changeset
441 icomplete-mode}.
Dave Love <fx@gnu.org>
parents:
diff changeset
442
Dave Love <fx@gnu.org>
parents:
diff changeset
443 @node Minibuffer History
Dave Love <fx@gnu.org>
parents:
diff changeset
444 @section Minibuffer History
Dave Love <fx@gnu.org>
parents:
diff changeset
445 @cindex minibuffer history
Dave Love <fx@gnu.org>
parents:
diff changeset
446 @cindex history of minibuffer input
Dave Love <fx@gnu.org>
parents:
diff changeset
447
Dave Love <fx@gnu.org>
parents:
diff changeset
448 Every argument that you enter with the minibuffer is saved on a
Dave Love <fx@gnu.org>
parents:
diff changeset
449 @dfn{minibuffer history list} so that you can use it again later in
Dave Love <fx@gnu.org>
parents:
diff changeset
450 another argument. Special commands load the text of an earlier argument
Dave Love <fx@gnu.org>
parents:
diff changeset
451 in the minibuffer. They discard the old minibuffer contents, so you can
Dave Love <fx@gnu.org>
parents:
diff changeset
452 think of them as moving through the history of previous arguments.
Dave Love <fx@gnu.org>
parents:
diff changeset
453
Dave Love <fx@gnu.org>
parents:
diff changeset
454 @table @kbd
Dave Love <fx@gnu.org>
parents:
diff changeset
455 @item @key{UP}
Dave Love <fx@gnu.org>
parents:
diff changeset
456 @itemx M-p
Dave Love <fx@gnu.org>
parents:
diff changeset
457 Move to the next earlier argument string saved in the minibuffer history
Dave Love <fx@gnu.org>
parents:
diff changeset
458 (@code{previous-history-element}).
Dave Love <fx@gnu.org>
parents:
diff changeset
459 @item @key{DOWN}
Dave Love <fx@gnu.org>
parents:
diff changeset
460 @itemx M-n
Dave Love <fx@gnu.org>
parents:
diff changeset
461 Move to the next later argument string saved in the minibuffer history
Dave Love <fx@gnu.org>
parents:
diff changeset
462 (@code{next-history-element}).
Dave Love <fx@gnu.org>
parents:
diff changeset
463 @item M-r @var{regexp} @key{RET}
Dave Love <fx@gnu.org>
parents:
diff changeset
464 Move to an earlier saved argument in the minibuffer history that has a
Dave Love <fx@gnu.org>
parents:
diff changeset
465 match for @var{regexp} (@code{previous-matching-history-element}).
Dave Love <fx@gnu.org>
parents:
diff changeset
466 @item M-s @var{regexp} @key{RET}
Dave Love <fx@gnu.org>
parents:
diff changeset
467 Move to a later saved argument in the minibuffer history that has a
Dave Love <fx@gnu.org>
parents:
diff changeset
468 match for @var{regexp} (@code{next-matching-history-element}).
Dave Love <fx@gnu.org>
parents:
diff changeset
469 @end table
Dave Love <fx@gnu.org>
parents:
diff changeset
470
Dave Love <fx@gnu.org>
parents:
diff changeset
471 @kindex M-p @r{(minibuffer history)}
Dave Love <fx@gnu.org>
parents:
diff changeset
472 @kindex M-n @r{(minibuffer history)}
Dave Love <fx@gnu.org>
parents:
diff changeset
473 @findex next-history-element
Dave Love <fx@gnu.org>
parents:
diff changeset
474 @findex previous-history-element
Dave Love <fx@gnu.org>
parents:
diff changeset
475 The simplest way to reuse the saved arguments in the history list is
Dave Love <fx@gnu.org>
parents:
diff changeset
476 to move through the history list one element at a time. While in the
60245
78a1812a9fd5 (Minibuffer): Prompts are highlighted.
Richard M. Stallman <rms@gnu.org>
parents: 59798
diff changeset
477 minibuffer, use @kbd{M-p} or up-arrow
78a1812a9fd5 (Minibuffer): Prompts are highlighted.
Richard M. Stallman <rms@gnu.org>
parents: 59798
diff changeset
478 (@code{previous-history-element}) to ``move to'' the next earlier
78a1812a9fd5 (Minibuffer): Prompts are highlighted.
Richard M. Stallman <rms@gnu.org>
parents: 59798
diff changeset
479 minibuffer input, and use @kbd{M-n} or down-arrow
78a1812a9fd5 (Minibuffer): Prompts are highlighted.
Richard M. Stallman <rms@gnu.org>
parents: 59798
diff changeset
480 (@code{next-history-element}) to ``move to'' the next later input.
78a1812a9fd5 (Minibuffer): Prompts are highlighted.
Richard M. Stallman <rms@gnu.org>
parents: 59798
diff changeset
481 These commands don't move the cursor, they bring different saved
78a1812a9fd5 (Minibuffer): Prompts are highlighted.
Richard M. Stallman <rms@gnu.org>
parents: 59798
diff changeset
482 strings into the minibuffer. But you can think of them as ``moving''
78a1812a9fd5 (Minibuffer): Prompts are highlighted.
Richard M. Stallman <rms@gnu.org>
parents: 59798
diff changeset
483 through the history list.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
484
Dave Love <fx@gnu.org>
parents:
diff changeset
485 The previous input that you fetch from the history entirely replaces
Dave Love <fx@gnu.org>
parents:
diff changeset
486 the contents of the minibuffer. To use it as the argument, exit the
Dave Love <fx@gnu.org>
parents:
diff changeset
487 minibuffer as usual with @key{RET}. You can also edit the text before
Dave Love <fx@gnu.org>
parents:
diff changeset
488 you reuse it; this does not change the history element that you
Dave Love <fx@gnu.org>
parents:
diff changeset
489 ``moved'' to, but your new argument does go at the end of the history
Dave Love <fx@gnu.org>
parents:
diff changeset
490 list in its own right.
Dave Love <fx@gnu.org>
parents:
diff changeset
491
68458
eab2da67a471 Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents: 67395
diff changeset
492 For many minibuffer arguments there is a ``default'' value. Then
eab2da67a471 Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents: 67395
diff changeset
493 you can insert the default value into the minibuffer as text by using
eab2da67a471 Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents: 67395
diff changeset
494 @kbd{M-n} to move ``into the future'' in the history.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
495
Dave Love <fx@gnu.org>
parents:
diff changeset
496 @findex previous-matching-history-element
Dave Love <fx@gnu.org>
parents:
diff changeset
497 @findex next-matching-history-element
Dave Love <fx@gnu.org>
parents:
diff changeset
498 @kindex M-r @r{(minibuffer history)}
Dave Love <fx@gnu.org>
parents:
diff changeset
499 @kindex M-s @r{(minibuffer history)}
Dave Love <fx@gnu.org>
parents:
diff changeset
500 There are also commands to search forward or backward through the
Dave Love <fx@gnu.org>
parents:
diff changeset
501 history; they search for history elements that match a regular
Dave Love <fx@gnu.org>
parents:
diff changeset
502 expression that you specify with the minibuffer. @kbd{M-r}
Dave Love <fx@gnu.org>
parents:
diff changeset
503 (@code{previous-matching-history-element}) searches older elements in
Dave Love <fx@gnu.org>
parents:
diff changeset
504 the history, while @kbd{M-s} (@code{next-matching-history-element})
Dave Love <fx@gnu.org>
parents:
diff changeset
505 searches newer elements. By special dispensation, these commands can
Dave Love <fx@gnu.org>
parents:
diff changeset
506 use the minibuffer to read their arguments even though you are already
Dave Love <fx@gnu.org>
parents:
diff changeset
507 in the minibuffer when you issue them. As with incremental searching,
36383
d26ad6e1f13f Change "filename" to "file name" or "file-name".
Eli Zaretskii <eliz@gnu.org>
parents: 36289
diff changeset
508 an upper-case letter in the regular expression makes the search
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
509 case-sensitive (@pxref{Search Case}).
Dave Love <fx@gnu.org>
parents:
diff changeset
510
Dave Love <fx@gnu.org>
parents:
diff changeset
511 @ignore
Dave Love <fx@gnu.org>
parents:
diff changeset
512 We may change the precise way these commands read their arguments.
Dave Love <fx@gnu.org>
parents:
diff changeset
513 Perhaps they will search for a match for the string given so far in the
Dave Love <fx@gnu.org>
parents:
diff changeset
514 minibuffer; perhaps they will search for a literal match rather than a
Dave Love <fx@gnu.org>
parents:
diff changeset
515 regular expression match; perhaps they will only accept matches at the
Dave Love <fx@gnu.org>
parents:
diff changeset
516 beginning of a history element; perhaps they will read the string to
Dave Love <fx@gnu.org>
parents:
diff changeset
517 search for incrementally like @kbd{C-s}. To find out what interface is
Dave Love <fx@gnu.org>
parents:
diff changeset
518 actually available, type @kbd{C-h f previous-matching-history-element}.
Dave Love <fx@gnu.org>
parents:
diff changeset
519 @end ignore
Dave Love <fx@gnu.org>
parents:
diff changeset
520
Dave Love <fx@gnu.org>
parents:
diff changeset
521 All uses of the minibuffer record your input on a history list, but
Dave Love <fx@gnu.org>
parents:
diff changeset
522 there are separate history lists for different kinds of arguments. For
Dave Love <fx@gnu.org>
parents:
diff changeset
523 example, there is a list for file names, used by all the commands that
Dave Love <fx@gnu.org>
parents:
diff changeset
524 read file names. (As a special feature, this history list records
Dave Love <fx@gnu.org>
parents:
diff changeset
525 the absolute file name, no more and no less, even if that is not how
Dave Love <fx@gnu.org>
parents:
diff changeset
526 you entered the file name.)
Dave Love <fx@gnu.org>
parents:
diff changeset
527
Dave Love <fx@gnu.org>
parents:
diff changeset
528 There are several other very specific history lists, including one for
Dave Love <fx@gnu.org>
parents:
diff changeset
529 command names read by @kbd{M-x}, one for buffer names, one for arguments
Dave Love <fx@gnu.org>
parents:
diff changeset
530 of commands like @code{query-replace}, and one for compilation commands
Dave Love <fx@gnu.org>
parents:
diff changeset
531 read by @code{compile}. Finally, there is one ``miscellaneous'' history
Dave Love <fx@gnu.org>
parents:
diff changeset
532 list that most minibuffer arguments use.
Dave Love <fx@gnu.org>
parents:
diff changeset
533
Dave Love <fx@gnu.org>
parents:
diff changeset
534 @vindex history-length
Dave Love <fx@gnu.org>
parents:
diff changeset
535 The variable @code{history-length} specifies the maximum length of a
Dave Love <fx@gnu.org>
parents:
diff changeset
536 minibuffer history list; once a list gets that long, the oldest element
Dave Love <fx@gnu.org>
parents:
diff changeset
537 is deleted each time an element is added. If the value of
Dave Love <fx@gnu.org>
parents:
diff changeset
538 @code{history-length} is @code{t}, though, there is no maximum length
Dave Love <fx@gnu.org>
parents:
diff changeset
539 and elements are never deleted.
Dave Love <fx@gnu.org>
parents:
diff changeset
540
57017
9f99ae07c452 (Minibuffer History): Add `history-delete-duplicates'.
Juri Linkov <juri@jurta.org>
parents: 54474
diff changeset
541 @vindex history-delete-duplicates
9f99ae07c452 (Minibuffer History): Add `history-delete-duplicates'.
Juri Linkov <juri@jurta.org>
parents: 54474
diff changeset
542 The variable @code{history-delete-duplicates} specifies whether to
9f99ae07c452 (Minibuffer History): Add `history-delete-duplicates'.
Juri Linkov <juri@jurta.org>
parents: 54474
diff changeset
543 delete duplicates in history. If the value of @code{history-delete-duplicates}
9f99ae07c452 (Minibuffer History): Add `history-delete-duplicates'.
Juri Linkov <juri@jurta.org>
parents: 54474
diff changeset
544 is @code{t}, that means when adding a new history element, all
9f99ae07c452 (Minibuffer History): Add `history-delete-duplicates'.
Juri Linkov <juri@jurta.org>
parents: 54474
diff changeset
545 previous identical elements are deleted.
9f99ae07c452 (Minibuffer History): Add `history-delete-duplicates'.
Juri Linkov <juri@jurta.org>
parents: 54474
diff changeset
546
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
547 @node Repetition
Dave Love <fx@gnu.org>
parents:
diff changeset
548 @section Repeating Minibuffer Commands
Dave Love <fx@gnu.org>
parents:
diff changeset
549 @cindex command history
Dave Love <fx@gnu.org>
parents:
diff changeset
550 @cindex history of commands
Dave Love <fx@gnu.org>
parents:
diff changeset
551
Dave Love <fx@gnu.org>
parents:
diff changeset
552 Every command that uses the minibuffer at least once is recorded on a
Dave Love <fx@gnu.org>
parents:
diff changeset
553 special history list, together with the values of its arguments, so that
Dave Love <fx@gnu.org>
parents:
diff changeset
554 you can repeat the entire command. In particular, every use of
Dave Love <fx@gnu.org>
parents:
diff changeset
555 @kbd{M-x} is recorded there, since @kbd{M-x} uses the minibuffer to read
Dave Love <fx@gnu.org>
parents:
diff changeset
556 the command name.
Dave Love <fx@gnu.org>
parents:
diff changeset
557
Dave Love <fx@gnu.org>
parents:
diff changeset
558 @findex list-command-history
Dave Love <fx@gnu.org>
parents:
diff changeset
559 @table @kbd
Dave Love <fx@gnu.org>
parents:
diff changeset
560 @item C-x @key{ESC} @key{ESC}
Dave Love <fx@gnu.org>
parents:
diff changeset
561 Re-execute a recent minibuffer command (@code{repeat-complex-command}).
Dave Love <fx@gnu.org>
parents:
diff changeset
562 @item M-x list-command-history
Dave Love <fx@gnu.org>
parents:
diff changeset
563 Display the entire command history, showing all the commands
Dave Love <fx@gnu.org>
parents:
diff changeset
564 @kbd{C-x @key{ESC} @key{ESC}} can repeat, most recent first.
Dave Love <fx@gnu.org>
parents:
diff changeset
565 @end table
Dave Love <fx@gnu.org>
parents:
diff changeset
566
Dave Love <fx@gnu.org>
parents:
diff changeset
567 @kindex C-x ESC ESC
Dave Love <fx@gnu.org>
parents:
diff changeset
568 @findex repeat-complex-command
Dave Love <fx@gnu.org>
parents:
diff changeset
569 @kbd{C-x @key{ESC} @key{ESC}} is used to re-execute a recent
Dave Love <fx@gnu.org>
parents:
diff changeset
570 minibuffer-using command. With no argument, it repeats the last such
Dave Love <fx@gnu.org>
parents:
diff changeset
571 command. A numeric argument specifies which command to repeat; one
Dave Love <fx@gnu.org>
parents:
diff changeset
572 means the last one, and larger numbers specify earlier ones.
Dave Love <fx@gnu.org>
parents:
diff changeset
573
Dave Love <fx@gnu.org>
parents:
diff changeset
574 @kbd{C-x @key{ESC} @key{ESC}} works by turning the previous command
Dave Love <fx@gnu.org>
parents:
diff changeset
575 into a Lisp expression and then entering a minibuffer initialized with
Dave Love <fx@gnu.org>
parents:
diff changeset
576 the text for that expression. If you type just @key{RET}, the command
Dave Love <fx@gnu.org>
parents:
diff changeset
577 is repeated as before. You can also change the command by editing the
Dave Love <fx@gnu.org>
parents:
diff changeset
578 Lisp expression. Whatever expression you finally submit is what will be
Dave Love <fx@gnu.org>
parents:
diff changeset
579 executed. The repeated command is added to the front of the command
Dave Love <fx@gnu.org>
parents:
diff changeset
580 history unless it is identical to the most recently executed command
Dave Love <fx@gnu.org>
parents:
diff changeset
581 already there.
Dave Love <fx@gnu.org>
parents:
diff changeset
582
Dave Love <fx@gnu.org>
parents:
diff changeset
583 Even if you don't understand Lisp syntax, it will probably be obvious
Dave Love <fx@gnu.org>
parents:
diff changeset
584 which command is displayed for repetition. If you do not change the
Dave Love <fx@gnu.org>
parents:
diff changeset
585 text, it will repeat exactly as before.
Dave Love <fx@gnu.org>
parents:
diff changeset
586
Dave Love <fx@gnu.org>
parents:
diff changeset
587 Once inside the minibuffer for @kbd{C-x @key{ESC} @key{ESC}}, you can
Dave Love <fx@gnu.org>
parents:
diff changeset
588 use the minibuffer history commands (@kbd{M-p}, @kbd{M-n}, @kbd{M-r},
Dave Love <fx@gnu.org>
parents:
diff changeset
589 @kbd{M-s}; @pxref{Minibuffer History}) to move through the history list
Dave Love <fx@gnu.org>
parents:
diff changeset
590 of saved entire commands. After finding the desired previous command,
Dave Love <fx@gnu.org>
parents:
diff changeset
591 you can edit its expression as usual and then resubmit it by typing
Dave Love <fx@gnu.org>
parents:
diff changeset
592 @key{RET} as usual.
Dave Love <fx@gnu.org>
parents:
diff changeset
593
57080
82fe8e8f2ffe (Repetition): Rename isearch-resume-enabled to
Kim F. Storm <storm@cua.dk>
parents: 57017
diff changeset
594 @vindex isearch-resume-in-command-history
46038
3d861934169e Completion operates on text before point.
Richard M. Stallman <rms@gnu.org>
parents: 44373
diff changeset
595 Incremental search does not, strictly speaking, use the minibuffer,
57080
82fe8e8f2ffe (Repetition): Rename isearch-resume-enabled to
Kim F. Storm <storm@cua.dk>
parents: 57017
diff changeset
596 but it does something similar. Although it behaves like a complex command,
82fe8e8f2ffe (Repetition): Rename isearch-resume-enabled to
Kim F. Storm <storm@cua.dk>
parents: 57017
diff changeset
597 it normally does not appear in the history list for @kbd{C-x
82fe8e8f2ffe (Repetition): Rename isearch-resume-enabled to
Kim F. Storm <storm@cua.dk>
parents: 57017
diff changeset
598 @key{ESC} @key{ESC}}. You can make it appear in the history by
82fe8e8f2ffe (Repetition): Rename isearch-resume-enabled to
Kim F. Storm <storm@cua.dk>
parents: 57017
diff changeset
599 setting @code{isearch-resume-in-command-history} to a non-@code{nil}
60245
78a1812a9fd5 (Minibuffer): Prompts are highlighted.
Richard M. Stallman <rms@gnu.org>
parents: 59798
diff changeset
600 value. @xref{Incremental Search}.
46038
3d861934169e Completion operates on text before point.
Richard M. Stallman <rms@gnu.org>
parents: 44373
diff changeset
601
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
602 @vindex command-history
Dave Love <fx@gnu.org>
parents:
diff changeset
603 The list of previous minibuffer-using commands is stored as a Lisp
Dave Love <fx@gnu.org>
parents:
diff changeset
604 list in the variable @code{command-history}. Each element is a Lisp
Dave Love <fx@gnu.org>
parents:
diff changeset
605 expression which describes one command and its arguments. Lisp programs
Dave Love <fx@gnu.org>
parents:
diff changeset
606 can re-execute a command by calling @code{eval} with the
Dave Love <fx@gnu.org>
parents:
diff changeset
607 @code{command-history} element.
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 46038
diff changeset
608
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 46038
diff changeset
609 @ignore
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 46038
diff changeset
610 arch-tag: ba913cfd-b70e-400f-b663-22b2c309227f
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 46038
diff changeset
611 @end ignore