all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
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 18:39:08 +0200	[thread overview]
Message-ID: <871w1w1kur.fsf@hubble.informatimago.com> (raw)
In-Reply-To: mailman.14703.1216046707.18990.help-gnu-emacs@gnu.org

anhnmncb <anhnmncb@gmail.com> writes:

> pjb@informatimago.com (Pascal J. Bourguignon) writes:
>
>> anhnmncb <anhnmncb@gmail.com> writes:
>>
>>> hmm, I want to run emacs with server-start in Xorg, then create a frame
>>> in console, then in the console frame, M-x server-start to make that
>>> frame become an emacs server too, so now I can safely exit the emacs
>>> running on xorg.
>>
>> This is where you are in error.  There is not one instance of emacs
>> per frame.  Frames are but windows open on the same emacs process.
>> You can make-frame and  delete-frame at will, but this is always the
>> same emacs process.  
>>
>> In addition, server-start is totally independant of what frames emacs
>> has currently open.
>> "Running emacs with server-start in Xorg" is meaningless a sentence.
>>
>> If you exit emacs from one frame, then all frames will be killed,
>> because there's only one emacs process.
>>
>> And if you delete the last frame, emacs will also be killed, that's
>> why I'd advise you to always keep at least one (unused) frame open, so
>> you can reconnect to your emacs process when you get disconnected from
>> your current frame/tty.
>
> Thanks for the patient and detailed explanation! Make me realise my
> totally wrong concept misled you.
>
> Let me give another try to express my need:
>
> I start an emacs process, then make a new frame, then let this new frame
> become a new emacs process, is it possible?

No, this is not possible.


There is one thing that would be possible, at the X11 level, but it
wouldn't be too interesting.  In X11, you can open a window inside
another window.  Some programs take a -windowid option to let you
choose which window they should be hosted in.

To see what I mean, try this:

export DISPLAY=:0.0
emacs & 
xv -windowid $(xwininfo -int  2> /dev/null |awk '/Window id/{print $4}') some-picture.jpg

and then, click on the emacs frame.  xv will display the picture
inside the emacs frame.

So we could imagine a patched emacs that would take a -windowid
option, and then you could launch a new emacs process that would use
an existing frame.  I don't know what X would do if the old process
was killed then, I guess it would kill the surrounding frame, since it
would still belong to the original process, along with the embedded
frame of the second process.


Perhaps the following solution would match your need.  Instead of
opening the frames directly in the native X server, you could run them
in a Xnest server.  Then you could launch another emacs process, open
a frame in the same Xnest server.  Both emacs frames would be
displayed inside the same Xnest window, but as independent Xnest
windows.  The next step would be to use xmove or vnc to move X windows
from one display to another, and manage sessions:

http://www.hermann-uwe.de/blog/how-to-hijack-an-already-running-x11-application-via-ssh-x

-- 
__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.


  parent reply	other threads:[~2008-07-14 16:39 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
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 [this message]
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=871w1w1kur.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.