From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xiao-Yong Jin Newsgroups: gmane.emacs.help Subject: Re: Connecting to remote Emacs? Date: Wed, 14 Jun 2006 16:17:16 -0400 Organization: Columbia University Message-ID: <87hd2na3w3.fsf@photon.homelinux.org> References: <1150277991.614774.87970@y41g2000cwy.googlegroups.com> <87d5dbva7s.fsf@thalassa.informatimago.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1150317660 27987 80.91.229.2 (14 Jun 2006 20:41:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 14 Jun 2006 20:41:00 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 14 22:40:57 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FqcAC-00054C-KK for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Jun 2006 22:40:32 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FqcAC-0006Ue-4p for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Jun 2006 16:40:32 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon06.news.prodigy.com!prodigy.net!newsfeed.nyu.edu!newsmaster.cc.columbia.edu!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 78 Original-NNTP-Posting-Host: dyn-carl-201-40.dyn.columbia.edu Original-X-Trace: newsmaster.cc.columbia.edu 1150316236 6302 160.39.201.40 (14 Jun 2006 20:17:16 GMT) Original-X-Complaints-To: postmaster@columbia.edu Original-NNTP-Posting-Date: 14 Jun 2006 20:17:16 GMT User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.0 (gnu/linux) Cancel-Lock: sha1:ZSi8gCActKbAAP2BjutWtCSpFSo= Original-Xref: shelby.stanford.edu gnu.emacs.help:139851 Original-To: help-gnu-emacs@gnu.org 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:35475 Archived-At: Pascal Bourguignon writes: > Andrea Russo writes: > >> alistair_happencross@hotmail.com writes: >> >>> I'd like to be able to reconnect to the running Emacs process and have >>> it display on my X server at home. Is this possible? >> >> In the X11 forwarded ssh shell: >> >> $ emacsclient -e "(make-frame-on-display \"$DISPLAY\")" >> >> Of course you should have started the emacs server with (server-start) >> in your .emacs file. > > This -e option is new. (Did it work already in 21.3?) > Moreover, it works only on the only emacs server per user. > > I've got three emacs running (one for erc, one for gnu and one for > programming, given the lack of threads in emacs...). > > So I have this in my ~/.emacs: > > > > (defvar *frame-server-job-ticket* "~/frame-emacs" > "Path to the job-ticket file.") > (setf *frame-server-job-ticket* "~/frame-emacs") > > (defun frame-server (&optional token-path) > (setf token-path (or token-path *frame-server-job-ticket*)) > (when (file-exists-p token-path) > (find-file token-path) > (make-frame-on-display > (delete ?\n (prog1 (buffer-string) > (kill-buffer (current-buffer)) > (delete-file token-path))) > (list (cons 'name (format "n%s" (frame-parameter nil 'name))))))) > > (defun frame-server-start () > (interactive) > (run-at-time nil 5 (function frame-server) nil)) > > (frame-server-start) > > (cond > ((member "(gnus)" command-line-args) > (setf *frame-server-job-ticket* "~/frame-gnus")) > ((member "(irc)" command-line-args) > (setf *frame-server-job-ticket* "~/frame-erc")) > (t > (server-start) > (setf *frame-server-job-ticket* "~/frame-emacs"))) > > > and I can open a new frame writing the display where to make it in one > of these files: ~/frame-gnus ~/frame-erc or ~/frame-emacs > for example with: > > echo $(hostname -f)$DISPLAY | ssh $REMOTE tee -a ~/frame-emacs \ > -a ~/frame-gnus \ > -a ~/frame-erc > > or, if you want it thru ssh: > > ssh -X bash -c 'echo $DISPLAY | tee -a ~/frame-emacs \ > -a ~/frame-gnus \ > -a ~/frame-erc ' > > -- > __Pascal Bourguignon__ http://www.informatimago.com/ > > "Indentation! -- I will show you how to indent when I indent your skull!" Great idea! Xiao-Yong