From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: Pretest Date: Mon, 20 Nov 2006 01:59:00 +0100 Message-ID: <4560FDD4.2060103@student.lu.se> References: <87slggjtbb.fsf@furball.mit.edu> <455F9024.8080000@student.lu.se> <17759.43936.82301.353794@kahikatea.snap.net.nz> <85irhbg6zx.fsf@lola.goethe.zz> <17760.11257.78362.216206@kahikatea.snap.net.nz> <85wt5reo3b.fsf@lola.goethe.zz> <17760.17309.553008.718144@kahikatea.snap.net.nz> <85slgfcy5v.fsf@lola.goethe.zz> <45606E21.9030000@student.lu.se> <45609A48.2080905@gnu.org> <4560B581.3030201@gnu.org> <851wnzb1sz.fsf@lola.goethe.zz> <4560CDBD.3080308@gnu.org> <857ixr9ke7.fsf@lola.goethe.zz> <4560D570.9060103@student.lu.se> <85y7q783ak.fsf@lola.goethe.zz> <4560E279.9050700@student.lu.se> <85lkm7814p.fsf@lola.goethe.zz> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1163984455 10902 80.91.229.2 (20 Nov 2006 01:00:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 20 Nov 2006 01:00:55 +0000 (UTC) Cc: Juanma Barranquero , Nick Roberts , Jason Rumney , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 20 02:00:52 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GlxWj-0002DQ-Fy for ged-emacs-devel@m.gmane.org; Mon, 20 Nov 2006 02:00:49 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GlxWj-00030K-27 for ged-emacs-devel@m.gmane.org; Sun, 19 Nov 2006 20:00:49 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GlxVA-0001NK-E1 for emacs-devel@gnu.org; Sun, 19 Nov 2006 19:59:12 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GlxV6-0001HG-Rh for emacs-devel@gnu.org; Sun, 19 Nov 2006 19:59:11 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GlxV6-0001H4-NF for emacs-devel@gnu.org; Sun, 19 Nov 2006 19:59:08 -0500 Original-Received: from [80.76.149.212] (helo=ch-smtp01.sth.basefarm.net) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GlxV4-0001sY-Ig; Sun, 19 Nov 2006 19:59:07 -0500 Original-Received: from [83.254.145.24] (port=62511 helo=[192.168.123.121]) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.63) (envelope-from ) id 1GlxUz-0005OB-3n; Mon, 20 Nov 2006 01:59:04 +0100 User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) Original-To: David Kastrup In-Reply-To: <85lkm7814p.fsf@lola.goethe.zz> X-Scan-Result: No virus found in message 1GlxUz-0005OB-3n. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1GlxUz-0005OB-3n bf559d91e66085234cddb471330d8564 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:62515 Archived-At: David Kastrup wrote: > In Unix, fork is cheap. The processes share the same code, and the ... > I am aware that Windows does not have fork with similar semantics, > which is why I then made a different proposal: Thanks. I did actually misunderstand you quite a bit before and was going to correct myself before I read this. We are using different language. >> For what reason do you want to avoid the wait for the server process >> to start the way I have implemented it? > > Because it is not reliable. It depends on actions in the started > Emacs that are not under the control of emacsclient, and it requires a > separate mechanism not transparent to the user apart from > --alternate-editor. You are right. >> Doing it that way means that emacsclient always communicates with >> emacs server in the same way and I think that is very important from >> a code complexity point of view. > >>>From code complexity, emacsclient would just pass its options on to > the alternate editor, whether that is called emacsproxy or vi. > >> One drawback I can see is that you can not know for sure if the >> server ever starts. Therefore I have added a simple timeout for how >> long emacsclient waits for emacs server to start. > > I'd prefer the approach where emacsclient does not depend on Emacs > server to start. With a little twist your suggestion would be very similar to mine. The main part of your suggestion as I see it is that emacsclient wait on an intermediate process. This has the advantage that emacs could communicate with it and tell emacsclient about errors. That is good. Something like this would have the benefits of both yours and my suggestion: 1) If emacsclient could not contact emacs server then it create the intermediate process. This then starts emacs and tells emacs to start emacs server with the required arguments. 2) Emacsclient then wait for the intermediate process to disappear. After that it checks for errors. 3) If there are errors then it tries to connect to the server again. This is very similar to my current approach but better I believe. My approach looks like this: 1) If emacsclient can not contact emacs server then it starts emacs and tells emacs to start emacs server with the required arguments. 2) Emacsclient then loops and tries to connect to the server again. If it takes too long then emacsclient assumes there is an error. If it can connect that step is the same as 3 above. I think this would be better. From a user perspective the main differenc is better error handling. However it requires some changes to the emacs executable and I do not believe it should be implemented now. My proposal does not require any changes to emacs executable. And the code is ready for testing now (except for some details I have asked for comments on off the list, I am waiting for answers). However I would like to have it tested here by people on emacs devel list before going further.