aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1995-03-06 04:32:25 +0000
committerRichard M. Stallman1995-03-06 04:32:25 +0000
commita992f9d90e608bbd92c7db5a797f6d799f56e7c6 (patch)
tree36f4fdd8c51cbdfb9512963c380bf027e46fb524 /src
parent2e52ff59e5c0c7c7f3d376d48ddd33cf98cfe491 (diff)
downloademacs-a992f9d90e608bbd92c7db5a797f6d799f56e7c6.tar.gz
emacs-a992f9d90e608bbd92c7db5a797f6d799f56e7c6.zip
(load_color): Call defined_color to allocate the color.
Diffstat (limited to 'src')
-rw-r--r--src/xfaces.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/xfaces.c b/src/xfaces.c
index 2b235e0c0c3..5fe6d2092c5 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -340,26 +340,17 @@ load_color (f, name)
340 struct frame *f; 340 struct frame *f;
341 Lisp_Object name; 341 Lisp_Object name;
342{ 342{
343 Display *dpy = FRAME_X_DISPLAY (f);
344 Colormap cmap;
345 XColor color; 343 XColor color;
346 int result; 344 int result;
347 345
348 if (NILP (name)) 346 if (NILP (name))
349 return FACE_DEFAULT; 347 return FACE_DEFAULT;
350 348
351 cmap = DefaultColormapOfScreen (DefaultScreenOfDisplay (dpy));
352
353 CHECK_STRING (name, 0); 349 CHECK_STRING (name, 0);
354 BLOCK_INPUT; 350 result = defined_color(f, (char *) XSTRING (name)->data, &color, 1);
355 result = XParseColor (dpy, cmap, (char *) XSTRING (name)->data, &color);
356 UNBLOCK_INPUT;
357 if (! result) 351 if (! result)
358 Fsignal (Qerror, Fcons (build_string ("undefined color"), 352 Fsignal (Qerror, Fcons (build_string ("undefined color"),
359 Fcons (name, Qnil))); 353 Fcons (name, Qnil)));
360 BLOCK_INPUT;
361 result = XAllocColor (dpy, cmap, &color);
362 UNBLOCK_INPUT;
363 /* Ignore the return value of XallocColor, so that 354 /* Ignore the return value of XallocColor, so that
364 we use a color close to the one requested 355 we use a color close to the one requested
365 if we can't get the exact request. */ 356 if we can't get the exact request. */