3.4.2 Using the clipboard
You can use the clipboard to transfer data between tools, or even between the environment and other applications that you are running. There are three commands available, as follows:
-
Choose
Edit > Copy
to put the selection or "primary object" onto the clipboard.
-
Choose
Edit > Cut
to put the selection or "primary object" onto the clipboard and remove it from the tool it was copied from.
-
Choose
Edit > Paste
to put the contents of the clipboard into the current tool.
Unlike the clipboard in many other applications, the Common LispWorks clipboard can contain a Common Lisp object. This makes the Common LispWorks 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.
Use of
Copy
or
Cut
followed by
Paste
lets you transfer items between tools, or to different parts of the same tool. There are several ways to use these commands:
-
In the Class Browser (for example) you can
Copy
the class 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, it is inspected. If you paste it into an editor however, the class name is simply pasted as text.
-
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.
-
Between any of the tools, you can
Cut
,
Copy
, and
Paste
Common Lisp objects. You can, for instance, make an instance of a class in the Listener, inspect it by
Values > Inspect
, and then
Copy
it in the Inspector, and then
Paste
it into a Class Browser to examine its class.
-
If you have several Common Lisp objects which you want to keep track of, store them in the Object Clipboard. You can do this by a
Clip
command in tools such as the Class Browser, or by
Edit > Paste
in the Object Clipboard tool. See The Object Clipboard for more information about that tool.
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.
Common LispWorks User Guide (Windows version) - 5 Jul 2006