From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: question about `display-graphic-p' and emacs daemon Date: Wed, 21 Nov 2012 08:27:53 -0800 Message-ID: <5DC724554D3F4B708596672804E9B26E@us.oracle.com> References: <5117FACB1DD14041804B94DDD6B2DDF3@us.oracle.com> <87mwybdlbn@ch.ristopher.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1353515319 10751 80.91.229.3 (21 Nov 2012 16:28:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 21 Nov 2012 16:28:39 +0000 (UTC) To: "'Christopher Schmidt'" , Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 21 17:28:49 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 1TbDAO-0003J2-IS for ged-emacs-devel@m.gmane.org; Wed, 21 Nov 2012 17:28:48 +0100 Original-Received: from localhost ([::1]:44868 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbDAB-0005VK-JN for ged-emacs-devel@m.gmane.org; Wed, 21 Nov 2012 11:28:35 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:51842) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbDA1-0005V9-Vj for emacs-devel@gnu.org; Wed, 21 Nov 2012 11:28:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TbD9q-0001CS-BG for emacs-devel@gnu.org; Wed, 21 Nov 2012 11:28:21 -0500 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:40813) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbD9q-00018O-5O for emacs-devel@gnu.org; Wed, 21 Nov 2012 11:28:14 -0500 Original-Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id qALGRslq031657 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 21 Nov 2012 16:27:55 GMT Original-Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id qALGRs7N029182 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 21 Nov 2012 16:27:54 GMT Original-Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id qALGRsWV029088; Wed, 21 Nov 2012 10:27:54 -0600 Original-Received: from dradamslap1 (/130.35.178.8) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 21 Nov 2012 08:27:53 -0800 X-Mailer: Microsoft Office Outlook 11 Thread-Index: Ac3H/VA22wgFk790RH6k18AwQTJMnwAB5FFw X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 In-Reply-To: <87mwybdlbn@ch.ristopher.com> X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 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:155026 Archived-At: > > 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. Ah, then I misunderstood the problem, which Christopher reported originally. I thought an error was raised. > > 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. Got it. So I will use both the original defcustom sexp and a runtime, frame-specific check. Thx. (My questions about the doc of "display" remain, however.)