Subject: bug#19688: closed (Re: bug#19688: [patch] add support for emacs daemon on Windows)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 27 Feb 2015 14:27:03 +0000

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 [email-masked].

-- 
19688: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19688
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#19688: [patch] add support for emacs daemon on Windows
From: Eli Zaretskii <[email-masked]>
To: Mark Laws <[email-masked]>
Cc: [email-masked]
Date: Fri, 27 Feb 2015 16:26:24 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> Date: Sun, 22 Feb 2015 04:30:29 +0900
> From: Mark Laws <[email-masked]>
> Cc: [email-masked]
> 
> On Sat, Feb 21, 2015 at 10:03 PM, Eli Zaretskii <[email-masked]> 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.

Subject: [patch] add support for emacs daemon on Windows
From: Mark Laws <[email-masked]>
To: [email-masked]
Date: Mon, 26 Jan 2015 04:18:34 +0900
List-Id: <debbugs-submit.debbugs.gnu.org>

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\ /\ |\ |< |_ /\ \^| //