emacs-devel
[Top][All Lists]
Advanced

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

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


From: Christopher Schmidt
Subject: Re: question about `display-graphic-p' and emacs daemon
Date: Wed, 21 Nov 2012 15:31:24 +0000 (GMT)

"Drew Adams" <address@hidden> 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 via email to

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