All Manuals > CAPI User Guide and Reference Manual > 21 CAPI Reference Entries

set-clipboard Function

Summary

Sets the contents of the system clipboard.

Package

capi

Signature

set-clipboard self value &optional string plist => result

Arguments
self
A displayed CAPI pane or interface.
value
A Lisp object (not necessarily a string) to make available within the local Lisp image.
string
The string representation of value to export, or nil.
plist
A property list.
Values
result
A string, or nil.
Description

The function set-clipboard sets the contents of the system clipboard associated with self.

If string is non-nil, then the text on the system clipboard is set to string. If string is nil and value is a string, then text on the system clipboard is set to value. Otherwise, no text is set on the system clipboard.

In addition, value is made available within the local Lisp image when calling clipboard.

plist is a plist of additional format/value pairs to export to the system clipboard. The currently supported formats are as described for clipboard. You can export more than one format simultaneously.

In Microsoft Windows applications (including LispWorks in Windows emulation mode), the contents of the system clipboard is usually accessed by the user with the Ctrl+V gesture.

The X clipboard can be accessed by the Ctrl+V gesture in KDE/Gnome emulation, or by running the program xclipboard or the Emacs function x-get-clipboard. The most likely explanation for apparent inconsistencies after set-clipboard is that the pasting application does not use the X clipboard.

In Cocoa applications (including LispWorks), the contents of the system clipboard is usually accessed by the user with the Command+V gesture.

Examples

To export an image:

(capi:set-clipboard pane nil nil (list :image image))

To export an image with a text description:

(capi:set-clipboard pane nil nil
                    (list :image image 
                          :string "my image"))
See also

clipboard
selection
text-input-pane-copy
18.6 Clipboard


CAPI User Guide and Reference Manual (Windows version) - 01 Dec 2021 19:33:57