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: question about `display-graphic-p' and emacs daemon Date: Wed, 21 Nov 2012 07:16:16 -0800 Message-ID: <5117FACB1DD14041804B94DDD6B2DDF3@us.oracle.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 1353511007 1082 80.91.229.3 (21 Nov 2012 15:16:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 21 Nov 2012 15:16:47 +0000 (UTC) To: Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 21 16:16:58 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 1TbC2s-0001fp-GP for ged-emacs-devel@m.gmane.org; Wed, 21 Nov 2012 16:16:58 +0100 Original-Received: from localhost ([::1]:56758 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbC2i-0000Ve-1d for ged-emacs-devel@m.gmane.org; Wed, 21 Nov 2012 10:16:48 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:57704) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbC2T-0008PU-Gc for emacs-devel@gnu.org; Wed, 21 Nov 2012 10:16:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TbC2N-0003fl-JZ for emacs-devel@gnu.org; Wed, 21 Nov 2012 10:16:33 -0500 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:51655) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbC2N-0003fe-DT for emacs-devel@gnu.org; Wed, 21 Nov 2012 10:16:27 -0500 Original-Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id qALFGPrm011553 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 21 Nov 2012 15:16:26 GMT Original-Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id qALFGO8J029538 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 21 Nov 2012 15:16:25 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 qALFGOQs002907 for ; Wed, 21 Nov 2012 09:16:24 -0600 Original-Received: from dradamslap1 (/71.202.147.44) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 21 Nov 2012 07:16:24 -0800 X-Mailer: Microsoft Office Outlook 11 Thread-Index: Ac3H+yb1zi5QrDbaQNuqwEaAYNH7AA== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: ucsinet21.oracle.com [156.151.31.93] 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:155022 Archived-At: My main question here is #1. #2 is about the doc I looked up while trying to find an answer to #1. 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. 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? If it is not possible, and things like `display-graphic-p' should not be invoked before displaying a frame, including from Emacs daemon, shouldn't that be documented (in particular in connection with the daemon)? Is it normal that one needs to change source code this way to take into account the possibility of using Emacs daemon? I hope I'm just missing something simple. 2. While looking for the answer, I checked the doc for `display-graphic-p'. It says that argument DISPLAY can be a display name, as an alternative to being a frame name or nil. But it says nothing about what a "display name" means wrt Emacs Lisp. What form does it take? Is it a Unix/Linux X-Window display name? What about on MS Windows? The entire node (elisp) `Display Feature Testing' talks about "display" without saying what it means for Emacs Lisp or giving any example of a DISPLAY arg (other than a frame or nil). That node is a subsection of the section `Frames', which describes "display" in general terms, without giving any example of a DISPLAY value (other than a frame). The closest I found to describing DISPLAY is in `Multiple Terminals'. It describes X-Window displays as having names of the form HOST:SERVER.SCREEN. What about non X-Window displays? And there is mention in that node of init option `--display' and env var `DISPLAY', which refer readers (eventually) to node `Display X', which describes more of the same. What about non X-Window displays? If I eval (x-display-list) on MS Windows I see ("w32"), but I don't see that form of DISPLAY described anywhere. And I see that (framep (selected-frame)) returns `w32' (a symbol this time).