Customizing Cut and Paste in UNIX Environments

Instructions for Cutting and Pasting Text

Types of Paste Buffers

There are four SAS paste buffers. Each SAS paste buffer is associated with an X paste buffer:
XPRIMARY
is associated with X primary selection (PRIMARY).
XSCNDARY
is associated with the X secondary selection (SECONDARY).
XCLIPBRD
is associated with the X clipboard selection (CLIPBOARD). This paste buffer enables you to use the MIT X Consortium xclipboard client with SAS.
XTERM
is associated with the paste buffer used by the xterm client. XTERM is the default buffer. DEFAULT is an alias for XTERM. If you copy or cut text into the XTERM buffer, the text is actually copied or cut into all four of the paste buffers. When you paste text from the XTERM buffer, the text is pasted from the XPRIMARY buffer.
XCUTn
is associated with X cut buffern where 0 <= n <= 7.

Selecting a Paste Buffer

If you are not sure which X data exchange protocols your other X clients are using, you should use the XTERM paste buffer. You can specify your default paste buffer with the SAS.defaultPasteBuffer resource:
SAS.defaultPasteBuffer: XTERM
If you know that the X clients in your workstation environment all use the X PRIMARY selections to exchange data, you should use the XPRIMARY paste buffer:
SAS.defaultPasteBuffer: XPRIMARY
This specification uses both SAS and X resources more efficiently and provides for the on-demand transfer of data between clients.
Solaris OpenWindows desktop clients use the CLIPBOARD selection as the basis for their copy-and-paste operations. If you use the SAS XCLIPBRD paste buffer, you can exchange text directly with these clients.
You can also use the SAS XCLIPBRD paste buffer to interact with Motif clients that use the Motif clipboard mechanism for text exchanges. This clipboard mechanism makes it unnecessary to have a dedicated client such as xclipboard. For example, you can use XCLIPBRD to exchange text directly with the Motif xmeditor application when you select the Cut, Copy, or Paste items from the xmeditor Edit drop-down menu.
The Motif quick-copy data exchange and Motif clipboard data exchange mechanisms are specific to the Motif interface toolkit and are not currently supported as SAS paste buffers. However some dialog boxes, such as the File Selection dialog box, use Motif interface text widgets. In these dialog boxes, the Motif quick copy and clipboard data exchange mechanisms are available.

Manipulating Text Using a Paste Buffer

If you want SAS to automatically copy selected text into your paste buffer every time you mark a region of text with the mouse, you should also specify your paste buffer name in the SAS.markPasteBuffer resource:
SAS.markPasteBuffer: XTERM
Alternatively, because DEFAULT is an alias for XTERM, you could specify the following:
SAS.markPasteBuffer: DEFAULT
The SAS.markPasteBuffer definition causes SAS to automatically issue a STORE command whenever you select text.
The STORE command, as well as the CUT and PASTE commands, support a BUFFER= option that specifies which buffer to use. When these commands are issued from function keys or drop-down menus whose definitions do not include the BUFFER= option, if the SAS.markPasteBuffer resource is not defined, these commands use BUFFER=DEFAULT. If this resource is defined, these commands use BUFFER=buffer-name.
You can customize your normal cut, copy, or paste keys to issue any of these commands with the BUFFER= option. For example, you can override the SAS.keyboardTranslations definition for the osfCopy and osfPaste keys with the following specifications:
SAS.keyboardTranslations: #override \
 <Key>osfCopy: sas-do-command(\"STORE BUFFER=XCLIPBRD\") \n\
 <Key>osfPaste: sas-do-command(\"PASTE BUFFER=XCLIPBRD\")
For more information about customizing keys, see Customizing Key Definitions in UNIX Environments.

Notes about Preserving Text and Attribute Information

When you cut or copy and paste text between SAS sessions using the XTERM, XPRIMARY, or XSCNDARY paste buffers, the color and attribute information is preserved. However, if you copy and paste the same text into an xterm window while using the vi editor, the color and attribute information is lost. If you change the definition for SAS.defaultPasteBuffer and SAS.markPasteBuffer to XCUT0, then you will not retain the text and color attributes when you copy and paste text between two SAS sessions.
When you use the xclipboard client, SAS text attributes are not preserved in exchanges made between SAS sessions. However, when you use the XCLIPBRD paste buffer without a clipboard manager such as the xclipboard client, SAS text attributes are preserved in exchanges between SAS sessions.