ErgoEmacsEmacsLispBlogEmacsLispBuy Tutorial

25.1.5 Using the Clipboard

In desktop environments such as Gnome, and operating systems such as Microsoft Windows and Mac OS X, you can transfer data (usually text) between different applications using the clipboard. The clipboard is distinct from the primary selection and secondary selection discussed earlier. You can access the clipboard through the ‘Edit’ menu of the menu bar (see Menu Bar).

The command clipboard-kill-region, which is bound to the Cut menu item, kills the region and saves it in the clipboard.

The command clipboard-kill-ring-save, which is bound to the Copy menu item, copies the region to the kill ring and saves it in the clipboard.

The Paste menu item in the Edit menu yanks the contents of the clipboard at point (clipboard-yank).

You can customize the variable x-select-enable-clipboard to make the Emacs yank functions consult the clipboard before the primary selection, and to make the kill functions to store in the clipboard as well as the primary selection. Otherwise, these commands do not access the clipboard at all. Using the clipboard is the default on MS-Windows and Mac OS, but not on other systems.

blog comments powered by Disqus