Subject: bug#7587: 23.2; `format-mode-line' makes Emacs crash

From: Chong Yidong <[email-masked]>
Date: Thu, 16 Dec 2010 10:17:51 +0800

Eli Zaretskii <[email-masked]> writes:

> The call to lookup_basic_face comes from init_iterator:
> init_iterator does this because it expects a truly basic face in
> base_face_id, and it wants to use its face-remapped variety, as the
> user would expect.  But in this case, we pass to it an already
> remapped basic face, see this part of format-mode-line:

> lookup_named_face returns the face ID of the remapped mode-line face.
> So in this case, face_id is already an ID of the remapped mode-line
> face, and returning it unaltered from lookup_basic_face is TRT.

format-mode-line should not pass non-basic faces to init_iterator.  I'm
not even sure what the FACE argument to format-mode-line is useful for;
it doesn't seem to be used anywhere in the sources.

I've changed format-mode-line so that if you pass a face argument to
FACES, it should be one of `default', `mode-line', etc.  Any other face
gets treated as `default'.