all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Christopher Schmidt <christopher@ch.ristopher.com>
To: emacs-devel@gnu.org
Subject: Re: question about `display-graphic-p' and emacs daemon
Date: Wed, 21 Nov 2012 15:31:24 +0000 (GMT)	[thread overview]
Message-ID: <87mwybdlbn@ch.ristopher.com> (raw)
In-Reply-To: <5117FACB1DD14041804B94DDD6B2DDF3@us.oracle.com> (Drew Adams's message of "Wed, 21 Nov 2012 07:16:16 -0800")

"Drew Adams" <drew.adams@oracle.com> writes:
> 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.

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

        Christopher



  reply	other threads:[~2012-11-21 15:31 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 [this message]
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=87mwybdlbn@ch.ristopher.com \
    --to=christopher@ch.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.