all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: <emacs-devel@gnu.org>
Subject: question about `display-graphic-p' and emacs daemon
Date: Wed, 21 Nov 2012 07:16:16 -0800	[thread overview]
Message-ID: <5117FACB1DD14041804B94DDD6B2DDF3@us.oracle.com> (raw)

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




             reply	other threads:[~2012-11-21 15:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-21 15:16 Drew Adams [this message]
2012-11-21 15:31 ` question about `display-graphic-p' and emacs daemon Christopher Schmidt
2012-11-21 16:27   ` Drew Adams
2012-11-21 18:05 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5117FACB1DD14041804B94DDD6B2DDF3@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.