From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark Laws Newsgroups: gmane.emacs.bugs Subject: bug#19688: [patch] add support for emacs daemon on Windows Date: Sun, 15 Feb 2015 01:34:48 +0900 Message-ID: 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> <83wq3kwrjx.fsf@gnu.org> <83r3tswm6d.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1423931727 5505 80.91.229.3 (14 Feb 2015 16:35:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 14 Feb 2015 16:35:27 +0000 (UTC) Cc: 19688@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Feb 14 17:35:13 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 1YMfgW-0002hy-4F for geb-bug-gnu-emacs@m.gmane.org; Sat, 14 Feb 2015 17:35:12 +0100 Original-Received: from localhost ([::1]:60307 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMfgV-0006oX-M7 for geb-bug-gnu-emacs@m.gmane.org; Sat, 14 Feb 2015 11:35:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57951) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMfgR-0006lT-UT for bug-gnu-emacs@gnu.org; Sat, 14 Feb 2015 11:35:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YMfgM-0003WE-Tv for bug-gnu-emacs@gnu.org; Sat, 14 Feb 2015 11:35:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52741) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMfgM-0003W2-Ql for bug-gnu-emacs@gnu.org; Sat, 14 Feb 2015 11:35:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YMfgM-0003MT-CT for bug-gnu-emacs@gnu.org; Sat, 14 Feb 2015 11:35:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mark Laws Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Feb 2015 16:35:02 +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.142393169812907 (code B ref 19688); Sat, 14 Feb 2015 16:35:02 +0000 Original-Received: (at 19688) by debbugs.gnu.org; 14 Feb 2015 16:34:58 +0000 Original-Received: from localhost ([127.0.0.1]:43981 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YMfgG-0003M6-Tu for submit@debbugs.gnu.org; Sat, 14 Feb 2015 11:34:57 -0500 Original-Received: from mail-ig0-f170.google.com ([209.85.213.170]:37560) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YMfgE-0003Lr-6H for 19688@debbugs.gnu.org; Sat, 14 Feb 2015 11:34:54 -0500 Original-Received: by mail-ig0-f170.google.com with SMTP id l13so22330074iga.1 for <19688@debbugs.gnu.org>; Sat, 14 Feb 2015 08:34:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Px7DEuZZ/3lcKNLsyK4nlJvAtLWibKTDF2lvLjRkBpw=; b=d3PEK93hyq+3Fij0tywSd+cuJsHuyvLp3bkwaj6INuuJjd0C8z/Ak8R2hPCjSxE7Zq IZ1vkal1OrR6O0UQjPO6WKmgrl5LS9tye2C/QO/sXSeOoNwghwu7dXEJHZG95/3HuwSL FgAldHirxlSiivldjTzC3t/kJgZh47e8o1o1hcIzC9Flp0whcxiFAxMLV8K5Iwg81t5J wGO6c1NGdTSrDlTyBtWTSovnvQ45LD8uGofydtE9RA5abX9RVXuzvAm+4iO60UZa0/MD ZNHF48G1Y1GXQqG8x+/MSM0v7wAyCqc8dcMYnu9DAmojXSa0VLL1xk+eoyWyCX1ppFYn qelQ== X-Gm-Message-State: ALoCoQmyMtW3HWmfZlQTZr4QrNesrWq3fzqD49yxM+DeetwYqKWn2c1ALTPY7fH4U4XvQ8eXF4vs X-Received: by 10.50.61.201 with SMTP id s9mr19198598igr.0.1423931688361; Sat, 14 Feb 2015 08:34:48 -0800 (PST) Original-Received: by 10.36.65.195 with HTTP; Sat, 14 Feb 2015 08:34:48 -0800 (PST) X-Originating-IP: [219.102.234.58] In-Reply-To: <83r3tswm6d.fsf@gnu.org> 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:99394 Archived-At: On Sun, Feb 15, 2015 at 12:24 AM, Eli Zaretskii wrote: > However, after looking at the Emacs initialization code, I think those > problems will not affect Emacs, because we only start the thread that > reads Windows messages inside the call to Frecursive_edit, and by that > time the daemon initialization is already done. > > OTOH, there's one other caveat in the documentation of > 'WaitForInputIdle': it returns immediately "if the process is a > console application or does not have a message queue". Emacs is built > as a console application, and I'm not sure at which point it begins to > "have a message queue", as far as this function is concerned. > >> I can try it if you want, but it seems fragile compared to the event thing. > > Please do try it, I think it will either work reliably or not at all. > > The reason I'd prefer to use it if it works is because doing so > side-steps the entire issue of how to pass the event ID, which, > together with the code which handles the event, adds non-trivial > amount of code to your patch. It would be nice to avoid that, if > possible. I gave it a try, but it doesn't work--most likely because, as you said, Emacs is built as a console application, so WaitForInputIdle simply returns immediately because of the race between emacsclient attempting to wait on Emacs and Emacs establishing a Windows message queue. So, the options are either using an event or modifying Emacs to run under the Windows subsystem--I don't think I need to tell you which one is the less invasive change. :) -- |v\ /\ |\ |< |_ /\ \^| //