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.
1 Answer
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
.