From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: option for loading up a gui specific emacs daemon Date: Wed, 14 Dec 2016 17:47:54 +0200 Message-ID: <83shpqa4wl.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1481730607 27680 195.159.176.226 (14 Dec 2016 15:50:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 14 Dec 2016 15:50:07 +0000 (UTC) Cc: emacs-devel@gnu.org To: Filipe Silva Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 14 16:50:02 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 1cHBof-0006G1-Pd for ged-emacs-devel@m.gmane.org; Wed, 14 Dec 2016 16:50:01 +0100 Original-Received: from localhost ([::1]:48475 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cHBoj-0004uM-TX for ged-emacs-devel@m.gmane.org; Wed, 14 Dec 2016 10:50:05 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40035) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cHBnR-0003L6-UU for emacs-devel@gnu.org; Wed, 14 Dec 2016 10:48:50 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cHBnO-0007tI-RA for emacs-devel@gnu.org; Wed, 14 Dec 2016 10:48:46 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:35184) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cHBnO-0007t7-O1; Wed, 14 Dec 2016 10:48:42 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3579 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cHBnO-0006eN-2D; Wed, 14 Dec 2016 10:48:42 -0500 In-reply-to: (message from Filipe Silva on Tue, 13 Dec 2016 21:02:15 -0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:210455 Archived-At: > From: Filipe Silva > Date: Tue, 13 Dec 2016 21:02:15 -0200 > > I'd like to load emacs with emacs --daemon=gui and then connect to it with emacsclient -c --sever-file=gui. > > 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. If you remove the test from those packages, does everything else in the package work correctly without signaling any errors? You see, these tests are supposed to be made before calling APIs that would otherwise signal an error or otherwise barf on non-GUI frames. If removing the tests makes the package work fine in the daemon mode or on a text-mode frame, it means the test is redundant and should simply be removed. Very few Emacs features really require GUI frames, so it could be that these tests, or at least some of them, are remnants from distant past, when many more features would only work in GUI mode. OTOH, if these tests are indeed required, then making them work in the daemon will not provide any relief for you, because it will just delay the error until later. Does the above make sense?