Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
2306a735
Commit
2306a735
authored
Aug 26, 2008
by
Eli Zaretskii
Browse files
(internal_terminal_init): Most initializations done only once, especially
initial_screen_colors[] and termscript open.
parent
d0acbbaf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
62 deletions
+74
-62
src/ChangeLog
src/ChangeLog
+5
-0
src/msdos.c
src/msdos.c
+69
-62
No files found.
src/ChangeLog
View file @
2306a735
2008-08-26 Eli Zaretskii <eliz@gnu.org>
* msdos.c (internal_terminal_init): Most initializations done only
once, especially initial_screen_colors[] and termscript open.
2008-08-26 Chong Yidong <cyd@stupidchicken.com>
* eval.c (Fcondition_case): Doc fix.
...
...
src/msdos.c
View file @
2306a735
...
...
@@ -2414,6 +2414,7 @@ extern void init_frame_faces (FRAME_PTR);
void
internal_terminal_init
()
{
static
int
init_needed
=
1
;
char
*
term
=
getenv
(
"TERM"
),
*
colors
;
struct
frame
*
sf
=
SELECTED_FRAME
();
struct
tty_display_info
*
tty
;
...
...
@@ -2438,76 +2439,82 @@ internal_terminal_init ()
}
tty
=
FRAME_TTY
(
sf
);
if
(
!
tty
->
termscript
&&
getenv
(
"EMACSTEST"
))
tty
->
termscript
=
fopen
(
getenv
(
"EMACSTEST"
),
"wt"
);
if
(
tty
->
termscript
)
if
(
init_needed
)
{
time_t
now
=
time
(
NULL
);
struct
tm
*
tnow
=
localtime
(
&
now
);
char
tbuf
[
100
];
if
(
!
tty
->
termscript
&&
getenv
(
"EMACSTEST"
))
tty
->
termscript
=
fopen
(
getenv
(
"EMACSTEST"
),
"wt"
);
if
(
tty
->
termscript
)
{
time_t
now
=
time
(
NULL
);
struct
tm
*
tnow
=
localtime
(
&
now
);
char
tbuf
[
100
];
strftime
(
tbuf
,
sizeof
(
tbuf
)
-
1
,
"%a %b %e %Y %H:%M:%S %Z"
,
tnow
);
fprintf
(
tty
->
termscript
,
"
\n
Emacs session started at %s
\n
"
,
tbuf
);
fprintf
(
tty
->
termscript
,
"=====================
\n\n
"
);
}
strftime
(
tbuf
,
sizeof
(
tbuf
)
-
1
,
"%a %b %e %Y %H:%M:%S %Z"
,
tnow
);
fprintf
(
tty
->
termscript
,
"
\n
Emacs session started at %s
\n
"
,
tbuf
);
fprintf
(
tty
->
termscript
,
"=====================
\n\n
"
);
}
Vinitial_window_system
=
current_kboard
->
Vwindow_system
=
Qpc
;
Vwindow_system_version
=
make_number
(
23
);
/* RE Emacs version */
sf
->
output_method
=
output_msdos_raw
;
tty
->
terminal
->
type
=
output_msdos_raw
;
Vinitial_window_system
=
Qpc
;
Vwindow_system_version
=
make_number
(
23
);
/* RE Emacs version */
tty
->
terminal
->
type
=
output_msdos_raw
;
/* If Emacs was dumped on DOS/V machine, forget the stale VRAM address. */
screen_old_address
=
0
;
/* If Emacs was dumped on DOS/V machine, forget the stale VRAM
address. */
screen_old_address
=
0
;
/* Forget the stale screen colors as well. */
initial_screen_colors
[
0
]
=
initial_screen_colors
[
1
]
=
-
1
;
/* Forget the stale screen colors as well. */
initial_screen_colors
[
0
]
=
initial_screen_colors
[
1
]
=
-
1
;
FRAME_BACKGROUND_PIXEL
(
SELECTED_FRAME
())
=
7
;
/* White */
FRAME_FOREGROUND_PIXEL
(
SELECTED_FRAME
())
=
0
;
/* Black */
bright_bg
();
colors
=
getenv
(
"EMACSCOLORS"
);
if
(
colors
&&
strlen
(
colors
)
>=
2
)
{
/* The colors use 4 bits each (we enable bright background). */
if
(
isdigit
(
colors
[
0
]))
colors
[
0
]
-=
'0'
;
else
if
(
isxdigit
(
colors
[
0
]))
colors
[
0
]
-=
(
isupper
(
colors
[
0
])
?
'A'
:
'a'
)
-
10
;
if
(
colors
[
0
]
>=
0
&&
colors
[
0
]
<
16
)
FRAME_FOREGROUND_PIXEL
(
SELECTED_FRAME
())
=
colors
[
0
];
if
(
isdigit
(
colors
[
1
]))
colors
[
1
]
-=
'0'
;
else
if
(
isxdigit
(
colors
[
1
]))
colors
[
1
]
-=
(
isupper
(
colors
[
1
])
?
'A'
:
'a'
)
-
10
;
if
(
colors
[
1
]
>=
0
&&
colors
[
1
]
<
16
)
FRAME_BACKGROUND_PIXEL
(
SELECTED_FRAME
())
=
colors
[
1
];
}
the_only_display_info
.
mouse_face_mouse_frame
=
NULL
;
the_only_display_info
.
mouse_face_deferred_gc
=
0
;
the_only_display_info
.
mouse_face_beg_row
=
the_only_display_info
.
mouse_face_beg_col
=
-
1
;
the_only_display_info
.
mouse_face_end_row
=
the_only_display_info
.
mouse_face_end_col
=
-
1
;
the_only_display_info
.
mouse_face_face_id
=
DEFAULT_FACE_ID
;
the_only_display_info
.
mouse_face_window
=
Qnil
;
the_only_display_info
.
mouse_face_mouse_x
=
the_only_display_info
.
mouse_face_mouse_y
=
0
;
the_only_display_info
.
mouse_face_defer
=
0
;
the_only_display_info
.
mouse_face_hidden
=
0
;
if
(
have_mouse
)
/* detected in dos_ttraw, which see */
{
have_mouse
=
1
;
/* enable mouse */
mouse_visible
=
0
;
mouse_setup_buttons
(
mouse_button_count
);
tty
->
terminal
->
mouse_position_hook
=
&
mouse_get_pos
;
mouse_init
();
}
FRAME_BACKGROUND_PIXEL
(
SELECTED_FRAME
())
=
7
;
/* White */
FRAME_FOREGROUND_PIXEL
(
SELECTED_FRAME
())
=
0
;
/* Black */
bright_bg
();
colors
=
getenv
(
"EMACSCOLORS"
);
if
(
colors
&&
strlen
(
colors
)
>=
2
)
{
/* The colors use 4 bits each (we enable bright background). */
if
(
isdigit
(
colors
[
0
]))
colors
[
0
]
-=
'0'
;
else
if
(
isxdigit
(
colors
[
0
]))
colors
[
0
]
-=
(
isupper
(
colors
[
0
])
?
'A'
:
'a'
)
-
10
;
if
(
colors
[
0
]
>=
0
&&
colors
[
0
]
<
16
)
FRAME_FOREGROUND_PIXEL
(
SELECTED_FRAME
())
=
colors
[
0
];
if
(
isdigit
(
colors
[
1
]))
colors
[
1
]
-=
'0'
;
else
if
(
isxdigit
(
colors
[
1
]))
colors
[
1
]
-=
(
isupper
(
colors
[
1
])
?
'A'
:
'a'
)
-
10
;
if
(
colors
[
1
]
>=
0
&&
colors
[
1
]
<
16
)
FRAME_BACKGROUND_PIXEL
(
SELECTED_FRAME
())
=
colors
[
1
];
}
the_only_display_info
.
mouse_face_mouse_frame
=
NULL
;
the_only_display_info
.
mouse_face_deferred_gc
=
0
;
the_only_display_info
.
mouse_face_beg_row
=
the_only_display_info
.
mouse_face_beg_col
=
-
1
;
the_only_display_info
.
mouse_face_end_row
=
the_only_display_info
.
mouse_face_end_col
=
-
1
;
the_only_display_info
.
mouse_face_face_id
=
DEFAULT_FACE_ID
;
the_only_display_info
.
mouse_face_window
=
Qnil
;
the_only_display_info
.
mouse_face_mouse_x
=
the_only_display_info
.
mouse_face_mouse_y
=
0
;
the_only_display_info
.
mouse_face_defer
=
0
;
the_only_display_info
.
mouse_face_hidden
=
0
;
if
(
have_mouse
)
/* detected in dos_ttraw, which see */
{
have_mouse
=
1
;
/* enable mouse */
mouse_visible
=
0
;
mouse_setup_buttons
(
mouse_button_count
);
tty
->
terminal
->
mouse_position_hook
=
&
mouse_get_pos
;
mouse_init
();
}
if
(
tty
->
termscript
&&
screen_size
)
fprintf
(
tty
->
termscript
,
"<SCREEN SAVED (dimensions=%dx%d)>
\n
"
,
screen_size_X
,
screen_size_Y
);
if
(
tty
->
termscript
&&
screen_size
)
fprintf
(
tty
->
termscript
,
"<SCREEN SAVED (dimensions=%dx%d)>
\n
"
,
screen_size_X
,
screen_size_Y
);
init_needed
=
0
;
}
current_kboard
->
Vwindow_system
=
Qpc
;
sf
->
output_method
=
output_msdos_raw
;
init_frame_faces
(
sf
);
#endif
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment