3.5.1 Finding files
Find File Editor Command
- Arguments: pathname
Key sequence: None
editor:find-file-command p &optional pathname
- Creates a new buffer with the same name as pathname (where pathname is the name of the file to be found, including its directory relative to the current directory) and inserts the contents of the file into the buffer. The contents of the buffer are displayed in an editor pane and may then be edited.
- If the file is already being visited a new buffer is not created, but the buffer already containing the contents of that file is displayed instead.
- If a file with the specified name does not exist, an empty buffer with that file name is created for editing purposes, but the new file is not created until the appropriate save file command is issued.
- If there is no prefix argument, a new Editor window is created for the file. With any prefix argument, the file is shown in the current window.
- Another version of this command is
Wfind Filewhich is usually used for finding files.
Wfind File Editor Command
- Arguments: pathname
Key sequence:Ctrl+X Ctrl+Fpathname
editor:wfind-file-command p &optional pathname
- Calls
Find File with a prefix argument (that is, the new file is opened in the existing window).
Visit FileEditor Command
- Arguments: pathname
Key sequence:Ctrl+X Ctrl+Vpathname
editor:visit-file-command p &optional pathname buffer
- Does the same as
Find File with a prefix argument, but kills the current buffer and replaces it with the newly created buffer containing the file requested. If the contents of the buffer to be killed have been modified, the user is asked if the changes are to be saved to file. - The argument buffer is the buffer in which the contents of the file are to be displayed.