Created
September 30, 2014 13:03
-
-
Save rand00/e8a382e3aa1b64a53727 to your computer and use it in GitHub Desktop.
Elisp function for copying Emacs-selection to the X primary selection (clipboard)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun yank-to-x-clipboard () | |
(interactive) | |
(if (region-active-p) | |
(progn | |
(shell-command-on-region | |
(region-beginning) (region-end) | |
"xsel -pi") | |
(message "Yanked region to clipboard!") | |
(deactivate-mark)) | |
(message "You havn't marked any text."))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment