unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Where is the code for the Emacs server in the core?
@ 2018-01-12  7:58 George Plymale II
  2018-01-12  9:39 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: George Plymale II @ 2018-01-12  7:58 UTC (permalink / raw)
  To: emacs-devel

Hi,

I am trying to find the code in the Emacs core which implements the
Emacs server / daemon. The reason I am looking is that I am curious
about implementing multi-tty support in the Emacs Mac Port by Yamamoto
Mitsuharu. Unfortunately, I believe that I must first see the code that
governs the Emacs server. I am not sure if that is the right place to
look, but I am unsure where else the problem could be. The Emacs server
purposefully rejects requests to have a terminal and GUI client. I
assume it also governs which process will be in charge of all the Emacs
clients. So I thought the server code would be the best place to look.

I did a directory diff on the source trees of the Emacs Mac Port and
plain GNU Emacs. But I could not find anything which indicated a
difference in either server. Moreover, I could not find anything related
to the Emacs server.

Could anyone help shed some light on this situation? I've not looked at
much of the Emacs core in the past, except the Lisp interpreter, so I'm
not very familiar with its landscape.

Thanks



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Where is the code for the Emacs server in the core?
  2018-01-12  7:58 Where is the code for the Emacs server in the core? George Plymale II
@ 2018-01-12  9:39 ` Eli Zaretskii
  2018-01-13 15:51   ` George Plymale II
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2018-01-12  9:39 UTC (permalink / raw)
  To: George Plymale II; +Cc: emacs-devel

> From: George Plymale II <georgie@southernohio.net>
> Date: Fri, 12 Jan 2018 02:58:42 -0500
> 
> I am trying to find the code in the Emacs core which implements the
> Emacs server / daemon. The reason I am looking is that I am curious
> about implementing multi-tty support in the Emacs Mac Port by Yamamoto
> Mitsuharu. Unfortunately, I believe that I must first see the code that
> governs the Emacs server. I am not sure if that is the right place to
> look, but I am unsure where else the problem could be. The Emacs server
> purposefully rejects requests to have a terminal and GUI client. I
> assume it also governs which process will be in charge of all the Emacs
> clients. So I thought the server code would be the best place to look.

Multi-tty support depends on two features:

  . the ability to have more than one display_info object, so that
    some could be used for TTY frames and others for GUI frames
  . the ability to open a TTY frame on a named tty device, see
    make-terminal-frame

emacsclient and server.el use these two abilities to request creation
of a new frame either on a different TTY device or on a different X
display.  The files where this functionality is implemented are
emacsclient.c, server.el, frame.el and frame.c.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Where is the code for the Emacs server in the core?
  2018-01-12  9:39 ` Eli Zaretskii
@ 2018-01-13 15:51   ` George Plymale II
  2018-01-13 16:52     ` Eli Zaretskii
  2018-01-13 17:00     ` Alan Third
  0 siblings, 2 replies; 7+ messages in thread
From: George Plymale II @ 2018-01-13 15:51 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Thanks a lot for the information. Your advice has been quite helpful and
I think that I've found some of the regions of code that I was looking
for. At least it's a start so hopefully I can figure the rest out.

One more thing I'd like to have a second opinion on:

> The Mac port doesn't support multi-tty with GUI.  The developer has no
> idea how to detach Emacs as a GUI application from Window Server or
> Dock without separating a GUI process (not thread) from the main Emacs
> (Lisp evaluator) process.  TTY-only multi-tty is supposed to work.

That is Yamamoto Mitsuharu's statement on why multi-tty is not supported
on the Emacs Mac Port. Does plain GNU Emacs have this problem? If so,
how does it get around or solve it? I have to assume that plain GNU
Emacs is also attached to the Window Server or Dock as well so I'm
wondering if there's something I'm missing.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Where is the code for the Emacs server in the core?
  2018-01-13 15:51   ` George Plymale II
@ 2018-01-13 16:52     ` Eli Zaretskii
  2018-01-13 20:05       ` George Plymale II
  2018-01-13 17:00     ` Alan Third
  1 sibling, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2018-01-13 16:52 UTC (permalink / raw)
  To: George Plymale II; +Cc: emacs-devel

> From: George Plymale II <georgedp@orbitalimpact.com>
> Cc: emacs-devel@gnu.org
> Date: Sat, 13 Jan 2018 10:51:55 -0500
> 
> > The Mac port doesn't support multi-tty with GUI.  The developer has no
> > idea how to detach Emacs as a GUI application from Window Server or
> > Dock without separating a GUI process (not thread) from the main Emacs
> > (Lisp evaluator) process.  TTY-only multi-tty is supposed to work.
> 
> That is Yamamoto Mitsuharu's statement on why multi-tty is not supported
> on the Emacs Mac Port. Does plain GNU Emacs have this problem? If so,
> how does it get around or solve it? I have to assume that plain GNU
> Emacs is also attached to the Window Server or Dock as well so I'm
> wondering if there's something I'm missing.

I know nothing about how macOS works wrt GUI applications, so I don't
understand what is meant by "attached to the Window Server or Dock",
nor how to compare that with what Emacs does on X, sorry.  Perhaps
someone else could chime in.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Where is the code for the Emacs server in the core?
  2018-01-13 15:51   ` George Plymale II
  2018-01-13 16:52     ` Eli Zaretskii
@ 2018-01-13 17:00     ` Alan Third
  2018-01-13 20:02       ` George Plymale II
  1 sibling, 1 reply; 7+ messages in thread
From: Alan Third @ 2018-01-13 17:00 UTC (permalink / raw)
  To: George Plymale II; +Cc: Eli Zaretskii, emacs-devel

On Sat, Jan 13, 2018 at 10:51:55AM -0500, George Plymale II wrote:
> > The Mac port doesn't support multi-tty with GUI.  The developer has no
> > idea how to detach Emacs as a GUI application from Window Server or
> > Dock without separating a GUI process (not thread) from the main Emacs
> > (Lisp evaluator) process.  TTY-only multi-tty is supposed to work.
> 
> That is Yamamoto Mitsuharu's statement on why multi-tty is not supported
> on the Emacs Mac Port. Does plain GNU Emacs have this problem? If so,
> how does it get around or solve it? I have to assume that plain GNU
> Emacs is also attached to the Window Server or Dock as well so I'm
> wondering if there's something I'm missing.

I’m not sure this is relevant, but if you do this on the NS port:

     Open GUI instance
     start server
     run ‘emacsclient -t’ in the terminal
     close GUI frame

You can’t open a new GUI frame, even though the GUI instance with the
server is still running. You can see it in the dock, and access the
menus, but I can’t find any way to create a new frame.

So while it works, it’s not perfect.

I don’t know what we do differently from the Mac port.
-- 
Alan Third



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Where is the code for the Emacs server in the core?
  2018-01-13 17:00     ` Alan Third
@ 2018-01-13 20:02       ` George Plymale II
  0 siblings, 0 replies; 7+ messages in thread
From: George Plymale II @ 2018-01-13 20:02 UTC (permalink / raw)
  To: Alan Third; +Cc: eliz, emacs-devel

Yes, thank you for reminding me of that behavior. I had quite forgotten
about that weirdness since I use this package:
https://github.com/DarwinAwardWinner/osx-pseudo-daemon

So I guess maybe things aren't very different between the NS port and
the Mac Port... certainly some more investigation is needed.

Thanks



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Where is the code for the Emacs server in the core?
  2018-01-13 16:52     ` Eli Zaretskii
@ 2018-01-13 20:05       ` George Plymale II
  0 siblings, 0 replies; 7+ messages in thread
From: George Plymale II @ 2018-01-13 20:05 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> From: George Plymale II <georgedp@orbitalimpact.com>
>> Cc: emacs-devel@gnu.org
>> Date: Sat, 13 Jan 2018 10:51:55 -0500
>> 
>> > The Mac port doesn't support multi-tty with GUI.  The developer has no
>> > idea how to detach Emacs as a GUI application from Window Server or
>> > Dock without separating a GUI process (not thread) from the main Emacs
>> > (Lisp evaluator) process.  TTY-only multi-tty is supposed to work.
>> 
>> That is Yamamoto Mitsuharu's statement on why multi-tty is not supported
>> on the Emacs Mac Port. Does plain GNU Emacs have this problem? If so,
>> how does it get around or solve it? I have to assume that plain GNU
>> Emacs is also attached to the Window Server or Dock as well so I'm
>> wondering if there's something I'm missing.
>
> I know nothing about how macOS works wrt GUI applications, so I don't
> understand what is meant by "attached to the Window Server or Dock",
> nor how to compare that with what Emacs does on X, sorry.  Perhaps
> someone else could chime in.

No problem, Alan has given some useful input on my conjectures.



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-01-13 20:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-12  7:58 Where is the code for the Emacs server in the core? George Plymale II
2018-01-12  9:39 ` Eli Zaretskii
2018-01-13 15:51   ` George Plymale II
2018-01-13 16:52     ` Eli Zaretskii
2018-01-13 20:05       ` George Plymale II
2018-01-13 17:00     ` Alan Third
2018-01-13 20:02       ` George Plymale II

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).