The Editor provides a sophisticated range of commands for cutting or copying text onto a special kind of clipboard, known as the kill ring , and then pasting that text back into your Editor later on. There are three steps in the process, as follows:
The selected text is highlighted using the Region Highlight text style.
To mark the region with the keyboard, place the cursor at the beginning of the text you want to mark, press
Ctrl+Space, and move the cursor to the end of the region you want to mark,
using keyboard commands to do so
. Unlike marking with the mouse, this does not highlight the region.
Because the Editor does not highlight the marked region when you use keyboard commands, a useful Emacs key to remember is
Ctrl+X Ctrl+X. Pressing this exchanges the current cursor position with the start of the marked region and highlights the region. Press
Ctrl+X Ctrl+X a second time to return the cursor to its original position and leave the region marked.
Ctrl+Wto cut the text. In Microsoft Windows emulation the key is
Alt+Wto copy the text. In Microsoft Windows emulation the key is
Notice that these commands transfer the selected text to the LispWorks IDE clipboard as well as the kill ring. This is so that the selected text can be transferred into other tools, or even into other applications.
Ctrl+Yto paste the text in the kill ring back into the buffer. In Microsoft Windows emulation the key is
However, the kill ring allows you to keep many items. Any of these items can be pasted back into your document at any time. Every time you cut or copy something, it is added to the kill ring, so you accumulate more items in the kill ring as your session progresses.
Consider the following example. In Kill ring with three items, the kill ring contains three items; the words
First, the word
factorial was cut from the current buffer (this would remove it from the buffer). Next, the word
function was copied (which would leave it in the buffer but add a copy of it to the kill ring), and lastly, the word
macro was cut.
Note the concept of the kill ring rotating (this is why it is known as a ring). Every time a new item is added (at the top, in these figures), the others are all shunted around in a counter-clockwise direction.
Whenever you perform a paste, the current item in the kill ring - the word
macro in this case - is copied back into the buffer wherever the cursor currently is.
Note that the current item is not removed from the kill ring.
The Emacs key to do this is
Esc Y. This rotates the kill ring in the opposite direction - thus making the previous item the current one - and pastes it into the buffer in place of the item just pasted. In Pasting from the kill ring, the word
macro would be replaced with the word
LispWorks IDE User Guide (Windows version) - 13 Sep 2017