LispWorks Editor User Guide > 3 Command Reference > 3.5 File handling


3.5.4 Backing-up files on saving

When a file is explicitly saved in the editor, a backup is automatically made by writing the old contents of the file to a backup before saving the new version of the file. The backup file appears in the same directory as the original file. By default its name is the same as the original file followed by a ~ character.


Editor Variable

Default value: t

Controls whether to make a backup copy of a file the first time it is modified. If the value is t , a backups is automatically made on first saving. If the value is nil , no backup is made.


Editor Variable

Default value: #\~

This variable contains the character used as a suffix for backup files. By default, this is the tilde (~) character.


Editor Variable

Default value: "~A~A~A"

This control string is used with the Common Lisp format function to create the filename of the backup file. format is called with three arguments, the first being the directory name-string and the second being the file name-string of the pathname associated with the buffer. The third is the value of the editor variable backup-filename-suffix .

The backup file is created in the same directory as the file for which it is a backup, and it has the same name, followed by the backup-filename-suffix .

Note that the backup-suffix can be changed functionally as well as by interactive means. For example, the following code changes the suffix to the @ character:

(setf (editor:variable-value `editor:backup-filename-suffix
         :current nil) #\@)

LispWorks Editor User Guide (Unix version) - 22 Dec 2009