Subject: Re: bug#18573: 24.3.93; set-face-attribute crashes Emacs when started with -nw

From: Eli Zaretskii <[email-masked]>
Date: Wed, 01 Oct 2014 20:49:28 +0300

> From: Jan Djärv <[email-masked]>
> Date: Wed, 1 Oct 2014 19:43:11 +0200
> Cc: [email-masked],
>  [email-masked]
> 
> > But if this doesn't work, then what are our alternatives?  We could
> > loop over all the frames looking for a GUI frame, and use that.  But
> > what if there's no such frame?  Signal an error?
> 
> There is a fundamental error here.  Emacs allows specifying face attributes for future GUI frames when only non-GUI frames exists.  But those attributes requires GUI frames to be realized.
> We are missing a "lazy" realization that only saves the text version of the attribute and realizes only when an apropriate frame is available.
> 
> For now I comitted the "wont crash" solution (don't execute the code for tty frames) in the emacs 24 branch.  No error is signalled and no looping is done to find a GUI frame.  I'm not sure if we should do that.

If the frame argument is t, we could try looking for a GUI frame; that
way, we would signal an error in fewer cases.  After all, using the
selected frame is arbitrary.

At the very least, I think we should have a FIXME comment there
describing the problem.

Thanks.