Created
March 25, 2009 02:44
-
-
Save pclouds/84520 to your computer and use it in GitHub Desktop.
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 xsel-select-text (text &optional push) | |
"See `x-select-text'." | |
(let* ((process-connection-type nil) | |
(proc (start-process "xsel" nil "xsel" "-b" "-i"))) | |
(process-send-string proc text) | |
(process-send-eof proc))) | |
(defun xsel-selection-value () | |
"See `x-cut-buffer-or-selection-value'." | |
(shell-command-to-string "xsel -b -o")) | |
;;;###autoload | |
(defun xsel-enable () | |
(interactive) | |
(setq interprogram-cut-function 'xsel-select-text) | |
(setq interprogram-paste-function 'xsel-selection-value)) | |
;;;###autoload | |
(defun xsel-disable () | |
(interactive) | |
(setq interprogram-cut-function nil) | |
(setq interprogram-paste-function nil)) | |
(provide 'xsel) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment