From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Pascal Bourguignon Newsgroups: gmane.emacs.help Subject: Re: Connecting to remote Emacs? Date: Wed, 14 Jun 2006 20:55:03 +0200 Organization: Informatimago Message-ID: <87d5dbva7s.fsf@thalassa.informatimago.com> References: <1150277991.614774.87970@y41g2000cwy.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1150314060 15254 80.91.229.2 (14 Jun 2006 19:41:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 14 Jun 2006 19:41:00 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 14 21:40:56 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 1FqbE7-0001k1-BL for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Jun 2006 21:40:31 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FqbE6-0005T6-TG for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Jun 2006 15:40:30 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 72 Original-X-Trace: individual.net 2F+Iy2XSH46u2UwTLd8LqAK5PwDLwyQR/Chjh4HDU43OiaWlml Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en X-Disabled: X-No-Archive: no User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:/qAS94ZYvDdOdvFblWmT91RS20k= Original-Xref: shelby.stanford.edu gnu.emacs.help:139850 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:35474 Archived-At: 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!"