This is a read-only archive of lispforum.com. The forum was locked to new users and posts and is preserved here as static HTML from a database snapshot taken on 2019-09-07.

Remoting, emacs, and copy-pasting

3 posts · 5452 views

Is there a solution that gives the best of all worlds for copying text from emacs on a remote server and pasting it to other apps on my local machine?

Here is what I am trying to do. On my local machine, I ssh to a remote server with -X -Y. The remote xcalc shows its pretty graphics. "emacs" shows up graphically, but it is super slow. "emacs -nw" runs very quickly and is nice to edit in, but emacs now does not know anything about X, so I cannot copy text to the X clipboard.

I want to run emacs in the console mode but still give it access to X. How do I do this?

Re: Remoting, emacs, and copy-pasting

The xclip program should be useful here, if by "give it access to X" you mean the clipboard.

Re: Remoting, emacs, and copy-pasting

Thank you! I did some further research and found this helper module: http://www.emacswiki.org/emacs-en/xclip.el

I was able to get it to work locally and remotely with -nw and without by installing xclip and then adding this to my .emacs file:
(require 'xclip)
(turn-on-xclip)  ; the detection hook is not that slick, so this forces the issue