GNU bug report logs - #19688
[patch] add support for emacs daemon on Windows

Previous Next

Package: emacs;

Reported by: Mark Laws <mdl <at> 60hz.org>

Date: Sun, 25 Jan 2015 19:59:02 UTC

Severity: wishlist

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Mark Laws <mdl <at> 60hz.org>
Subject: bug#19688: closed (Re: bug#19688: [patch] add support for emacs
 daemon on Windows)
Date: Fri, 27 Feb 2015 14:27:03 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#19688: [patch] add support for emacs daemon on Windows

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 19688 <at> debbugs.gnu.org.

-- 
19688: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19688
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Mark Laws <mdl <at> 60hz.org>
Cc: 19688-done <at> debbugs.gnu.org
Subject: Re: bug#19688: [patch] add support for emacs daemon on Windows
Date: Fri, 27 Feb 2015 16:26:24 +0200
> Date: Sun, 22 Feb 2015 04:30:29 +0900
> From: Mark Laws <mdl <at> 60hz.org>
> Cc: 19688 <at> debbugs.gnu.org
> 
> On Sat, Feb 21, 2015 at 10:03 PM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> > Can you provide some simple test I could run after applying, to make
> > sure everything works as intended?
> 
> $ emacsclient -ca ""
> 
> Should launch Emacs if it's not already running, and connect to an
> existing Emacs process if it is. Try doing it a few times in a row to
> make sure both cases work and that the double-free issue doesn't
> happen (I have no reason to believe it would, but just in case).

Thanks.

I pushed the changes, with slight variations to make them less
pervasive where possible, as commit 805fe50 on the master branch.  I
then followed that up with the few necessary changes in the
documentation and in NEWS, as should happen with every user-visible
change.

Thanks again for working on this, and sorry for delays in landing this
on master.

I'm closing the bug.

[Message part 3 (message/rfc822, inline)]
From: Mark Laws <mdl <at> 60hz.org>
To: bug-gnu-emacs <at> gnu.org
Subject: [patch] add support for emacs daemon on Windows
Date: Mon, 26 Jan 2015 04:18:34 +0900
[Message part 4 (text/plain, inline)]
Hi,

I am not on this list so please CC me in any replies.

Attached is a patch which should apply cleanly on top of master
(a3689d3c661fe36df971c875760f8d500b5ae994 as of this email). It allows
Emacs to run as a daemon on Windows. Without daemon mode, emacsclient
-a "" does not work, which makes it impossible to pass elisp to Emacs
via emacsclient unless Emacs is already running. In other words, this
will now work correctly:

emacsclient -a "" -e "(ediff-merge-files-with-ancestor ...)"

Previously, -a "" produced an error message on Windows. There was no
workaround, because:

emacs -a emacs -e "(ediff-merge-files-with-ancestor ...)"

would start a new Emacs with a buffer called
"(ediff-merge-files-with-ancestor ...)".

The functionality is identical to the UNIX implementation with one
difference: I didn't allow for running multiple/named daemons. The
reason I didn't was because the code for that in emacsclient.c took
the daemon name from the socket name if one was provided, and because
filesystem sockets are not supported on Windows, I couldn't think of a
way to provide identical behavior across UNIX and Windows.

This patch has been heavily tested against emacs-24 without any
issues; it seems to work well against master as well.

Thanks to Eli Zaretskii for help with debugging.

Cheers,
Mark Laws

-- 
|v\ /\ |\ |< |_ /\ \^| //
[emacs-windows-daemon.patch (application/octet-stream, attachment)]

This bug report was last modified 10 years and 143 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.