3.3.2 Using the clipboard
You can use the clipboard to transfer data between tools, or even between the LispWorks IDE and other applications that you are running. There are three commands available, as follows:
-
Choose
Edit > Copy
to put the selected item or text from the active pane onto the clipboard.
-
Choose
Edit > Cut
to put the selected item or text from the active pane onto the clipboard and remove it from the active pane.
-
Choose
Edit > Paste
to replace the selected item or text in the active pane with the contents of the clipboard.
Use of
Copy
or
Cut
followed by
Paste
lets you transfer items between tools, or to different parts of the same tool.
Unlike the clipboard in many other applications, the LispWorks IDE clipboard can contain a Common Lisp object. This makes the LispWorks IDE clipboard an exceptionally powerful tool, allowing you to pass objects between different tools in the environment so that they can be examined in different ways.
If the clipboard contains a Lisp object and you use the
Paste
command on a pane that only accepts text, then the object's printed representation will be pasted.
There are several ways to use these commands:
-
In the Editor, you can
Copy
chunks of text and
Paste
them into different places, either within the same file or between different files. If you have sections of code which are very similar, rather than typing each section out explicitly, just
Paste
in the same section as many times as you need and change only the relevant parts. Cutting, copying and pasting using the kill ring describes a number of more sophisticated methods that can be used in the Editor.
-
In the Class Browser's
Hierarchy
view (for example), you can
Copy
a selected class from the
Superclasses
pane to the clipboard and then
Paste
it into another tool. Because the Common Lisp object itself is copied to the clipboard, it is treated usefully according to the tool. For instance, if you paste it into an Inspector using
Edit > Object > Paste Object
, then the class is inspected. If you paste it into an editor however, the class name is simply pasted as text.
As well as the menu commands, you can use the
,
and
buttons in the toolbar, for
Cut
,
Copy
and
Paste
respectively.
Note: You can also transfer data within the environment using the standard actions commands described in Performing operations on selected objects.
LispWorks IDE User Guide (Windows version) - 22 Dec 2009