* print.c (syms_of_print): Initialize debugging output not here...
authorDmitry Antipov <dmantipov@yandex.ru>
Tue, 19 Mar 2013 14:09:05 +0000 (18:09 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Tue, 19 Mar 2013 14:09:05 +0000 (18:09 +0400)
(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
src/emacs.c
src/lisp.h
src/print.c

index 72db989..a0a0cd8 100644 (file)
@@ -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  <dmantipov@yandex.ru>
 
index bd33583..5115126 100644 (file)
@@ -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
index b2ab568..f526cd3 100644 (file)
@@ -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.  */
index 03b4674..53c0d99 100644 (file)
@@ -2165,7 +2165,16 @@ print_interval (INTERVAL interval, Lisp_Object printcharfun)
   print_object (interval->plist, printcharfun, 1);
 }
 
-\f
+/* 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");