[ < ] [ > ]   [ << ] [Plus haut] [ >> ]         [Top] [Table des matières] [Index] [ ? ]

9.1 Minibuffers for File Names

When you use the minibuffer to enter a file name, it starts out with some initial text—the default directory, ending in a slash. The file you specify will be in this directory unless you alter or replace it.

For example, if the minibuffer starts out with these contents:

 
Find File: /u2/emacs/src/

(where ‘Find File: ’ is the prompt), and you type buffer.c as input, that specifies the file ‘/u2/emacs/src/buffer.c’. You can specify the parent directory by adding ‘..’; thus, if you type ../lisp/simple.el, you will get ‘/u2/emacs/lisp/simple.el’. Alternatively, you can use M-<DEL> to kill the directory names you don't want (voir la section Words).

You can kill the entire default with C-a C-k, but there's no need to do that. It's easier to ignore the default, and enter an absolute file name starting with a slash or a tilde after the default directory. For example, to specify ‘/etc/termcap’, just type that name:

 
Find File: /u2/emacs/src//etc/termcap

GNU Emacs interprets a double slash (which is not normally useful in file names) as, “ignore everything before the second slash in the pair.” In the example above. ‘/u2/emacs/src/’ is ignored, so you get ‘/etc/termcap’. The ignored part of the file name is dimmed if the terminal allows it; to disable this dimming, turn off File Name Shadow mode (a minor mode) with the command M-x file-name-shadow-mode.

If the variable insert-default-directory is nil, the default directory is never inserted in the minibuffer—so the minibuffer starts out empty. Nonetheless, relative file name arguments are still interpreted based on the same default directory.


Ce document a été généré par Eric Reinbold le 23 Février 2009 en utilisant texi2html 1.78.