simplify [g]racket startup banner

This commit is contained in:
Matthew Flatt 2010-04-15 22:15:43 -04:00
parent 03099f4aa2
commit 840ea4f4f5
4 changed files with 19 additions and 13 deletions

View File

@ -50,11 +50,15 @@
(super-init) (super-init)
(let ([s (last-position)] (let ([s (last-position)]
[m (regexp-match #rx"^(.*), (Copyright.*)$" (banner))]) [m (regexp-match #rx"^(.*), (Copyright.*)$" (banner))])
(insert (format "~a." (cadr m))) (insert (if m
(format "~a." (cadr m))
(let ([b (banner)])
(substring b 0 (sub1 (string-length b))))))
(let ([e (last-position)]) (let ([e (last-position)])
(insert #\newline) (insert #\newline)
(change-style (send (make-object wx:style-delta% 'change-bold) set-delta-foreground "BLUE") s e)) (change-style (send (make-object wx:style-delta% 'change-bold) set-delta-foreground "BLUE") s e))
(output (caddr m))) (when m
(output (caddr m))))
(insert "This is a simple window for evaluating Racket expressions.") (insert #\newline) (insert "This is a simple window for evaluating Racket expressions.") (insert #\newline)
(let ([s (last-position)]) (let ([s (last-position)])
(insert "Quit now and run DrRacket to get a better window.") (insert "Quit now and run DrRacket to get a better window.")

View File

@ -2960,11 +2960,11 @@ void wxDoMainLoop()
static Scheme_Env *setup_basic_env() static Scheme_Env *setup_basic_env()
{ {
scheme_set_banner(BANNER);
wxREGGLOB(global_env); wxREGGLOB(global_env);
global_env = scheme_basic_env(); global_env = scheme_basic_env();
scheme_set_banner(BANNER);
#ifdef DANGER_ALARM #ifdef DANGER_ALARM
{ {
DangerThreadTimer *t = new WXGC_PTRS DangerThreadTimer(); DangerThreadTimer *t = new WXGC_PTRS DangerThreadTimer();

View File

@ -179,7 +179,8 @@ MRED_EXTERN void mred_set_run_from_cmd_line(MrEd_Run_From_Cmd_Line_Proc);
# include "../mzscheme/src/schvers.h" # include "../mzscheme/src/schvers.h"
#ifdef MZ_PRECISE_GC #ifdef MZ_PRECISE_GC
# define mrVERSION_SUFFIX " [3m]" /* don't print " [3m]", which is the default: */
# define mrVERSION_SUFFIX ""
#else #else
# ifdef USE_SENORA_GC # ifdef USE_SENORA_GC
# define mrVERSION_SUFFIX " [cgc~]" # define mrVERSION_SUFFIX " [cgc~]"
@ -187,7 +188,7 @@ MRED_EXTERN void mred_set_run_from_cmd_line(MrEd_Run_From_Cmd_Line_Proc);
# define mrVERSION_SUFFIX " [cgc]" # define mrVERSION_SUFFIX " [cgc]"
# endif # endif
#endif #endif
#define BANNER "GRacket v" MZSCHEME_VERSION mrVERSION_SUFFIX ", Copyright (c) 2004-2010 PLT Scheme Inc.\n" #define BANNER "Welcome to GRacket v" MZSCHEME_VERSION mrVERSION_SUFFIX ".\n"
#ifndef WCONSOLE_STDIO #ifndef WCONSOLE_STDIO
# if defined(wx_msw) # if defined(wx_msw)

View File

@ -1931,7 +1931,8 @@ char *scheme_version(void)
} }
#ifdef MZ_PRECISE_GC #ifdef MZ_PRECISE_GC
# define VERSION_SUFFIX " [3m]" /* don't print " [3m]", which is the default: */
# define VERSION_SUFFIX ""
#else #else
# ifdef USE_SENORA_GC # ifdef USE_SENORA_GC
# define VERSION_SUFFIX " [cgc~]" # define VERSION_SUFFIX " [cgc~]"
@ -1945,9 +1946,9 @@ char *scheme_banner(void)
if (embedding_banner) if (embedding_banner)
return embedding_banner; return embedding_banner;
else else
return "Welcome to Racket" return ("Welcome to Racket"
" v" MZSCHEME_VERSION VERSION_SUFFIX " v" MZSCHEME_VERSION VERSION_SUFFIX
", Copyright (c) 2004-2010 PLT Scheme Inc.\n"; ".\n");
} }
void scheme_set_banner(char *s) void scheme_set_banner(char *s)