From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Ken Raeburn Newsgroups: gmane.emacs.devel Subject: Re: option for loading up a gui specific emacs daemon Date: Thu, 15 Dec 2016 08:10:09 -0500 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_312BE1B6-7C86-4FCB-B741-980935D6AD58" X-Trace: blaine.gmane.org 1481807487 19900 195.159.176.226 (15 Dec 2016 13:11:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 15 Dec 2016 13:11:27 +0000 (UTC) Cc: emacs-devel@gnu.org To: Filipe Silva Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 15 14:11:24 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cHVoh-0004JQ-EO for ged-emacs-devel@m.gmane.org; Thu, 15 Dec 2016 14:11:23 +0100 Original-Received: from localhost ([::1]:54501 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cHVok-0006FM-3R for ged-emacs-devel@m.gmane.org; Thu, 15 Dec 2016 08:11:26 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60753) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cHVoY-00060m-T6 for emacs-devel@gnu.org; Thu, 15 Dec 2016 08:11:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cHVoV-00035K-MQ for emacs-devel@gnu.org; Thu, 15 Dec 2016 08:11:14 -0500 Original-Received: from mail-qk0-f172.google.com ([209.85.220.172]:33792) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cHVoV-000351-Fo for emacs-devel@gnu.org; Thu, 15 Dec 2016 08:11:11 -0500 Original-Received: by mail-qk0-f172.google.com with SMTP id q130so55460780qke.1 for ; Thu, 15 Dec 2016 05:11:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raeburn-org.20150623.gappssmtp.com; s=20150623; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=0viB9VCCdECuNul2EW4thxmVVLXLtCHUo2TDXEivoBI=; b=cgZ2z4JdZeLY7d8IeEYHiYjRtbzgdqzE+rvBgohNsxt0Ltc3K63rDYS7pr5MaPF6uc vKBLLCocwfG1asGrett3MECHTn6nFSZU5TOMp+6clRQjf/CZgyNCLIsEWTLK+7L1qk8u yi1ybbPKJrn1XziVk9jGz/hf42xo7EOtkjBZi+oSoEB8gi4EEXVol7Ve5/JiXd5+5Dhs Y8Cs5A9xwy5g91whYj9V4zoxTesCJDXWOfWA7bnKP0qvjHahESuYmo3kBQSoViJi98LL /VdzfY3S2YhvJ3BxQ1qAQioExAFt6Ei+KdQAZJbtD+PNqRpFGaRjAmgGIbx0xJU2oRBf JfHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=0viB9VCCdECuNul2EW4thxmVVLXLtCHUo2TDXEivoBI=; b=q3t2p7HbphNh2qCoJ8bJlSFlFIwOrDRcr0ugZ6oLdNsgYHT00zeea2/LXUAp1fwZcU VDWem5+MPlVjb+EpE07GK6peQqgNb9O1PrttL3mjVEQeWMTzjhBcWUPH2L1ksCbwDAhZ QDiB0uDgl9uC/wvULl6NrD4KOGi5K5F1RwuTga9L1Ef5o8r7k1AqTPMLj6B8E7Nma24c m8XURTBqOQzpS8PZBe0f/BdES4zqAFWTUMiaec1pu6YR/8iI0UWWl/P4w+AgnGybbU5C Hv5yl3OsOhxU0vBsqRHFehtwqk+qBccN3Gr9goP3XbvlKcUuDBn7PBcIRjLkZ5Ipervl c++g== X-Gm-Message-State: AIkVDXJui+gYt2TS6dNlbERlc7z9CAs+xPNXDZ6inEp7xp4mEltMJNJ8VJDvm4tEPU2DAg== X-Received: by 10.55.42.130 with SMTP id q2mr1148263qkq.164.1481807410789; Thu, 15 Dec 2016 05:10:10 -0800 (PST) Original-Received: from [192.168.23.52] (c-50-138-183-136.hsd1.ma.comcast.net. [50.138.183.136]) by smtp.gmail.com with ESMTPSA id l2sm948191qkc.36.2016.12.15.05.10.09 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Dec 2016 05:10:10 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.3124) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.220.172 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:210479 Archived-At: --Apple-Mail=_312BE1B6-7C86-4FCB-B741-980935D6AD58 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 On Dec 13, 2016, at 18:02, Filipe Silva wrote: > Dear developers of the mighty emacs editor,=20 >=20 > I'd like to load emacs with emacs --daemon=3Dgui and then connect to = it with emacsclient -c --sever-file=3Dgui. >=20 > This works almost right. The problem is that various popular packages = make extensive use of the (display-graphic-p) function/predicate to = query frame capabilities. For example, a theme package may query = (display-graphic-p) and assign gui or tty colors accordingly.=20 >=20 > the thing is that(display-graphic-p) always returns nil in a emacs = --deamon type of loading, because emacs does not know if you are using = emacsclient with a gui or a tty. Daemon mode isn=E2=80=99t the only time a graphical display can be added = when one wasn=E2=80=99t initially in use. A tty-mode Emacs can still = run M-x make-frame-on-display or run a server. If a package is assuming that the characteristics of the current frame = (like the result of display-graphic-p) when the package is loaded will = apply to every frame ever in that Emacs session, the package has a = bug=E2=80=A6. Ken= --Apple-Mail=_312BE1B6-7C86-4FCB-B741-980935D6AD58 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
On Dec = 13, 2016, at 18:02, Filipe Silva <filipe.silva@gmail.com> wrote:

Dear = developers of the mighty emacs editor, 

I'd like to load emacs with emacs --daemon=3Dgui and = then connect to it with emacsclient -c --sever-file=3Dgui.

This works almost right. The problem is that various = popular packages make extensive use of the (display-graphic-p) = function/predicate to query frame capabilities. For example, a theme = package may query (display-graphic-p) and assign gui or tty colors = accordingly. 

the = thing is that(display-graphic-p) always returns nil in a emacs --deamon = type of loading, because emacs does not know if you are using = emacsclient with a gui or a tty.

Daemon mode isn=E2=80=99t the only time a = graphical display can be added when one wasn=E2=80=99t initially in use. =  A tty-mode Emacs can still run M-x make-frame-on-display or run a = server.

If a package is assuming = that the characteristics of the current frame (like the result of = display-graphic-p) when the package is loaded will apply to every frame = ever in that Emacs session, the package has a bug=E2=80=A6.

Ken
= --Apple-Mail=_312BE1B6-7C86-4FCB-B741-980935D6AD58--