diff options
| author | Geoff Voelker | 1998-11-04 23:38:19 +0000 |
|---|---|---|
| committer | Geoff Voelker | 1998-11-04 23:38:19 +0000 |
| commit | 396594fed9456408318f0df81e13ba35ca7ab766 (patch) | |
| tree | aeb9c0bb34109e5c75a41768055a6285f4165856 /src | |
| parent | 4664455c17f5a67c3a9638add7dfe2182a339717 (diff) | |
| download | emacs-396594fed9456408318f0df81e13ba35ca7ab766.tar.gz emacs-396594fed9456408318f0df81e13ba35ca7ab766.zip | |
(w32_list_fonts): Report an error if a frame has not
been created yet.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32fns.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/w32fns.c b/src/w32fns.c index d269214b9ae..2765c7bbb03 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -5125,6 +5125,24 @@ w32_list_fonts (FRAME_PTR f, Lisp_Object pattern, int size, int maxnames ) | |||
| 5125 | Lisp_Object patterns, key, tem; | 5125 | Lisp_Object patterns, key, tem; |
| 5126 | Lisp_Object list = Qnil, newlist = Qnil, second_best = Qnil; | 5126 | Lisp_Object list = Qnil, newlist = Qnil, second_best = Qnil; |
| 5127 | 5127 | ||
| 5128 | /* If we don't have a frame, we can't use the Windows API to list | ||
| 5129 | fonts, as it requires a device context for the Window. This will | ||
| 5130 | only happen during startup if the user specifies a font on the | ||
| 5131 | command line. Print a message on stderr and return nil. */ | ||
| 5132 | if (!f) | ||
| 5133 | { | ||
| 5134 | char buffer[256]; | ||
| 5135 | |||
| 5136 | sprintf (buffer, | ||
| 5137 | "Emacs cannot get a list of fonts before the initial frame " | ||
| 5138 | "is created.\nThe font specified on the command line may not " | ||
| 5139 | "be found.\n"); | ||
| 5140 | MessageBox (NULL, buffer, "Emacs Warning Dialog", | ||
| 5141 | MB_OK | MB_ICONEXCLAMATION | MB_TASKMODAL); | ||
| 5142 | return Qnil; | ||
| 5143 | } | ||
| 5144 | |||
| 5145 | |||
| 5128 | patterns = Fassoc (pattern, Valternate_fontname_alist); | 5146 | patterns = Fassoc (pattern, Valternate_fontname_alist); |
| 5129 | if (NILP (patterns)) | 5147 | if (NILP (patterns)) |
| 5130 | patterns = Fcons (pattern, Qnil); | 5148 | patterns = Fcons (pattern, Qnil); |