all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Christopher Schmidt'" <christopher@ristopher.com>,
	<emacs-devel@gnu.org>
Subject: RE: question about `display-graphic-p' and emacs daemon
Date: Wed, 21 Nov 2012 08:27:53 -0800	[thread overview]
Message-ID: <5DC724554D3F4B708596672804E9B26E@us.oracle.com> (raw)
In-Reply-To: <87mwybdlbn@ch.ristopher.com>

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




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

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-21 15:16 question about `display-graphic-p' and emacs daemon Drew Adams
2012-11-21 15:31 ` Christopher Schmidt
2012-11-21 16:27   ` Drew Adams [this message]
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=5DC724554D3F4B708596672804E9B26E@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=christopher@ristopher.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.