From mboxrd@z Thu Jan 1 00:00:00 1970
Path: news.gmane.org!not-for-mail
From: Paul Moore
Newsgroups: gmane.emacs.bugs
Subject: bug#23689: Daemon-mode on Windows - "w32-initialized" is set too early
Date: Wed, 15 Jun 2016 16:26:40 +0100
Message-ID:
References:
<8337otw9m0.fsf@gnu.org>
<83shwtusoj.fsf@gnu.org>
<83porxuhfo.fsf@gnu.org>
<83k2hrelwy.fsf@gnu.org>
<83inxbeh1o.fsf@gnu.org>
<83fusfdvuh.fsf@gnu.org>
<8360taec1z.fsf@gnu.org>
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
X-Trace: ger.gmane.org 1466004446 1553 80.91.229.3 (15 Jun 2016 15:27:26 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 15 Jun 2016 15:27:26 +0000 (UTC)
Cc: 23689@debbugs.gnu.org
To: Eli Zaretskii
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 15 17:27:16 2016
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 1bDCip-0004kw-7G
for geb-bug-gnu-emacs@m.gmane.org; Wed, 15 Jun 2016 17:27:15 +0200
Original-Received: from localhost ([::1]:42940 helo=lists.gnu.org)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from )
id 1bDCio-0000PZ-Ak
for geb-bug-gnu-emacs@m.gmane.org; Wed, 15 Jun 2016 11:27:14 -0400
Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43053)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1bDCif-0000OL-Cd
for bug-gnu-emacs@gnu.org; Wed, 15 Jun 2016 11:27:06 -0400
Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1bDCic-0005ng-3k
for bug-gnu-emacs@gnu.org; Wed, 15 Jun 2016 11:27:05 -0400
Original-Received: from debbugs.gnu.org ([208.118.235.43]:58315)
by eggs.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1bDCic-0005nc-0J
for bug-gnu-emacs@gnu.org; Wed, 15 Jun 2016 11:27:02 -0400
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
(envelope-from ) id 1bDCib-0006mc-P3
for bug-gnu-emacs@gnu.org; Wed, 15 Jun 2016 11:27:01 -0400
X-Loop: help-debbugs@gnu.org
Resent-From: Paul Moore
Original-Sender: "Debbugs-submit"
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Wed, 15 Jun 2016 15:27:01 +0000
Resent-Message-ID:
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 23689
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords:
Original-Received: via spool by 23689-submit@debbugs.gnu.org id=B23689.146600440926054
(code B ref 23689); Wed, 15 Jun 2016 15:27:01 +0000
Original-Received: (at 23689) by debbugs.gnu.org; 15 Jun 2016 15:26:49 +0000
Original-Received: from localhost ([127.0.0.1]:42419 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from )
id 1bDCiO-0006m9-Tg
for submit@debbugs.gnu.org; Wed, 15 Jun 2016 11:26:49 -0400
Original-Received: from mail-lb0-f170.google.com ([209.85.217.170]:34817)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from ) id 1bDCiN-0006lw-1j
for 23689@debbugs.gnu.org; Wed, 15 Jun 2016 11:26:47 -0400
Original-Received: by mail-lb0-f170.google.com with SMTP id o4so3680436lbp.2
for <23689@debbugs.gnu.org>; Wed, 15 Jun 2016 08:26:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
h=mime-version:in-reply-to:references:from:date:message-id:subject:to
:cc; bh=qol5yKfoJGDM1EJHqb8QKFCgJVpV2VLhKvK4Ih/KwnM=;
b=cK3nZ6KiWAmZ6FcELNlqFSmXwvBtp8ZaykGo0oevTX4c+KbMi8s4U6eqkpD496ymGI
yF2/NSvvueVYxrTE+kGjdAaaFjDLqHipwwqDdfMwRBP+r3gFS7m+xuNhXrx3etKD60lx
PE8gq5XZBlFfwZOOTeFgI7qDSfDqoa/fO0XYN9gjTtii8FWt3lrtwKBhuQ5qi3F5y4Kl
yB4lYQt+BfIt1rFSgIF8J/KcFcq6BDO0m8e16tDbIe+sy45P5vzNXoGjBAbOhN8MeJCH
Q5kbm4jZemfuk+MxKqEc7CH3c32cQ/kkQ2Edsh0TVq+SKTrxLWGN98CuruePFLX8qxf2
cKlw==
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:from:date
:message-id:subject:to:cc;
bh=qol5yKfoJGDM1EJHqb8QKFCgJVpV2VLhKvK4Ih/KwnM=;
b=d0tTHu1UsNkdrBE51EG+mPHewAlpHjr0C2pPeUv4UuBAjeDH75gjDynaiZMMBmlhOE
xqwPEfjX6yLVQZ4jFFHojI/CeScgzP1sUHA87Ok3B4f3ClLg0NnwcbWsjS0N2LvjkB5H
CzIXS8HURp8jndtXumYzZ8EDjQfs527au7Q0gP38eUtGdetkNvMcWCvnTtwG0ptXQFzn
/lEmeWHhSFejmNgQ7lUtUAWwntCK3kvH1QMz7uTdPlvoPxxtJ1fL7IddYdc3w4LNs6gH
T5kFS3SgSJYUN51hydae7zH2AweUl3uPG/F2JxTyzNTuzbfSehCOlQRlwXab5ZpyahwX
dZvA==
X-Gm-Message-State: ALyK8tKg/9oY5u5KFMvDS4nheqTyKLVcpLPas929rntd8F0Z+0JWl43jt83d1U/Y6fZ/M7l9aFKKrFJRgIi2ow==
X-Received: by 10.28.158.17 with SMTP id h17mr12981269wme.1.1466004400932;
Wed, 15 Jun 2016 08:26:40 -0700 (PDT)
Original-Received: by 10.194.93.35 with HTTP; Wed, 15 Jun 2016 08:26:40 -0700 (PDT)
In-Reply-To: <8360taec1z.fsf@gnu.org>
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 208.118.235.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"
Xref: news.gmane.org gmane.emacs.bugs:119585
Archived-At:
On 15 June 2016 at 15:55, Eli Zaretskii wrote:
> Hmm... which could mean it might be easier for you to just modify the
> standard fontset, by adding your fonts as covering the full range of
> the characters each one supports.
No disrespect intended here, but this all sounds pretty complex (and
there's almost no examples I've been able to find on the web of people
doing this in practice). All that's really going on here is that
instead of wanting to customize the default font (something you can do
with one line of code, or via the customize interface) I want to say
"pick whichever one of these 3 fonts actually exists on the system".
There are a number of approaches for this on the web, of various
levels of complexity. But they have issues when used with Windows
daemon mode, which as I reported seems to be due to something peculiar
in how Windows daemon mode works meaning that sometimes find-font
fails if called "at the wrong time" - and the hooks people currently
use seem to trigger that.
Spacemacs at the moment has some code that hooks
server-create-window-system-frame to do initialisation "that needs to
have the display system initialized". That code is fragile, and again
doesn't seem to work on Windows daemon mode. It's used for various
things, only one of which is font selection. In an attempt to get font
selection working, I'm looking at options here - I'm OK with taking
the existing font selection code and moving it to a different hook.
However, finding such a hook is proving hard.
An alternative approach, such as fontsets, to setting the font is
possible, but risks breaking other things in spacemacs that I don't
currently understand (there's code that sets alternate fonts on
fontset-default against certain Unicode characters for a custom
modeline package, for example). So while I'm OK with experimenting
here, and if I understand the resulting process, modifying the
spacemacs code to use it, it would be very easy for me to make things
worse rather than better. Also, in the spacemacs code, choosing from a
list of fonts is covered, albeit via custom code - so if I could find
"the right hook", I wouldn't need to worry about any of this.
My problems with where we've got to with the fontset approach are:
1. I've yet to get it working (pretty basic :-))
2. If I have to define a fontset using the name of a font that's on
the system, how do I obtain such a font name in a cross-platform way?
Can Emacs tell me what would be suitable? Am I allowed to reuse the
font name that was used for the default fontset?
3. I don't want to modify the default fontset, at least in the first
instance, as doing so could break the spacemacs code. Once I have
something working with a custom fontset, then maybe I would be able to
work out how to merge the two bits of code.
At the moment, I'm running the spacemacs font code the first time
after-make-frame-functions runs, and calling select-frame to select
the created frame before I run the spacemacs code. It seems to work,
but I'm unclear why I need to call select-frame, and whether there
might be hidden issues remaining. Also, because I can't set the font
until *after* the frame is created, there's a flicker with the initial
frame opening with the "wrong" font and then resetting.
So - to summarise. There seems to be a lot of complexity here, in
achieving what feels like it ought to be a pretty straightforward
requirement. Your fontset suggestion seemed simple, but on digging
into it it turned out to be more complex that I'd hoped in practice.
If I could get it working it might make sense to rip out the current
spacemacs approach in favour of it, but at the moment it seems like
I'd lose more than I gained. On the other hand, there's clearly some
issues around the idea of a hook that runs "once the display system is
ready" - spacemacs' current hack has problems, and so does any
alternative approach I've tried. But if there genuinely isn't a good
hook we can use (and no likelihood of one being added) then I guess I
have to live with that.
I do appreciate all of the help you've given - and I completely
respect the fact that you don't want to get sucked into what's
essentially a spacemacs issue. But if you have any further suggestions
on how something like this *should* be handled, I'd appreciate them.
Paul