unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#3128: emacsclient 22.3 race condition when launching emacs is required
@ 2009-04-27 17:03 ` Terence Dineen
  2009-06-21  2:27   ` bug#3128: Bug#3128: " Glenn Morris
  2009-06-22  6:55   ` bug#3128: marked as done (emacsclient 22.3 race condition when launching emacs is required) Emacs bug Tracking System
  0 siblings, 2 replies; 4+ messages in thread
From: Terence Dineen @ 2009-04-27 17:03 UTC (permalink / raw)
  To: bug-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 687 bytes --]

I have emacs 22.3 installed on

$ uname -a
Linux void 2.6.9-67.0.1.ELsmp #1 SMP Fri Nov 30 11:57:43 EST 2007 x86_64
x86_64 x86_64 GNU/Linux

No emacs is running:

$ ps -e | grep emacs
$

If I invoke emacsclient at this point it does launch emacs but with an
unnecessary message on stderr and does not return (as expected since
--no-wait was not used):

$ echo $ALTERNATE_EDITOR
/sandbox/bin/emacs
$ emacsclient foo
emacsclient: connect: Connection refused

The newly launched emacs has a buffer open on foo but not as a server
buffer.

emacsclient is waiting for a done message from emacs and emacs is acting as
though it was launched by emacsclient using the --no-wait option.

Thanks.

[-- Attachment #2: Type: text/html, Size: 760 bytes --]

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

* bug#3128: Bug#3128: emacsclient 22.3 race condition when launching emacs is required
  2009-04-27 17:03 ` bug#3128: emacsclient 22.3 race condition when launching emacs is required Terence Dineen
@ 2009-06-21  2:27   ` Glenn Morris
  2009-06-22 17:22     ` Terence Dineen
  2009-06-22  6:55   ` bug#3128: marked as done (emacsclient 22.3 race condition when launching emacs is required) Emacs bug Tracking System
  1 sibling, 1 reply; 4+ messages in thread
From: Glenn Morris @ 2009-06-21  2:27 UTC (permalink / raw)
  To: Terence Dineen; +Cc: 3128

Terence Dineen wrote:

> $ echo $ALTERNATE_EDITOR
> /sandbox/bin/emacs
> $ emacsclient foo
> emacsclient: connect: Connection refused
>
> The newly launched emacs has a buffer open on foo but not as a server
> buffer.
>
> emacsclient is waiting for a done message from emacs and emacs is acting as
> though it was launched by emacsclient using the --no-wait option.


I don't really understand what you are saying the problem is, but if
you get the 23.0.95 pretest from

ftp://alpha.gnu.org/gnu/emacs/pretest/emacs-23.0.95.tar.gz

I think that

emacsclient -c -a "" foo

might do what you want it to do.





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

* bug#3128: marked as done (emacsclient 22.3 race condition when launching emacs is required)
  2009-04-27 17:03 ` bug#3128: emacsclient 22.3 race condition when launching emacs is required Terence Dineen
  2009-06-21  2:27   ` bug#3128: Bug#3128: " Glenn Morris
@ 2009-06-22  6:55   ` Emacs bug Tracking System
  1 sibling, 0 replies; 4+ messages in thread
From: Emacs bug Tracking System @ 2009-06-22  6:55 UTC (permalink / raw)
  To: Glenn Morris

[-- Attachment #1: Type: text/plain, Size: 940 bytes --]


Your message dated Mon, 22 Jun 2009 02:51:08 -0400
with message-id <stab40223n.fsf@fencepost.gnu.org>
and subject line Re: bug#3128: Bug#3128: emacsclient 22.3 race condition when launching emacs is required
has caused the Emacs bug report #3128,
regarding emacsclient 22.3 race condition when launching emacs is required
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com
immediately.)


-- 
3128: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=3128
Emacs Bug Tracking System
Contact owner@emacsbugs.donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 4549 bytes --]

[-- Attachment #2.1.1: Type: text/plain, Size: 687 bytes --]

I have emacs 22.3 installed on

$ uname -a
Linux void 2.6.9-67.0.1.ELsmp #1 SMP Fri Nov 30 11:57:43 EST 2007 x86_64
x86_64 x86_64 GNU/Linux

No emacs is running:

$ ps -e | grep emacs
$

If I invoke emacsclient at this point it does launch emacs but with an
unnecessary message on stderr and does not return (as expected since
--no-wait was not used):

$ echo $ALTERNATE_EDITOR
/sandbox/bin/emacs
$ emacsclient foo
emacsclient: connect: Connection refused

The newly launched emacs has a buffer open on foo but not as a server
buffer.

emacsclient is waiting for a done message from emacs and emacs is acting as
though it was launched by emacsclient using the --no-wait option.

Thanks.

[-- Attachment #2.1.2: Type: text/html, Size: 760 bytes --]

[-- Attachment #3: Type: message/rfc822, Size: 2577 bytes --]

From: Glenn Morris <rgm@gnu.org>
To: 3128-done@emacsbugs.donarmstrong.com
Subject: Re: bug#3128: Bug#3128: emacsclient 22.3 race condition when launching emacs is required
Date: Mon, 22 Jun 2009 02:51:08 -0400
Message-ID: <stab40223n.fsf@fencepost.gnu.org>


Glenn Morris wrote:

> Terence Dineen wrote:
>
>> $ echo $ALTERNATE_EDITOR
>> /sandbox/bin/emacs
>> $ emacsclient foo
>> emacsclient: connect: Connection refused
>>
>> The newly launched emacs has a buffer open on foo but not as a server
>> buffer.
>>
>> emacsclient is waiting for a done message from emacs and emacs is acting as
>> though it was launched by emacsclient using the --no-wait option.
>
>
> I don't really understand what you are saying the problem is

On reflection, I think you're asking for a feature that Emacs 22
simply does not have, namely the ability for emacsclient to start the
emacs server if it is not running, then connect to it. It doesn't work
like that. If it finds the server not running, it simply starts a
stand-alone emacs like any other alternate editor, and does not try to
communicate with it on a client/server basis. There is no "race
condition".

As I say, it sounds like Emacs 23 will have the feature you want.

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

* bug#3128: Bug#3128: emacsclient 22.3 race condition when launching emacs is required
  2009-06-21  2:27   ` bug#3128: Bug#3128: " Glenn Morris
@ 2009-06-22 17:22     ` Terence Dineen
  0 siblings, 0 replies; 4+ messages in thread
From: Terence Dineen @ 2009-06-22 17:22 UTC (permalink / raw)
  To: Glenn Morris

[-- Attachment #1: Type: text/plain, Size: 2239 bytes --]

 Glenn Morris wrote:

Terence Dineen wrote:



 $ echo $ALTERNATE_EDITOR
/sandbox/bin/emacs
$ emacsclient foo
emacsclient: connect: Connection refused

The newly launched emacs has a buffer open on foo but not as a server
buffer.

emacsclient is waiting for a done message from emacs and emacs is acting as
though it was launched by emacsclient using the --no-wait option.


 I don't really understand what you are saying the problem is, but if
you get the 23.0.95 pretest from
ftp://alpha.gnu.org/gnu/emacs/pretest/emacs-23.0.95.tar.gz

I think that

emacsclient -c -a "" foo

might do what you want it to do.


 Sorry, I see that my report was too terse.

I have built 23,0.95 and run the command you suggested.  It does behave as I
expected.

What I was trying to say in my bug report against 22.3 was:

If I have an emacs process running already and execute "emacsclient foo" the
result is that a new buffer appears in the emacs process as a server editing
buffer i.e. it has a message "When done with a buffer, type C-x #".  The
emacsclient invocation waits until the server buffer is dismissed.

On the other hand, if I do not have an emacs process running already before
executing "emacsclient foo" the result is message from emacsclient

    emacsclient: connect: Connection refused

an emacs process is started and it has a buffer on foo.  However that buffer
is not a server editing buffer (C-x # does nothing) and the emacsclient
process does not terminate until the emacs process it launched is
terminated.  Maybe I am missing something, but my expection was that
emacsclient would behave roughly as follows when there is no emacs process
alreadt running:

1) notice the absence of a running emacs
2) use the -a option or the ALTERNATIVE_EDITOR to find another image to
launch
3) launch it and wait for it to open the appropriate socket
4) start doing whatever it would have done to tell the now running emacs to
open a server editing buffer on foo if it had found a running emacs in the
first place.

I guess I can now see that emacsclient can't know that the alternate editor
is even emacs so it can't use the same protocol as it would have had it
found a running emacs server in the first place.

Sorry for the distraction.

[-- Attachment #2: Type: text/html, Size: 2703 bytes --]

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

end of thread, other threads:[~2009-06-22 17:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <stab40223n.fsf@fencepost.gnu.org>
2009-04-27 17:03 ` bug#3128: emacsclient 22.3 race condition when launching emacs is required Terence Dineen
2009-06-21  2:27   ` bug#3128: Bug#3128: " Glenn Morris
2009-06-22 17:22     ` Terence Dineen
2009-06-22  6:55   ` bug#3128: marked as done (emacsclient 22.3 race condition when launching emacs is required) Emacs bug Tracking System

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