Loading and Saving (ne’s manual)

Next: Editing, Previous: Starting, Up: Basics [Contents][Index]

### 2.3 Loading and Saving

The first thing to learn about an editor is how to exit. `ne` has a `CloseDoc` command that can be activated by pressing `Control-Q`, by choosing the ‘`Close`’ item of the ‘`Document`’ menu, or by activating the command line with `Control-K`, writing ‘`cd`’ and pressing `Return`. Its effect is to close the current document without saving any modifications. (You will be requested to confirm your choice in case the current document has been modified since the last save.)

There is also a `Quit` command, which closes all the documents without saving any modifications, and a `Save&Exit` (`Meta-X`) command, which saves the modified documents before quitting.

This choice of shortcuts could surprise you. Wouldn’t ‘`Quit`’ be a much better candidate for `Control-Q`? Well, experience shows that the most common operation is closing a document rather than quitting the editor. If there is just one document, the two operations coincide (this is typical, for instance, when you use `ne` for writing electronic mail), and if there are many documents, it is far more common to close a single document than all the existing documents.

If you want to load a file, you may use the `Open` command, which can be activated by pressing `Control-O`, by choosing the ‘`Open...`’ item of the ‘`File`’ menu, or by typing it on the command line (as in the previous case). You will be prompted with a list of files and directories in the current working directory. (You can tell the directory names because they end with a slash; they will also appear in a bold face if your terminal allows it.) You can select any of the file names by using the cursor keys, or any other movement key. Pressing an alphabetic key will move the cursor to the first entry after the cursor that starts with the given letter. When the cursor is positioned over the file you want to open, press `Return`, and the file will be opened. If instead you move to a directory name, pressing `Return` will display the contents of that directory.

You can also escape with `f1`, `Escape` or `Escape`-`Escape` and manually type the file name on the command line (or escape again, and abort the `Open` operation). If you escape with `Tab` instead, the file or directory under the cursor will be copied to the input line, where you can modify it manually. `ne` also has file name completion features activated by `Tab` (see The Input Line).

When you want to save a file, just use the command `Save` (`Control-S`). It will use the current document name or will ask you for one if the current document has no name. `SaveAs`, on the other hand, will always ask for a new name before saving the file. `SaveAll` will save all modified documents. If the file you are saving a document to has changed since you last loaded or saved it, perhaps because another user updated it while you were editing, `ne` will warn you before overwriting the file.

If `ne` is interrupted by an external signal (for instance, if your terminal crashes), it will try to save your work in some emergency files. These files will have names similar to your current files, but they will have a pound sign ‘`#`’ prefixed to their names. See Emergency Save.

Next: Editing, Previous: Starting, Up: Basics [Contents][Index]