aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2001-11-23 17:16:17 +0000
committerEli Zaretskii2001-11-23 17:16:17 +0000
commitdeece6f51a419739abb1eba6cde42677643e5510 (patch)
treeecac01079face97d1375078430542917194aff0c /src
parent792e1bc441fa3c2e7072b96d4986ee6fabea83d9 (diff)
downloademacs-deece6f51a419739abb1eba6cde42677643e5510.tar.gz
emacs-deece6f51a419739abb1eba6cde42677643e5510.zip
(IT_clear_screen): If the frame's faces are not yet
realized, use the initial screen colors to clear the screen.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/msdos.c18
2 files changed, 19 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index bc9198884f4..66c7125adda 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12001-11-23 Eli Zaretskii <eliz@is.elta.co.il>
2
3 * msdos.c (IT_clear_screen): If the frame's faces are not yet
4 realized, use the initial screen colors to clear the screen.
5
12001-11-23 Pavel Jan,Bm(Bk <Pavel@Janik.cz> 62001-11-23 Pavel Jan,Bm(Bk <Pavel@Janik.cz>
2 7
3 * textprop.c (Fset_text_properties): Remove unused variables 8 * textprop.c (Fset_text_properties): Remove unused variables
diff --git a/src/msdos.c b/src/msdos.c
index fdf8b078b3c..68386b95581 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -413,6 +413,10 @@ extern int unibyte_display_via_language_environment;
413 413
414Lisp_Object Qbar; 414Lisp_Object Qbar;
415 415
416/* The screen colors of the curent frame, which serve as the default
417 colors for newly-created frames. */
418static int initial_screen_colors[2];
419
416#if __DJGPP__ > 1 420#if __DJGPP__ > 1
417/* Update the screen from a part of relocated DOS/V screen buffer which 421/* Update the screen from a part of relocated DOS/V screen buffer which
418 begins at OFFSET and includes COUNT characters. */ 422 begins at OFFSET and includes COUNT characters. */
@@ -1797,7 +1801,16 @@ IT_clear_screen (void)
1797{ 1801{
1798 if (termscript) 1802 if (termscript)
1799 fprintf (termscript, "<CLR:SCR>"); 1803 fprintf (termscript, "<CLR:SCR>");
1800 IT_set_face (0); 1804 /* We are sometimes called (from clear_garbaged_frames) when a new
1805 frame is being created, but its faces are not yet realized. In
1806 such a case we cannot call IT_set_face, since it will fail to find
1807 any valid faces and will abort. Instead, use the initial screen
1808 colors; that should mimic what a Unix tty does, which simply clears
1809 the screen with whatever default colors are in use. */
1810 if (FACE_FROM_ID (SELECTED_FRAME (), DEFAULT_FACE_ID) == NULL)
1811 ScreenAttrib = (initial_screen_colors[0] << 4) | initial_screen_colors[1];
1812 else
1813 IT_set_face (0);
1801 mouse_off (); 1814 mouse_off ();
1802 ScreenClear (); 1815 ScreenClear ();
1803 if (screen_virtual_segment) 1816 if (screen_virtual_segment)
@@ -2275,9 +2288,6 @@ IT_set_terminal_window (int foo)
2275 2288
2276/* Remember the screen colors of the curent frame, to serve as the 2289/* Remember the screen colors of the curent frame, to serve as the
2277 default colors for newly-created frames. */ 2290 default colors for newly-created frames. */
2278
2279static int initial_screen_colors[2];
2280
2281DEFUN ("msdos-remember-default-colors", Fmsdos_remember_default_colors, 2291DEFUN ("msdos-remember-default-colors", Fmsdos_remember_default_colors,
2282 Smsdos_remember_default_colors, 1, 1, 0, 2292 Smsdos_remember_default_colors, 1, 1, 0,
2283 "Remember the screen colors of the current frame.") 2293 "Remember the screen colors of the current frame.")