From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#19688: [patch] add support for emacs daemon on Windows Date: Sat, 14 Feb 2015 15:28:34 +0200 Message-ID: <83wq3kwrjx.fsf@gnu.org> References: <83h9ver459.fsf@gnu.org> <83d262qdx6.fsf@gnu.org> <54C62B6C.3050608@dancol.org> <834mr8n5or.fsf@gnu.org> <83pp9e42n8.fsf@gnu.org> <8361b4y9qj.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1423920566 26758 80.91.229.3 (14 Feb 2015 13:29:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 14 Feb 2015 13:29:26 +0000 (UTC) Cc: 19688@debbugs.gnu.org To: Mark Laws Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Feb 14 14:29:14 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YMcmY-00075u-2M for geb-bug-gnu-emacs@m.gmane.org; Sat, 14 Feb 2015 14:29:14 +0100 Original-Received: from localhost ([::1]:59838 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMcmX-0002iI-9U for geb-bug-gnu-emacs@m.gmane.org; Sat, 14 Feb 2015 08:29:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36080) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMcmQ-0002hG-Q3 for bug-gnu-emacs@gnu.org; Sat, 14 Feb 2015 08:29:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YMcmM-000785-6O for bug-gnu-emacs@gnu.org; Sat, 14 Feb 2015 08:29:06 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51570) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMcmM-000781-2p for bug-gnu-emacs@gnu.org; Sat, 14 Feb 2015 08:29:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YMcmL-0007LO-Lp for bug-gnu-emacs@gnu.org; Sat, 14 Feb 2015 08:29:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Feb 2015 13:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19688 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 19688-submit@debbugs.gnu.org id=B19688.142392052328203 (code B ref 19688); Sat, 14 Feb 2015 13:29:01 +0000 Original-Received: (at 19688) by debbugs.gnu.org; 14 Feb 2015 13:28:43 +0000 Original-Received: from localhost ([127.0.0.1]:42810 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YMcm2-0007Ko-Lv for submit@debbugs.gnu.org; Sat, 14 Feb 2015 08:28:42 -0500 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:32881) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YMcm0-0007KW-Nz for 19688@debbugs.gnu.org; Sat, 14 Feb 2015 08:28:41 -0500 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0NJR00900JT3HY00@a-mtaout21.012.net.il> for 19688@debbugs.gnu.org; Sat, 14 Feb 2015 15:28:34 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NJR0092BK3LGC30@a-mtaout21.012.net.il>; Sat, 14 Feb 2015 15:28:34 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:99381 Archived-At: > Date: Sat, 14 Feb 2015 22:16:46 +0900 > From: Mark Laws > Cc: 19688@debbugs.gnu.org > > On Unix, emacsclient forks and execs (#1) emacs --daemon, which in > turn execs (#2) itself. emacsclient waits on #1, which is told when to > quit via the pipe between #1 and #2, and when it quits, we know that > the daemon must be ready. > > > My understanding is that your Windows variant of the above is to wait > > on an event that is signaled by Emacs when it starts in daemon mode. > > My question is: can we use something similar to Unix here, like > > 'WaitForInputIdle'? After all, the above call to 'waitpid' just tells > > us the daemon process is past its initialization stage, as far as the > > OS is concerned, which isn't too fine-grained. Perhaps even > > repeatedly calling 'GetExitCodeProcess' until it returns STILL_ACTIVE > > for the first time would be a faithful enough emulation of what > > 'waitpid' does here? > > On Windows, the Emacs process created by emacsclient initializes > daemon mode itself, so neither of those would give us a way of knowing > that the daemon has actually been initialized. That's why we have to > use an event on Windows. I don't see why 'WaitForInputIdle' wouldn't work. Can you explain? AFAIU, it waits until the process is idle, which means it did all the initialization and is ready for accepting connections. Am I missing something? > > P.S. What's up with your copyright assignment? I still don't see it > > on file. > > Sorry, I sent it to copyright-clerk@fsf.org (since that's where it > came from) instead of assign@gnu.org. I sent it to the latter just > now. Thanks.