3.5.5 Miscellaneous file operations
Revert FileEditor Command
- Arguments: None
Key sequence: None - If the current buffer is associated with a file, its contents revert to the state when it was last saved. If the buffer is not associated with a file, it is not possible for a previous state to be recovered.
- If auto-save is on for the current buffer, the version of the file that is recovered is either that derived by means of an automatic save or by means of an explicit save, whichever is the most recent. If auto-save is off, the buffer reverts to its state when last explicitly saved.
- If the buffer has been modified and the value of the variable
Revert-File-Confirmist thenRevert File asks for confirmation before reverting to a previous state. - Any prefix argument forces
Revert File to use the last explicitly saved version.
Revert-File-ConfirmEditor Variable
- Default value:
t - When the command
Revert Fileis invoked, if the value of this variable ist and the buffer has been modified then confirmation is asked for before the revert operation is performed. If its value isnil, no confirmation is asked for.
Process File OptionsEditor Command
- Arguments: None
Key sequence: None - Reprocess the file options associated with the current buffer. This involves resetting all the modes to be the ones specified either by the modeline at the top of the file or, if this does not exist, by the name of the file. See "Modes" on page 76.
Insert File Editor Command
- Arguments: pathname
Key sequence:Ctrl+X I pathname
editor:insert-file-command p &optional pathname buffer
- Inserts the file defined by pathname into the current buffer at the current point.
- The argument buffer is the buffer in which the file is to be inserted.
Delete FileEditor Command
- Arguments: pathname
Key sequence: None - Deletes the file defined by pathname. The user is asked for confirmation before the file is deleted.
Rename FileEditor Command
- Arguments: file new-file-name
Key sequence: None - Changes the name of file to new-file-name.
- If you are currently editing the file to be renamed, the buffer remains unaltered, retaining the name associated with the old file even after renaming has taken place. If you then save the current buffer, it is saved to a file with the name of the buffer, that is, to a file with the old name.