From cf4bb06de4057d96fb1725615e5cf2c288fc3199 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Tue, 19 Mar 2013 18:09:05 +0400 Subject: [PATCH] * print.c (syms_of_print): Initialize debugging output not here... (init_print_once): ...but in a new function here. * lisp.h (init_print_once): Add prototype. * emacs.c (main): Add call to init_print_once. Adjust comments. --- src/ChangeLog | 4 ++++ src/emacs.c | 7 ++++--- src/lisp.h | 1 + src/print.c | 13 ++++++++++--- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 72db989910f..a0a0cd81ed2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -4,6 +4,10 @@ Signal error if window is not internal. Adjust docstring. (delete_all_child_windows): Use combination_limit to save the buffer. (Fset_window_configuration): Adjust accordingly. + * print.c (syms_of_print): Initialize debugging output not here... + (init_print_once): ...but in a new function here. + * lisp.h (init_print_once): Add prototype. + * emacs.c (main): Add call to init_print_once. Adjust comments. 2013-03-18 Dmitry Antipov diff --git a/src/emacs.c b/src/emacs.c index bd33583af0c..5115126577b 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1080,7 +1080,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem noninteractive1 = noninteractive; -/* Perform basic initializations (not merely interning symbols). */ + /* Perform basic initializations (not merely interning symbols). */ if (!initialized) { @@ -1091,8 +1091,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem init_coding_once (); init_syntax_once (); /* Create standard syntax table. */ init_category_once (); /* Create standard category table. */ - /* Must be done before init_buffer. */ - init_casetab_once (); + init_casetab_once (); /* Must be done before init_buffer_once. */ init_buffer_once (); /* Create buffer table and some buffers. */ init_minibuf_once (); /* Create list of minibuffers. */ /* Must precede init_window_once. */ @@ -1117,6 +1116,8 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem syms_of_fileio (); /* Before syms_of_coding to initialize Vgc_cons_threshold. */ syms_of_alloc (); + /* May call Ffuncall and so GC, thus the latter should be initialized. */ + init_print_once (); /* Before syms_of_coding because it initializes Qcharsetp. */ syms_of_charset (); /* Before init_window_once, because it sets up the diff --git a/src/lisp.h b/src/lisp.h index b2ab5684d4d..f526cd36a6f 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3163,6 +3163,7 @@ extern Lisp_Object internal_with_output_to_temp_buffer (const char *, Lisp_Object (*) (Lisp_Object), Lisp_Object); enum FLOAT_TO_STRING_BUFSIZE { FLOAT_TO_STRING_BUFSIZE = 350 }; extern int float_to_string (char *, double); +extern void init_print_once (void); extern void syms_of_print (void); /* Defined in doprnt.c. */ diff --git a/src/print.c b/src/print.c index 03b46748454..53c0d99f836 100644 --- a/src/print.c +++ b/src/print.c @@ -2165,7 +2165,16 @@ print_interval (INTERVAL interval, Lisp_Object printcharfun) print_object (interval->plist, printcharfun, 1); } - +/* Initialize debug_print stuff early to have it working from the very + beginning. */ + +void +init_print_once (void) +{ + DEFSYM (Qexternal_debugging_output, "external-debugging-output"); + defsubr (&Sexternal_debugging_output); +} + void syms_of_print (void) { @@ -2297,12 +2306,10 @@ priorities. */); defsubr (&Sprint); defsubr (&Sterpri); defsubr (&Swrite_char); - defsubr (&Sexternal_debugging_output); #ifdef WITH_REDIRECT_DEBUGGING_OUTPUT defsubr (&Sredirect_debugging_output); #endif - DEFSYM (Qexternal_debugging_output, "external-debugging-output"); DEFSYM (Qprint_escape_newlines, "print-escape-newlines"); DEFSYM (Qprint_escape_multibyte, "print-escape-multibyte"); DEFSYM (Qprint_escape_nonascii, "print-escape-nonascii"); -- 2.11.4.GIT