From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Anselm Helbig Newsgroups: gmane.emacs.help Subject: Re: Using tramp to connect to a remote emacs session Date: Thu, 03 Sep 2009 18:34:50 +0200 Organization: Freie Universitaet Berlin Message-ID: <87zl9cc7h1.wl%anselm.helbig+news2009@googlemail.com> References: <4A9EFA5A.1030002@gmail.com> <0A289BAA-4358-453E-AB08-9EF9CCA2402E@Web.DE> NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1251996217 24081 80.91.229.12 (3 Sep 2009 16:43:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 3 Sep 2009 16:43:37 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 03 18:43:30 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MjFPE-0003Z1-9h for geh-help-gnu-emacs@m.gmane.org; Thu, 03 Sep 2009 18:43:28 +0200 Original-Received: from localhost ([127.0.0.1]:48454 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MjFPD-0002Al-Lz for geh-help-gnu-emacs@m.gmane.org; Thu, 03 Sep 2009 12:43:27 -0400 Original-Path: news.stanford.edu!usenet.stanford.edu!news.glorb.com!news2.glorb.com!fu-berlin.de!uni-berlin.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 63 Original-X-Trace: news.uni-berlin.de qU1ggFSmNIlXHbp3c1ynWg/pn86eh1eNPQ0AY8LmERTkId7I7oYRvgoRXp Cancel-Lock: sha1:t20PKXwTeakoI5NzJHeLUgd0U8s= In-Reply-To: Mail-Followup-To: Anselm Helbig Original-Xref: news.stanford.edu gnu.emacs.help:172678 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:67812 Archived-At: At Thu, 03 Sep 2009 09:06:16 -0700, Suvayu Ali wrote: > > Hi Peter, > > On Thursday 03 September 2009 01:02 AM, Peter Dyballa wrote: > > > > Am 03.09.2009 um 01:06 schrieb Suvayu Ali: > > > >> So far only reference I found was, > >> > >>> Using emacsclient to make a new frame of a remote Emacs 22 on a local > >>> display > >>> ssh remote_host -f emacsclient --eval ‘”(make-frame-on-display > >>> \”$DISPLAY\”)”’ > >> > >> in the emacswiki[1]. Firstly I don't understand how this works, and > >> blindly copy-pasting this to the terminal didn't work either. Some > >> help would be greatly appreciated. :) > > > > > > Ssh opens a connection to remote_host and logs you in. The option -f > > puts ssh into the background allowing to launch an X client. This one is > > emacsclient, which is asked to evaluate some Lisp. This Lisp code is > > make-frame-on-display, which makes GNU Emacs open (create) a new frame > > on the specified screen as given by the environment variable DISPLAY. On > > the remote host DISPLAY should point to your local screen and its X > > server. So the remote GNU Emacs daemon or server will open a frame as an > > X client of your local display's X server and communicate with it via > > the SSH tunnel. > > > > > > If this does not work you can start to debug ssh, but particularly allow > > (trusted) X11 forwarding in the configuration of the SSH server on the > > remote host. Your local X server must be informed to accept connections > > from the remote host. > > > > Thanks for the very clear explanation Pete. :) I had a hunch it is > something like X-forwarding. I don't really like to do X-forwarding, the > interface is usually very unresponsive. I would rather go with `emacs -nw'. If you want to connect to a remote emacs but don't want to do X forwarding, then you can do either - start emacs with the --daemon option on the remote host; you can now connect to the running emacs instance with `emacsclient -t' which will give you an emacs terminal frame. Which will, of course, work over ssh as well. You can still get a X frame if you like by not using -t. This requires Emacs 23 to work. - the obvious solution: use GNU screen or a similar tool (dtach, tmux, ...), start your console mode emacs in there and reconnect as necessary. Works with any version of emacs, obviously. HTH, Anselm -- Anselm Helbig mailto:anselm.helbig+news2009@googlemail.com