# HG changeset patch # User Geoff Voelker # Date 910222699 0 # Node ID 54b22e0a1f7b5ab31d2da9d4c3bf12587d8ea767 # Parent 3246160c5469db45bd32669d74203328a4a906e8 (w32_list_fonts): Report an error if a frame has not been created yet. diff -r 3246160c5469 -r 54b22e0a1f7b src/w32fns.c --- a/src/w32fns.c Wed Nov 04 23:23:57 1998 +0000 +++ b/src/w32fns.c Wed Nov 04 23:38:19 1998 +0000 @@ -5125,6 +5125,24 @@ Lisp_Object patterns, key, tem; Lisp_Object list = Qnil, newlist = Qnil, second_best = Qnil; + /* If we don't have a frame, we can't use the Windows API to list + fonts, as it requires a device context for the Window. This will + only happen during startup if the user specifies a font on the + command line. Print a message on stderr and return nil. */ + if (!f) + { + char buffer[256]; + + sprintf (buffer, + "Emacs cannot get a list of fonts before the initial frame " + "is created.\nThe font specified on the command line may not " + "be found.\n"); + MessageBox (NULL, buffer, "Emacs Warning Dialog", + MB_OK | MB_ICONEXCLAMATION | MB_TASKMODAL); + return Qnil; + } + + patterns = Fassoc (pattern, Valternate_fontname_alist); if (NILP (patterns)) patterns = Fcons (pattern, Qnil);