From: pjb@informatimago.com (Pascal J. Bourguignon)
To: help-gnu-emacs@gnu.org
Subject: Re: possible to exchange server and client?
Date: Mon, 14 Jul 2008 11:56:04 +0200 [thread overview]
Message-ID: <87tzes23ij.fsf@hubble.informatimago.com> (raw)
In-Reply-To: mailman.14687.1216021747.18990.help-gnu-emacs@gnu.org
Peter Dyballa <Peter_Dyballa@Web.DE> writes:
> Am 14.07.2008 um 02:20 schrieb anhnmncb:
>
>> So I want to know, in this condition, if I can start an emacsclient
>> in console, then let it become server(old emacs server on Xorg
>> becomes client now), then close the emacs(old server) on Xorg,
>> restart Xorg, run emacsclient, let it become server again?
I still don't understand very well what the OP wants, but this might help.
Sometimes, I have an emacs running on host A, I connect from host B to
host A with ssh -X, and I want to open a frame of the running emacs on
a X display on host B.
To do that, I plan ahead, and have this in my ~/.emacs (on host A):
(defparameter *frame-server-job-ticket* "~/frame-emacs"
"Path to the job-ticket file.")
(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)
Then I only have to create the job ticket:
B> ssh -X user@A
A> echo $DISPLAY > ~/.frame-emacs
and wait for the frame to appear on B.
Nowadays, this could also be done simply with:
B> ssh -X user@A
A> emacsclient -e '(make-frame-on-display "'"$DISPLAY"'")'
--
__Pascal Bourguignon__ http://www.informatimago.com/
THIS IS A 100% MATTER PRODUCT: In the unlikely event that this
merchandise should contact antimatter in any form, a catastrophic
explosion will result.
next prev parent reply other threads:[~2008-07-14 9:56 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-13 1:10 possible to exchange server and client? anhnmncb
2008-07-13 20:13 ` Peter Dyballa
2008-07-14 0:20 ` anhnmncb
2008-07-14 7:48 ` Peter Dyballa
2008-07-14 9:40 ` anhnmncb
2008-07-14 11:47 ` Peter Dyballa
2008-07-14 12:47 ` anhnmncb
2008-07-14 13:58 ` Peter Dyballa
2008-07-14 14:37 ` anhnmncb
[not found] ` <mailman.14692.1216028482.18990.help-gnu-emacs@gnu.org>
2008-07-14 10:02 ` Pascal J. Bourguignon
[not found] ` <mailman.14687.1216021747.18990.help-gnu-emacs@gnu.org>
2008-07-14 9:56 ` Pascal J. Bourguignon [this message]
2008-07-14 12:12 ` anhnmncb
[not found] ` <mailman.14698.1216038116.18990.help-gnu-emacs@gnu.org>
2008-07-14 12:47 ` Pascal J. Bourguignon
2008-07-14 14:35 ` anhnmncb
2008-07-14 15:13 ` Peter Dyballa
2008-07-14 15:31 ` anhnmncb
[not found] ` <mailman.14703.1216046707.18990.help-gnu-emacs@gnu.org>
2008-07-14 16:39 ` Pascal J. Bourguignon
2008-07-14 23:22 ` anhnmncb
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87tzes23ij.fsf@hubble.informatimago.com \
--to=pjb@informatimago.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.