4 The Editor
If you have used other Windows applications, you will be familiar with the idea of copying or cutting (that is, removing) text and placing it on a clipboard, and then pasting that text back into your editor later on. You can do this in FreeLisp by using the Cut, Copy and Paste menu items from the Edit menu.
With other Windows applications, however, you can only do this with one item at a time. The clipboard is only able to contain one item, and so it is the only one available for pasting back into the text. This is true of the FreeLisp editor if you cut, copy and paste using the commands under the Edit menu. If you are used to using Cut, Copy and Paste operations in other Windows applications, then you can use these menu commands in exactly the same way.
As well as the normal clipboard, however, the FreeLisp editor uses a special type of clipboard known as a kill ring, which allows you to keep many items. All the items in the kill ring are available for pasting back into your document.
You must cut or copy a region of text into the kill ring (as opposed to the normal clipboard) using keyboard commands. Before cutting or copying, you must first define the region either by selecting text with mouse, or by using keyboard commands. This is known as marking the region.
To mark the region with the keyboard, place the cursor at the beginning of the text you want to mark, type C-Space
, and move the cursor to the end of the region you want to mark, using the keyboard commands. Unlike marking with the mouse, this does not highlight the region.
Next, you can either cut or copy the text to the kill ring, depending on whether you want to remove the text from the buffer or leave it there.
Finally, if you want to insert text from the kill ring in another part of the buffer, move the cursor to the text's destination, and paste it.
To cut or copy text into the kill ring, or to paste text from the kill ring into the current buffer, use the keyboard commands shown below, after marking the region.
C-w
Esc-w
C-y
The procedure to follow for both menu commands and keyboard commands is summarized in the table below. You must mark the region before issuing a Cut or Copy. Remember that you can use either the menu commands, or the keyboard commands, but you cannot mix the two together
Action | Using the Mouse | Using Keyboard Commands |
---|---|---|
Marking the Region | Click and drag the cursor across the region to be marked. Text in the region is highlighted. | Put the cursor at the beginning of the region and press C-Space . Move the cursor to the end of the region. |
Cutting or Copying | Choose either Cut or Copy. The marked text is placed in the clipboard. | Press C-w to cut the text, or Esc w to copy it. The marked text is placed in the kill ring. |
Pasting | Put the cursor at the place you want to paste the text, and choose Paste. The text in the clipboard is pasted into the buffer. | Put the cursor at the place you want to paste the text, and press C-y . The text in the kill ring is pasted into the buffer. See below for more about the kill ring. |
Because the editor does not highlight the marked region when you use keyboard commands, a useful command to remember is C-x
C-x
. Pressing this exchanges the current cursor position with the start of the marked region, highlighting the region in the process. Pressing C-x
C-x
a second time returns the cursor to its original position, but leaves the region marked.
To turn off this highlighting, use C-g
.
Generated with Harlequin WebMaker