all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* --daemon vs. server-start
@ 2009-01-21 23:03 Stephen Berman
  2009-01-23 20:39 ` Dan Nicolaescu
  0 siblings, 1 reply; 10+ messages in thread
From: Stephen Berman @ 2009-01-21 23:03 UTC (permalink / raw)
  To: emacs-devel

GNU Emacs 23.0.60.30 (i686-pc-linux-gnu, GTK+ Version 2.14.4) of
2009-01-21 on escher

The discussion of the Emacs server in the Emacs manual (node Emacs
Server) suggests that --daemon and server-start are basically equivalent
methods of starting the server (aside from the difference with respect
to frames, of course).  This leads me to expect that regardless of which
way I start the server, the result of subsequently invoking emacsclient
should be the same.  But I have encountered some systematic asymmetries.
I don't know if these are expected but undocumented, or I have failed to
find the documentation, or there is a bug.

(i) One asymmetry concerns certain X resources passed via the -xrm
command line option (these are all shell invocations):

emacs -Q -xrm 'Emacs.ReverseVideo: on' -f server-start
emacsclient -c
=> The client frame is in reverse video

emacs -Q -xrm 'Emacs.ReverseVideo: on' --daemon
emacsclient -c
=> The client frame is in normal video

The same pattern holds for the resources Foreground, Background,
MenuBar, ToolBar.  (I haven't tested all X resources yet.)  In contrast,
for resources that have their own command line option, there is no
asymmetry:

emacs -Q -rv -f server-start
emacsclient -c
=> The client frame is in reverse video

emacs -Q -rv --daemon
emacsclient -c
=> The client frame is in reverse video

Likewise for -fg and -bg.

(ii) Another asymmetry concerns the font specification option -fn:

emacs -Q -fn "Dejavu Sans Mono-10" -f server-start
emacsclient -c
=> The client frame's font is Dejavu Sans Mono-10

emacs -Q -fn "Dejavu Sans Mono-10" --daemon
emacsclient -c
=> The client frame's font is
-etl-fixed-medium-r-normal--16-160-72-72-c-80-iso8859-1

(On my system the latter font is used when invoking emacsclient after
emacs with the --daemon option regardless of which font I specify with
-fn.)

(iii) In the preceding cases it is with --daemon that the expected (and
desirable) result of invoking emacsclient is missing.  But there is also
a case, apparently unrelated to X resources, where after invoking Emacs
with --daemon, the result of invoking emacsclient is what I expect (and
prefer) but not after invoking Emacs with -f start-server:

emacs -Q --daemon
emacsclient -c
=> The frame that appears has desktop focus

emacs -Q -f start-server
emacsclient -c
=> The frame that appears does not have desktop focus (rather, the xterm
window still has focus).

All these aysmmetries seem like bugs.  Are they?

Steve Berman





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

* Re: --daemon vs. server-start
  2009-01-21 23:03 --daemon vs. server-start Stephen Berman
@ 2009-01-23 20:39 ` Dan Nicolaescu
  2009-01-23 23:33   ` Stephen Berman
  2009-01-25  7:29   ` Giorgos Keramidas
  0 siblings, 2 replies; 10+ messages in thread
From: Dan Nicolaescu @ 2009-01-23 20:39 UTC (permalink / raw)
  To: Stephen Berman; +Cc: emacs-devel

Stephen Berman <stephen.berman@gmx.net> writes:

  > GNU Emacs 23.0.60.30 (i686-pc-linux-gnu, GTK+ Version 2.14.4) of
  > 2009-01-21 on escher
  > 
  > The discussion of the Emacs server in the Emacs manual (node Emacs
  > Server) suggests that --daemon and server-start are basically equivalent
  > methods of starting the server (aside from the difference with respect
  > to frames, of course).  

That's an overreach, yes the --daemon starts the server, but it's not
equivalent. 


  > This leads me to expect that regardless of which
  > way I start the server, the result of subsequently invoking emacsclient
  > should be the same.  But I have encountered some systematic asymmetries.
  > I don't know if these are expected but undocumented, or I have failed to
  > find the documentation, or there is a bug.

  > (i) One asymmetry concerns certain X resources passed via the -xrm
  > command line option (these are all shell invocations):
  > 
  > emacs -Q -xrm 'Emacs.ReverseVideo: on' -f server-start
  > emacsclient -c
  > => The client frame is in reverse video

You seem to assume that "emacs" and "emacs --daemon" are doing the same
thing, they are not,
emacs --daemon 
is similar to 
emacs -nw -f server-start

so emacs --daemon it will ignore all the X11 related options.


  > 
  > emacs -Q -xrm 'Emacs.ReverseVideo: on' --daemon
  > emacsclient -c
  > => The client frame is in normal video
  > 
  > The same pattern holds for the resources Foreground, Background,
  > MenuBar, ToolBar.  (I haven't tested all X resources yet.)  In contrast,
  > for resources that have their own command line option, there is no
  > asymmetry:
  > 
  > emacs -Q -rv -f server-start
  > emacsclient -c
  > => The client frame is in reverse video

This works because -rv works when using -nw.





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

* Re: --daemon vs. server-start
  2009-01-23 20:39 ` Dan Nicolaescu
@ 2009-01-23 23:33   ` Stephen Berman
  2009-01-24  0:44     ` Dan Nicolaescu
  2009-01-25  7:29   ` Giorgos Keramidas
  1 sibling, 1 reply; 10+ messages in thread
From: Stephen Berman @ 2009-01-23 23:33 UTC (permalink / raw)
  To: emacs-devel

On Fri, 23 Jan 2009 12:39:06 -0800 (PST) Dan Nicolaescu <dann@ics.uci.edu> wrote:

> You seem to assume that "emacs" and "emacs --daemon" are doing the same
> thing, they are not,
> emacs --daemon 
> is similar to 
> emacs -nw -f server-start

Thanks for the clarification.  Obviously, I did not understand this from
the documentation (Emacs manual, NEWS).  Did I overlook it?  If so,
would you please give me a pointer, and if not, could this please be
documented?

> so emacs --daemon it will ignore all the X11 related options.

Is this fundamental to starting Emacs without an initial frame, or an
artifact of the current implementation?  In other words, could --daemon
be implemented in a way that allows passing X11 options?  One thing that
makes me think this should be possible is the fact that I can "pass" X11
options that are exposed to Lisp; e.g., when I invoke Emacs like this:

emacs -Q --daemon --eval "(setq default-frame-alist '((font-backend . \"xft\") (font . \"Dejavu Sans-10\")))"

and then invoke `emacsclient -c', the frame that appears has the font
Dejavu Sans-10 with antialiasing.  In contrast, as I observed in my OP,
with this invocation:

emacs -Q --daemon -xrm "Emacs.FontBackend: xft" -fn "Dejavu Sans-10"

the frame that appears upon `emacsclient -c' has neither antialiasing
nor this font.  What I don't understand is why the former invocation
"works" and the latter doesn't.  (I accept that that's the way it is, I
just don't see why.)  I'd be interested in and grateful for an
explanation.

Steve Berman





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

* Re: --daemon vs. server-start
  2009-01-23 23:33   ` Stephen Berman
@ 2009-01-24  0:44     ` Dan Nicolaescu
  2009-01-24 14:30       ` Stephen Berman
  0 siblings, 1 reply; 10+ messages in thread
From: Dan Nicolaescu @ 2009-01-24  0:44 UTC (permalink / raw)
  To: Stephen Berman; +Cc: emacs-devel

Stephen Berman <stephen.berman@gmx.net> writes:

  > On Fri, 23 Jan 2009 12:39:06 -0800 (PST) Dan Nicolaescu <dann@ics.uci.edu> wrote:
  > 
  > > You seem to assume that "emacs" and "emacs --daemon" are doing the same
  > > thing, they are not,
  > > emacs --daemon 
  > > is similar to 
  > > emacs -nw -f server-start
  > 
  > Thanks for the clarification.  Obviously, I did not understand this from
  > the documentation (Emacs manual, NEWS).  Did I overlook it?  If so,
  > would you please give me a pointer, and if not, could this please be
  > documented?

No idea if this is documented, and I personally think it's not worth
bothering, but probably the docs people would welcome patches.


  > > so emacs --daemon it will ignore all the X11 related options.
  > 
  > Is this fundamental to starting Emacs without an initial frame, or
  > an artifact of the current implementation?  In other words, could
  > --daemon be implemented in a way that allows passing X11 options?

It probably could, no idea how hard it would be.  Just needs someone
that cares about this to sit down and do it.

  > One thing that
  > makes me think this should be possible is the fact that I can "pass" X11
  > options that are exposed to Lisp; e.g., when I invoke Emacs like this:
  > 
  > emacs -Q --daemon --eval "(setq default-frame-alist '((font-backend . \"xft\") (font . \"Dejavu Sans-10\")))"

This is not passing X11 options, this directly setting internal data
structures, you can do anything that way. 

  > 
  > and then invoke `emacsclient -c', the frame that appears has the font
  > Dejavu Sans-10 with antialiasing.  In contrast, as I observed in my OP,
  > with this invocation:
  > 
  > emacs -Q --daemon -xrm "Emacs.FontBackend: xft" -fn "Dejavu Sans-10"
  > 
  > the frame that appears upon `emacsclient -c' has neither antialiasing
  > nor this font.  What I don't understand is why the former invocation
  > "works" and the latter doesn't.  (I accept that that's the way it is, I
  > just don't see why.)  I'd be interested in and grateful for an
  > explanation.

Again, starting 
emacs -Q --daemon
is similar to starting
emacs -Q -nw -f server-start 
add your options at the end and compare the effect.




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

* Re: --daemon vs. server-start
  2009-01-24  0:44     ` Dan Nicolaescu
@ 2009-01-24 14:30       ` Stephen Berman
  2009-01-24 18:22         ` Dan Nicolaescu
  0 siblings, 1 reply; 10+ messages in thread
From: Stephen Berman @ 2009-01-24 14:30 UTC (permalink / raw)
  To: emacs-devel

On Fri, 23 Jan 2009 16:44:16 -0800 (PST) Dan Nicolaescu <dann@ics.uci.edu> wrote:

> Stephen Berman <stephen.berman@gmx.net> writes:
>
>   > On Fri, 23 Jan 2009 12:39:06 -0800 (PST) Dan Nicolaescu <dann@ics.uci.edu> wrote:
>   > 
>   > > You seem to assume that "emacs" and "emacs --daemon" are doing the same
>   > > thing, they are not,
>   > > emacs --daemon 
>   > > is similar to 
>   > > emacs -nw -f server-start
>   > 
>   > Thanks for the clarification.  Obviously, I did not understand this from
>   > the documentation (Emacs manual, NEWS).  Did I overlook it?  If so,
>   > would you please give me a pointer, and if not, could this please be
>   > documented?
>
> No idea if this is documented, and I personally think it's not worth
> bothering, 

If it is not documented, how is one to know that `emacs --daemon' is
similar to `emacs -nw -f server-start' rather than `emacs -f
server-start' and hence incompatible with X11 options (other than by
trying both, seeing the asymmetry and asking on emacs-devel)?

>            but probably the docs people would welcome patches.

I will report a bug and suggest a doc fix.

[...]
>   > and then invoke `emacsclient -c', the frame that appears has the font
>   > Dejavu Sans-10 with antialiasing.  In contrast, as I observed in my OP,
>   > with this invocation:
>   > 
>   > emacs -Q --daemon -xrm "Emacs.FontBackend: xft" -fn "Dejavu Sans-10"
>   > 
>   > the frame that appears upon `emacsclient -c' has neither antialiasing
>   > nor this font.  What I don't understand is why the former invocation
>   > "works" and the latter doesn't.  (I accept that that's the way it is, I
>   > just don't see why.)  I'd be interested in and grateful for an
>   > explanation.
>
> Again, starting 
> emacs -Q --daemon
> is similar to starting
> emacs -Q -nw -f server-start 
> add your options at the end and compare the effect.

I understand *that* they are similar, but I would like to know *why*
they are similar.  I looked at the parts of the source dealing with the
daemon but saw nothing that made the similarity, and the consequent
incompatibility with X11 options, clear to me.  What should I be looking
for?  (If this question indicates that my understanding is too little to
comprehend the answer, then I guess I'll have to give up for now.)

Steve Berman





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

* Re: --daemon vs. server-start
  2009-01-24 14:30       ` Stephen Berman
@ 2009-01-24 18:22         ` Dan Nicolaescu
  2009-01-24 20:53           ` Stephen Berman
  0 siblings, 1 reply; 10+ messages in thread
From: Dan Nicolaescu @ 2009-01-24 18:22 UTC (permalink / raw)
  To: Stephen Berman; +Cc: emacs-devel

Stephen Berman <stephen.berman@gmx.net> writes:

  > On Fri, 23 Jan 2009 16:44:16 -0800 (PST) Dan Nicolaescu <dann@ics.uci.edu> wrote:

  > > Again, starting 
  > > emacs -Q --daemon
  > > is similar to starting
  > > emacs -Q -nw -f server-start 
  > > add your options at the end and compare the effect.
  > 
  > I understand *that* they are similar, but I would like to know *why*
  > they are similar.  I looked at the parts of the source dealing with the
  > daemon but saw nothing that made the similarity, and the consequent
  > incompatibility with X11 options, clear to me.  What should I be looking
  > for?  (If this question indicates that my understanding is too little to
  > comprehend the answer, then I guess I'll have to give up for now.)

Command line option processing depends on `initial-window-system'.
emacs --daemon does not start any X11 connection, so
initial-window-system is nil.




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

* Re: --daemon vs. server-start
@ 2009-01-24 20:49 Stefan Monnier
  0 siblings, 0 replies; 10+ messages in thread
From: Stefan Monnier @ 2009-01-24 20:49 UTC (permalink / raw)
  To: Stephen Berman; +Cc: emacs-devel

> Dejavu Sans-10 with antialiasing.  In contrast, as I observed in my OP,
> with this invocation:

> emacs -Q --daemon -xrm "Emacs.FontBackend: xft" -fn "Dejavu Sans-10"

> the frame that appears upon `emacsclient -c' has neither antialiasing
> nor this font.

I think it's an unintended side-effect of the current code.
Without having looked at the details of the code, I'd expect that it
should be possible to make it work, tho it may require
significant efforts.  I.e. patches welcome.


        Stefan




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

* Re: --daemon vs. server-start
  2009-01-24 18:22         ` Dan Nicolaescu
@ 2009-01-24 20:53           ` Stephen Berman
  0 siblings, 0 replies; 10+ messages in thread
From: Stephen Berman @ 2009-01-24 20:53 UTC (permalink / raw)
  To: emacs-devel

On Sat, 24 Jan 2009 10:22:20 -0800 (PST) Dan Nicolaescu <dann@ics.uci.edu> wrote:

> Stephen Berman <stephen.berman@gmx.net> writes:
>
>   > On Fri, 23 Jan 2009 16:44:16 -0800 (PST) Dan Nicolaescu <dann@ics.uci.edu> wrote:
>
>   > > Again, starting 
>   > > emacs -Q --daemon
>   > > is similar to starting
>   > > emacs -Q -nw -f server-start 
>   > > add your options at the end and compare the effect.
>   > 
>   > I understand *that* they are similar, but I would like to know *why*
>   > they are similar.  I looked at the parts of the source dealing with the
>   > daemon but saw nothing that made the similarity, and the consequent
>   > incompatibility with X11 options, clear to me.  What should I be looking
>   > for?  (If this question indicates that my understanding is too little to
>   > comprehend the answer, then I guess I'll have to give up for now.)
>
> Command line option processing depends on `initial-window-system'.
> emacs --daemon does not start any X11 connection, so
> initial-window-system is nil.

Ok, thanks.

Steve Berman





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

* Re: --daemon vs. server-start
  2009-01-23 20:39 ` Dan Nicolaescu
  2009-01-23 23:33   ` Stephen Berman
@ 2009-01-25  7:29   ` Giorgos Keramidas
  2009-01-25  7:56     ` mail
  1 sibling, 1 reply; 10+ messages in thread
From: Giorgos Keramidas @ 2009-01-25  7:29 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: Stephen Berman, emacs-devel

On Fri, 23 Jan 2009 12:39:06 -0800 (PST), Dan Nicolaescu <dann@ics.uci.edu> wrote:
> You seem to assume that "emacs" and "emacs --daemon" are doing the same
> thing, they are not,
> emacs --daemon
> is similar to
> emacs -nw -f server-start
>
> so emacs --daemon it will ignore all the X11 related options.

Ah!  That explains the differences I see in fringe faces and a few other
things when I create new frames with `emacsclient -c'.

Does Emacs ignore DISPLAY and other X11 related options when --daemon
starts so that it can outlive the X server without problems?





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

* Re: --daemon vs. server-start
  2009-01-25  7:29   ` Giorgos Keramidas
@ 2009-01-25  7:56     ` mail
  0 siblings, 0 replies; 10+ messages in thread
From: mail @ 2009-01-25  7:56 UTC (permalink / raw)
  To: emacs-devel

Giorgos Keramidas <keramida@ceid.upatras.gr> writes:
> Ah!  That explains the differences I see in fringe faces and a few other
> things when I create new frames with `emacsclient -c'.
>
> Does Emacs ignore DISPLAY and other X11 related options when --daemon
> starts so that it can outlive the X server without problems?
>

Possibly also so that `emacsclient -c' can be run on multiple displays?





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

end of thread, other threads:[~2009-01-25  7:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-21 23:03 --daemon vs. server-start Stephen Berman
2009-01-23 20:39 ` Dan Nicolaescu
2009-01-23 23:33   ` Stephen Berman
2009-01-24  0:44     ` Dan Nicolaescu
2009-01-24 14:30       ` Stephen Berman
2009-01-24 18:22         ` Dan Nicolaescu
2009-01-24 20:53           ` Stephen Berman
2009-01-25  7:29   ` Giorgos Keramidas
2009-01-25  7:56     ` mail
  -- strict thread matches above, loose matches on Subject: below --
2009-01-24 20:49 Stefan Monnier

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.