[Top][All Lists]

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

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

From: Drew Adams
Subject: RE: question about `display-graphic-p' and emacs daemon
Date: Wed, 21 Nov 2012 08:27:53 -0800

> > 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 via email to

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