From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Christopher Schmidt Newsgroups: gmane.emacs.devel Subject: Re: question about `display-graphic-p' and emacs daemon Date: Wed, 21 Nov 2012 15:31:24 +0000 (GMT) Message-ID: <87mwybdlbn@ch.ristopher.com> References: <5117FACB1DD14041804B94DDD6B2DDF3@us.oracle.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1353511903 9862 80.91.229.3 (21 Nov 2012 15:31:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 21 Nov 2012 15:31:43 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 21 16:31:54 2012 Return-path: Envelope-to: ged-emacs-devel@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 1TbCHJ-0004dL-Bb for ged-emacs-devel@m.gmane.org; Wed, 21 Nov 2012 16:31:53 +0100 Original-Received: from localhost ([::1]:41096 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbCH8-0008Rb-U8 for ged-emacs-devel@m.gmane.org; Wed, 21 Nov 2012 10:31:42 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:44309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbCH3-0008RK-Mv for emacs-devel@gnu.org; Wed, 21 Nov 2012 10:31:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TbCGt-0008MJ-Qs for emacs-devel@gnu.org; Wed, 21 Nov 2012 10:31:37 -0500 Original-Received: from ristopher.com ([146.185.21.93]:41548 helo=saturn.ch.ristopher.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbCGt-0008Lr-J3 for emacs-devel@gnu.org; Wed, 21 Nov 2012 10:31:27 -0500 Original-Received: by saturn.ch.ristopher.com (Postfix, from userid 0) id A941D213D9; Wed, 21 Nov 2012 15:31:24 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ch.ristopher.com; s=mail; t=1353511884; bh=o0SSS84JI2eQvfcaCGNxej2IsF1M5pd0M434KeuJ0oQ=; h=From:To:Subject:In-Reply-To:Message-ID:References:MIME-Version: Content-Type:Date; b=cpMh3zhocdsL0TiYNN92IXQdylLigmX2xVKW3LkVgqCL076oN25nCPNbJMwHrd2VQ f4zZTz7IT1kx42wsz9bfNiEFrc/PphPV6LWsFLoNnadHQQAw9eNHbvehOuI5iEyFO3 8CyZmlzbiO6DLLl6vx3+ZWGAylVTJ1s5B/isSXW0= In-Reply-To: <5117FACB1DD14041804B94DDD6B2DDF3@us.oracle.com> (Drew Adams's message of "Wed, 21 Nov 2012 07:16:16 -0800") Mail-Followup-To: emacs-devel@gnu.org X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 146.185.21.93 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:155023 Archived-At: "Drew Adams" writes: > 1. I have a defcustom that has this as the initial value: > > (and (fboundp 'image-file-name-regexp) > (if (fboundp 'display-graphic-p) > (display-graphic-p) > window-system) > t) > > With emacs daemon, loading the file with that sexp raises an error, > because it is eval'd before the first frame is displayed. I think this form evals just fine - (display-graphic-p) is always nil, though. > As a workaround, I can remove the `display-graphic-p'/`window-system' > test and do that only at runtime (after a frame has been displayed). > > But shouldn't it be possible for Emacs to determine the display type > without actually displaying a frame? Naive question, but I'm > ignorant. If that is possible, what is the test to do it? A daemonized Emacs can have multiple frames that use either a window system or a terminal - at the same time! That is (display-graphic-p) can eval to either t or nil within the same Emacs process, depending on the selected frame. Christopher