8.7 Getting started with the editor

8.7.1 Opening, saving and printing files

When you first start up the editor, the first thing you must do is open a file.

Use file extensions.lisp or.lsp for Common Lisp files. The editor recognizes these extensions and places the buffer in Lisp mode. Lisp mode provides special features for use in Lisp editing.

You can create a new Lisp buffer by choosing File > New. The new file is automatically in Lisp mode, and the buffer is called "Unnamed". As soon as you try to save this buffer, the editor prompts you for a filename.

As you have already seen, you can open an existing file by choosing File > Open. A dialog appears from which you can select a file to edit.

To save a file, choose File > Save. If the file has not been saved before (that is, if you created the file by choosing File > New and this is the first time you have saved the file), a dialog appears, allowing you to specify a directory and a filename.

You can also save a file by using the keyboard commandCtrl-X Ctrl-S. If you choose this method and the file has not been saved before, a dialog is not displayed; you must type a filename into the echo area.

If you want to make a copy of the file (save the file under a different name) choose File > Save As and type a name in the dialog that appears.

Choose File > Revert to revert back to the last saved version of the file. This replaces the contents of the current buffer with the version of that file which was last saved on disk. This commands can be useful if you make a number of changes which you want to lose.

As well as saving whole files to disk, you can save any part of a file to disk under a different filename. To do this:

1. Select a region of text by clicking and holding down the select mouse button, and dragging the pointer across the region of text you want to save. The text is highlighted as you drag the pointer across it.

2. With the text still highlighted, choose File > Save Region As.

3. In the echo area, specify the name of a file to save the selected text to.

Note that the selected text is copied into the new file, rather than moved; it is still available in the original buffer.

To find out more about selecting regions of text, see Section 8.10.1 on page 100. To find out more about operating on regions of text, see Section 8.12 on page 106.

To print the file in the current buffer to your default printer, choose File > Print. The printer on which your hard copy appears is the one defined by thePRINTER UNIX environment variable.


Common LispWorks User Guide, Liquid Common Lisp Version 5.0 - 18 OCT 1996

Generated with Harlequin WebMaker