Mercurial > emacs
comparison src/msdos.c @ 32335:442188fbf8b5
(IT_set_frame_parameters): Don't initialize Lisp_Object
variables. If ALIST includes foreground-color or
background-color, change also the colors of the default face for
this frame.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Mon, 09 Oct 2000 16:03:39 +0000 |
parents | 4ff70fe0d99b |
children | a9dbff7d4142 |
comparison
equal
deleted
inserted
replaced
32334:73a2ad31ee2b | 32335:442188fbf8b5 |
---|---|
2329 | 2329 |
2330 j = i; | 2330 j = i; |
2331 | 2331 |
2332 for (i = 0; i < j; i++) | 2332 for (i = 0; i < j; i++) |
2333 { | 2333 { |
2334 Lisp_Object prop = parms[i]; | 2334 Lisp_Object prop, val; |
2335 Lisp_Object val = values[i]; | 2335 |
2336 prop = parms[i]; | |
2337 val = values[i]; | |
2336 | 2338 |
2337 if (EQ (prop, Qreverse)) | 2339 if (EQ (prop, Qreverse)) |
2338 reverse = EQ (val, Qt); | 2340 reverse = EQ (val, Qt); |
2339 } | 2341 } |
2340 | 2342 |
2342 fprintf (termscript, "<INVERSE-VIDEO>\n"); | 2344 fprintf (termscript, "<INVERSE-VIDEO>\n"); |
2343 | 2345 |
2344 /* Now process the alist elements in reverse of specified order. */ | 2346 /* Now process the alist elements in reverse of specified order. */ |
2345 for (i--; i >= 0; i--) | 2347 for (i--; i >= 0; i--) |
2346 { | 2348 { |
2347 Lisp_Object prop = parms[i]; | 2349 extern Lisp_Object Qdefault, QCforeground, QCbackground; |
2348 Lisp_Object val = values[i]; | 2350 Lisp_Object prop, val; |
2351 Lisp_Object frame; | |
2352 | |
2353 prop = parms[i]; | |
2354 val = values[i]; | |
2349 | 2355 |
2350 if (EQ (prop, Qforeground_color)) | 2356 if (EQ (prop, Qforeground_color)) |
2351 { | 2357 { |
2352 unsigned long new_color = load_color (f, NULL, val, reverse | 2358 unsigned long new_color = load_color (f, NULL, val, reverse |
2353 ? LFACE_BACKGROUND_INDEX | 2359 ? LFACE_BACKGROUND_INDEX |
2354 : LFACE_FOREGROUND_INDEX); | 2360 : LFACE_FOREGROUND_INDEX); |
2355 if (new_color != FACE_TTY_DEFAULT_COLOR | 2361 if (new_color != FACE_TTY_DEFAULT_COLOR |
2356 && new_color != FACE_TTY_DEFAULT_FG_COLOR | 2362 && new_color != FACE_TTY_DEFAULT_FG_COLOR |
2357 && new_color != FACE_TTY_DEFAULT_BG_COLOR) | 2363 && new_color != FACE_TTY_DEFAULT_BG_COLOR) |
2358 { | 2364 { |
2365 /* Make sure the foreground of the default face for this | |
2366 frame is changed as well. */ | |
2367 XSETFRAME (frame, f); | |
2359 if (reverse) | 2368 if (reverse) |
2360 /* FIXME: should the fore-/background of the default | 2369 { |
2361 face change here as well? */ | 2370 FRAME_BACKGROUND_PIXEL (f) = new_color; |
2362 FRAME_BACKGROUND_PIXEL (f) = new_color; | 2371 Finternal_set_lisp_face_attribute (Qdefault, QCbackground, |
2372 val, frame); | |
2373 } | |
2363 else | 2374 else |
2364 FRAME_FOREGROUND_PIXEL (f) = new_color; | 2375 { |
2376 FRAME_FOREGROUND_PIXEL (f) = new_color; | |
2377 Finternal_set_lisp_face_attribute (Qdefault, QCforeground, | |
2378 val, frame); | |
2379 } | |
2365 redraw = 1; | 2380 redraw = 1; |
2366 fg_set = 1; | 2381 fg_set = 1; |
2367 if (termscript) | 2382 if (termscript) |
2368 fprintf (termscript, "<FGCOLOR %lu>\n", new_color); | 2383 fprintf (termscript, "<FGCOLOR %lu>\n", new_color); |
2369 } | 2384 } |
2375 : LFACE_BACKGROUND_INDEX); | 2390 : LFACE_BACKGROUND_INDEX); |
2376 if (new_color != FACE_TTY_DEFAULT_COLOR | 2391 if (new_color != FACE_TTY_DEFAULT_COLOR |
2377 && new_color != FACE_TTY_DEFAULT_FG_COLOR | 2392 && new_color != FACE_TTY_DEFAULT_FG_COLOR |
2378 && new_color != FACE_TTY_DEFAULT_BG_COLOR) | 2393 && new_color != FACE_TTY_DEFAULT_BG_COLOR) |
2379 { | 2394 { |
2395 /* Make sure the background of the default face for this | |
2396 frame is changed as well. */ | |
2397 XSETFRAME (frame, f); | |
2380 if (reverse) | 2398 if (reverse) |
2381 FRAME_FOREGROUND_PIXEL (f) = new_color; | 2399 { |
2400 FRAME_FOREGROUND_PIXEL (f) = new_color; | |
2401 Finternal_set_lisp_face_attribute (Qdefault, QCforeground, | |
2402 val, frame); | |
2403 } | |
2382 else | 2404 else |
2383 FRAME_BACKGROUND_PIXEL (f) = new_color; | 2405 { |
2406 FRAME_BACKGROUND_PIXEL (f) = new_color; | |
2407 Finternal_set_lisp_face_attribute (Qdefault, QCbackground, | |
2408 val, frame); | |
2409 } | |
2384 redraw = 1; | 2410 redraw = 1; |
2385 bg_set = 1; | 2411 bg_set = 1; |
2386 if (termscript) | 2412 if (termscript) |
2387 fprintf (termscript, "<BGCOLOR %lu>\n", new_color); | 2413 fprintf (termscript, "<BGCOLOR %lu>\n", new_color); |
2388 } | 2414 } |
2406 | 2432 |
2407 /* If they specified "reverse", but not the colors, we need to swap | 2433 /* If they specified "reverse", but not the colors, we need to swap |
2408 the current frame colors. */ | 2434 the current frame colors. */ |
2409 if (reverse && !was_reverse) | 2435 if (reverse && !was_reverse) |
2410 { | 2436 { |
2437 Lisp_Object frame; | |
2438 | |
2411 if (!fg_set) | 2439 if (!fg_set) |
2412 { | 2440 { |
2413 FRAME_BACKGROUND_PIXEL (f) = orig_fg; | 2441 FRAME_BACKGROUND_PIXEL (f) = orig_fg; |
2442 XSETFRAME (frame, f); | |
2443 Finternal_set_lisp_face_attribute (Qdefault, QCbackground, | |
2444 tty_color_name (orig_fg), frame); | |
2414 redraw = 1; | 2445 redraw = 1; |
2415 } | 2446 } |
2416 if (!bg_set) | 2447 if (!bg_set) |
2417 { | 2448 { |
2418 FRAME_FOREGROUND_PIXEL (f) = orig_bg; | 2449 FRAME_FOREGROUND_PIXEL (f) = orig_bg; |
2450 XSETFRAME (frame, f); | |
2451 Finternal_set_lisp_face_attribute (Qdefault, QCforeground, | |
2452 tty_color_name (orig_bg), frame); | |
2419 redraw = 1; | 2453 redraw = 1; |
2420 } | 2454 } |
2421 } | 2455 } |
2422 | 2456 |
2423 if (redraw) | 2457 if (redraw) |