[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

question about `display-graphic-p' and emacs daemon

From: Drew Adams
Subject: question about `display-graphic-p' and emacs daemon
Date: Wed, 21 Nov 2012 07:16:16 -0800

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)

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

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

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).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]