Next: Default Directory, Up: File Names [Index]
While in the minibuffer, you can use the usual completion and history commands. Minibuffer history commands offer some special features for reading file names.
find-file
(‘C-x C-f’)use the minibuffer to read a file name argument. Emacs obeys this command by visiting the file: it creates a buffer, copies the contents of the file into the buffer, and then displays the buffer for editing. If the file does not exist, this command creates an empty buffer; Emacs creates the file the first time you save this buffer.
save-buffer
(‘C-x C-s’)you can save the new text in the file by typing
‘C-x C-s’ (save-buffer
). This copies the altered buffer contents back into
the file
read-file-name-completion-ignore-case
when non-nil, ignore case when completing file names.
read-buffer-completion-ignore-case
when non-nil, ignore case when completing buffer names.
completion-ignored-extensions
When completing file names, Emacs usually omits certain alternatives that are considered unlikely to be chosen, as determined by this list variable.
It’s value is:
‘(.annot .cmi .cmti .cmt .cmxs .cmxa .cma .cmx .cmo .o ~ .bin .lbin .so .a .ln .blg .bbl .elc .lof .glo .idx .lot .svn/ .hg/ .git/ .bzr/ CVS/ _darcs/ _MTN/ .fmt .tfm .class .fas .lib .mem .x86f .sparcf .dfsl .pfsl .d64fsl .p64fsl .lx64fsl .lx32fsl .dx64fsl .dx32fsl .fx64fsl .fx32fsl .sx64fsl .sx32fsl .wx64fsl .wx32fsl .fasl .ufsl .fsl .dxl .lo .la .gmo .mo .toc .aux .cp .fn .ky .pg .tp .vr .cps .fns .kys .pgs .tps .vrs .pyc .pyo)’
completion-cycle-threshold
If non-nil, completion commands can cycle through completion alternatives. If t, cycling is always used.
Every argument that you enter with the minibuffer is saved in a minibuffer
history list so you can easily use it again later. Emacs keeps separate
history lists for several different kinds of arguments. For example, there is
a list for file names, used by all the commands that read file names. Other
history lists include buffer names, command names (used by M-x), and command
arguments (used by commands like query-replace
). Use the following arguments
to quickly fetch an earlier argument into the minibuffer:
previous-history-element
(‘M-p’)
next-history-element
(‘M-n’)
previous-line-or-history-element
(‘<UP>’)
next-line-or-history-element
(‘<DOWN>’)
previous-matching-history-element
(‘M-r regexp’)
next-matching-history-element
(‘M-s regexp’)
repeat-complex-command
(‘C-x <ESC> <ESC>’) : Re-execute a recent minibuffer
command from the command history. With no argument, it repeats the last such
command. A numeric argument specifies which command to repeat; 1 means the
last one, 2 the previous, and so on. You can use the usual minibuffer
history commands to move through the history list.
list-command-history
(‘M-x list-command-history’) : open a new window with
the list of commands
command-history
: The list of previous minibuffer-using commands is stored
as a Lisp list in this variable. Lisp programs can re-execute a command by
calling eval with the command-history element.
Next: Default Directory, Up: File Names [Index]