bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#3128: Bug#3128: emacsclient 22.3 race condition when launching emacs


From: Terence Dineen
Subject: bug#3128: Bug#3128: emacsclient 22.3 race condition when launching emacs is required
Date: Mon, 22 Jun 2009 13:22:11 -0400

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.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]