Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to automatically have text I kill in emacs get put into screen's clipboard. I don't care too much about travel the other direction. I can do it now via a temporary file, but I have to run a command to grab the data in screen each time.

share|improve this question

You could modify the variable interprogram-cut-function to have a value that is a function you write that pushes all killed text into screen's clipboard (and probably also your window system's clipboard via x-select-text, which is the default value). So you would end up adding code similar to the following to your ~/.emacs file:

(setq interprogram-cut-function 'my-interprogram-cut-function)

(defun my-interprogram-cut-function (text)
  "... docstring here ..."

  ;; First, do the default action.
  (x-select-text text)

  ;; Next, push the killed text into screen (somehow).

The part at the end will probably involve running a process with start-process.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.