aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2000-10-09 16:05:35 +0000
committerEli Zaretskii2000-10-09 16:05:35 +0000
commit1e21fe48c0731afa2b0416d0d61a59ded1e373bd (patch)
treed46f95ec05e271308d1a03864d1c5df70bd2e62d
parent126cbb422adc756d37ddf9eeac9df71537c75b39 (diff)
downloademacs-1e21fe48c0731afa2b0416d0d61a59ded1e373bd.tar.gz
emacs-1e21fe48c0731afa2b0416d0d61a59ded1e373bd.zip
(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.
-rw-r--r--src/ChangeLog7
-rw-r--r--src/msdos.c54
2 files changed, 51 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 75c54578531..65b8e4f988b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
12000-10-09 Eli Zaretskii <eliz@is.elta.co.il>
2
3 * msdos.c (IT_set_frame_parameters): Don't initialize Lisp_Object
4 variables. If ALISt includes foreground-color or
5 background-color, change also the colors of the default face for
6 this frame.
7
12000-10-08 Eli Zaretskii <eliz@is.elta.co.il> 82000-10-08 Eli Zaretskii <eliz@is.elta.co.il>
2 9
3 * msdos.c (top-level) <Qbackground_color, Qforeground_color>: Make 10 * msdos.c (top-level) <Qbackground_color, Qforeground_color>: Make
diff --git a/src/msdos.c b/src/msdos.c
index 9939cc5fe7a..0797c7607a0 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -2331,8 +2331,10 @@ IT_set_frame_parameters (f, alist)
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);
@@ -2344,8 +2346,12 @@ IT_set_frame_parameters (f, alist)
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 {
@@ -2356,12 +2362,21 @@ IT_set_frame_parameters (f, alist)
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)
@@ -2377,10 +2392,21 @@ IT_set_frame_parameters (f, alist)
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)
@@ -2408,14 +2434,22 @@ IT_set_frame_parameters (f, alist)
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 }