next up previous
Next: 14.2 Saving all Buffers Up: 14. Files and Quitting Previous: 14. Files and Quitting

Subsections

14.1 Saving a Buffer

14.1.1 Extra Save [Escape X]

If you wish to save changes you have made to a buffer, but continue to have that buffer active, press [Esc][X]. You will be presented with a prompt for a filename. If you do not wish to change the filename, just press [Enter]; or enter a filename in the normal manner. The existing buffer with its changes will be written to disk and the buffer will be marked as unchanged.

14.1.2 Quit and Save [Escape Q]

On the other hand, if you are done with the existing buffer you can press [Esc][Q] which will save the existing buffer and then delete the buffer from memory. When quitting the first thing you will see is the dialog ``Closing filename, do you want to save (Y/n)''. You have several (hidden) options at this prompt, accessible by pressing a single key:

[M]
Save the file in MacIntosh/OS9 format (lines end in a single $0d).

[D]
Save the file in MS-DOS format (lines end is a $Od $0a).

[.]
Move the cursor to the last edit point. The dialog popup will reappear after you press any key. This is useful to see just what change you last made to the file.

[H]
Display a short help message for the above options.

[Q]
Quick save. This skips the next prompt for a new filename.

[N]
Don't save. This will present an ``are you sure'' prompt.

Pressing any other key will save the buffer. If you only have one buffer active this will also terminate Ved.

Selecting the ``Close'' option from the ``File'' menu is identical to [Esc][Q].

14.1.3 File Modifications

When Ved saves your file a check is done to see if another user or process has modified the file while you were editing. If this is the case, you will receive a prompt advising that the file has been modified. Respond accordingly. Note that this check compares the modification field of the files inode.

14.1.4 File Backups

To be extra safe, Ved will create backups of your modified files before saving. This is controlled in the RC file with the following options:

option dobackups
Set this to true or false. If false, no backups are done (by default this is set to true).

option backup_suffix
By default this is set to a single ``~'' character (note: no quotes). You could change it if you want to ``BAK'' or whatever. This string is appended to the filename.

option backup_prefix
By default this is not set. However, you might want to use ``.'' (again, no quotes).

Example: If you have dobackups set to ``true'', backup_suffix to ``~'' and backup_prefix to ``.'' and edit the file ``foo'' you will end up with a copy of the original ``foo'' named ``.foo~'' and a new, modified ``foo''. The backup process will destroy old backups as new ones are created.

On our system we have the following settings:

Option Dobackups TRUE
Option Backup_suffix "~"
Option Backup_prefix "~/.ved_backups/"

This creates backups in the hidden directory ``.backups'' in the user's home directory. It is up to the user to create the backup directory--Ved will not create backup directories.

If Ved notices that there is a ``/'' in the Backup_Prefix , only the filename portion of the filename will be used. Again, using the above settings, if we were to edit the file docs/tex/ved.tex, the backup would be /.ved_backups/ved.tex. Caution: this does mean that files with the same name in different directories will overwrite themselves in the backup directory.

Another backup strategy would be to use a Backup_Prefix like ``.backups/''. Now, you will have to create backup sub-directories in all the directories you edit files in. However, this does avoid littering your hard drive with backups of every file you edit. If the directory does not exist, it will not be created; however, you will receive a warning message that the backup could not be created.


next up previous
Next: 14.2 Saving all Buffers Up: 14. Files and Quitting Previous: 14. Files and Quitting
2004-05-02