X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/4787a496a05fdc03241850b45911dd283d4b06b8..c566235d981eba73c88bbff00b6a1d88360b6e9f:/src/print.c diff --git a/src/print.c b/src/print.c index c88951880e..91ac68c8d3 100644 --- a/src/print.c +++ b/src/print.c @@ -1,7 +1,7 @@ /* Lisp object printing and output streams. Copyright (C) 1985, 1986, 1988, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -21,6 +21,7 @@ along with GNU Emacs. If not, see . */ #include #include +#include #include "lisp.h" #include "buffer.h" #include "character.h" @@ -41,20 +42,9 @@ Lisp_Object Vstandard_output, Qstandard_output; Lisp_Object Qtemp_buffer_setup_hook; /* These are used to print like we read. */ -extern Lisp_Object Qbackquote, Qcomma, Qcomma_at, Qcomma_dot, Qfunction; Lisp_Object Vfloat_output_format, Qfloat_output_format; -/* Work around a problem that happens because math.h on hpux 7 - defines two static variables--which, in Emacs, are not really static, - because `static' is defined as nothing. The problem is that they are - defined both here and in lread.c. - These macros prevent the name conflict. */ -#if defined (HPUX) && !defined (HPUX8) -#define _MAXLDBL print_maxldbl -#define _NMAXLDBL print_nmaxldbl -#endif - #include #if STDC_HEADERS @@ -170,19 +160,7 @@ Lisp_Object Vprint_number_table; #define PRINT_NUMBER_OBJECT(table,i) XVECTOR ((table))->contents[(i) * 2] #define PRINT_NUMBER_STATUS(table,i) XVECTOR ((table))->contents[(i) * 2 + 1] -/* Nonzero means print newline to stdout before next minibuffer message. - Defined in xdisp.c */ - -extern int noninteractive_need_newline; - -extern int minibuffer_auto_raise; - -#ifdef MAX_PRINT_CHARS -static int print_chars; -static int max_print; -#endif /* MAX_PRINT_CHARS */ - -void print_interval (); +void print_interval (INTERVAL interval, Lisp_Object printcharfun); /* GDB resets this to zero on W32 to disable OutputDebugString calls. */ int print_output_debug_flag = 1; @@ -301,10 +279,9 @@ int print_output_debug_flag = 1; when there is a recursive call to print. */ static Lisp_Object -print_unwind (saved_text) - Lisp_Object saved_text; +print_unwind (Lisp_Object saved_text) { - bcopy (SDATA (saved_text), print_buffer, SCHARS (saved_text)); + memcpy (print_buffer, SDATA (saved_text), SCHARS (saved_text)); return Qnil; } @@ -315,15 +292,8 @@ print_unwind (saved_text) argument. */ static void -printchar (ch, fun) - unsigned int ch; - Lisp_Object fun; +printchar (unsigned int ch, Lisp_Object fun) { -#ifdef MAX_PRINT_CHARS - if (max_print) - print_chars++; -#endif /* MAX_PRINT_CHARS */ - if (!NILP (fun) && !EQ (fun, Qt)) call1 (fun, make_number (ch)); else @@ -338,7 +308,7 @@ printchar (ch, fun) if (print_buffer_pos_byte + len >= print_buffer_size) print_buffer = (char *) xrealloc (print_buffer, print_buffer_size *= 2); - bcopy (str, print_buffer + print_buffer_pos_byte, len); + memcpy (print_buffer + print_buffer_pos_byte, str, len); print_buffer_pos += 1; print_buffer_pos_byte += len; } @@ -372,11 +342,8 @@ printchar (ch, fun) to data in a Lisp string. Otherwise that is not safe. */ static void -strout (ptr, size, size_byte, printcharfun, multibyte) - char *ptr; - int size, size_byte; - Lisp_Object printcharfun; - int multibyte; +strout (const char *ptr, int size, int size_byte, Lisp_Object printcharfun, + int multibyte) { if (size < 0) size_byte = size = strlen (ptr); @@ -389,14 +356,9 @@ strout (ptr, size, size_byte, printcharfun, multibyte) print_buffer = (char *) xrealloc (print_buffer, print_buffer_size); } - bcopy (ptr, print_buffer + print_buffer_pos_byte, size_byte); + memcpy (print_buffer + print_buffer_pos_byte, ptr, size_byte); print_buffer_pos += size; print_buffer_pos_byte += size_byte; - -#ifdef MAX_PRINT_CHARS - if (max_print) - print_chars += size; -#endif /* MAX_PRINT_CHARS */ } else if (noninteractive && EQ (printcharfun, Qt)) { @@ -425,15 +387,10 @@ strout (ptr, size, size_byte, printcharfun, multibyte) int len; for (i = 0; i < size_byte; i += len) { - int ch = STRING_CHAR_AND_LENGTH (ptr + i, size_byte - i, len); + int ch = STRING_CHAR_AND_LENGTH (ptr + i, len); insert_char (ch); } } - -#ifdef MAX_PRINT_CHARS - if (max_print) - print_chars += size; -#endif /* MAX_PRINT_CHARS */ } else { @@ -456,7 +413,7 @@ strout (ptr, size, size_byte, printcharfun, multibyte) corresponding character code before handing it to PRINTCHAR. */ int len; - int ch = STRING_CHAR_AND_LENGTH (ptr + i, size_byte - i, len); + int ch = STRING_CHAR_AND_LENGTH (ptr + i, len); PRINTCHAR (ch); i += len; } @@ -469,9 +426,7 @@ strout (ptr, size, size_byte, printcharfun, multibyte) because printing one char can relocate. */ static void -print_string (string, printcharfun) - Lisp_Object string; - Lisp_Object printcharfun; +print_string (Lisp_Object string, Lisp_Object printcharfun) { if (EQ (printcharfun, Qt) || NILP (printcharfun)) { @@ -498,7 +453,7 @@ print_string (string, printcharfun) if (chars < bytes) { newstr = make_uninit_multibyte_string (chars, bytes); - bcopy (SDATA (string), SDATA (newstr), chars); + memcpy (SDATA (newstr), SDATA (string), chars); str_to_multibyte (SDATA (newstr), bytes, chars); string = newstr; } @@ -517,7 +472,7 @@ print_string (string, printcharfun) USE_SAFE_ALLOCA; SAFE_ALLOCA (buffer, char *, nbytes); - bcopy (SDATA (string), buffer, nbytes); + memcpy (buffer, SDATA (string), nbytes); strout (buffer, chars, SBYTES (string), printcharfun, STRING_MULTIBYTE (string)); @@ -548,8 +503,7 @@ print_string (string, printcharfun) /* Here, we must convert each multi-byte form to the corresponding character code before handing it to PRINTCHAR. */ int len; - int ch = STRING_CHAR_AND_LENGTH (SDATA (string) + i, - size_byte - i, len); + int ch = STRING_CHAR_AND_LENGTH (SDATA (string) + i, len); PRINTCHAR (ch); i += len; } @@ -560,8 +514,7 @@ print_string (string, printcharfun) DEFUN ("write-char", Fwrite_char, Swrite_char, 1, 2, 0, doc: /* Output character CHARACTER to stream PRINTCHARFUN. PRINTCHARFUN defaults to the value of `standard-output' (which see). */) - (character, printcharfun) - Lisp_Object character, printcharfun; + (Lisp_Object character, Lisp_Object printcharfun) { PRINTDECLARE; @@ -579,9 +532,7 @@ PRINTCHARFUN defaults to the value of `standard-output' (which see). */) Do not use this on the contents of a Lisp string. */ void -write_string (data, size) - char *data; - int size; +write_string (const char *data, int size) { PRINTDECLARE; Lisp_Object printcharfun; @@ -598,10 +549,7 @@ write_string (data, size) Do not use this on the contents of a Lisp string. */ void -write_string_1 (data, size, printcharfun) - char *data; - int size; - Lisp_Object printcharfun; +write_string_1 (const char *data, int size, Lisp_Object printcharfun) { PRINTDECLARE; @@ -612,8 +560,7 @@ write_string_1 (data, size, printcharfun) void -temp_output_buffer_setup (bufname) - const char *bufname; +temp_output_buffer_setup (const char *bufname) { int count = SPECPDL_INDEX (); register struct buffer *old = current_buffer; @@ -646,10 +593,7 @@ temp_output_buffer_setup (bufname) } Lisp_Object -internal_with_output_to_temp_buffer (bufname, function, args) - const char *bufname; - Lisp_Object (*function) P_ ((Lisp_Object)); - Lisp_Object args; +internal_with_output_to_temp_buffer (const char *bufname, Lisp_Object (*function) (Lisp_Object), Lisp_Object args) { int count = SPECPDL_INDEX (); Lisp_Object buf, val; @@ -700,8 +644,7 @@ temporarily selected. But it doesn't run `temp-buffer-show-hook' if it uses `temp-buffer-show-function'. usage: (with-output-to-temp-buffer BUFNAME BODY...) */) - (args) - Lisp_Object args; + (Lisp_Object args) { struct gcpro gcpro1; Lisp_Object name; @@ -725,16 +668,15 @@ usage: (with-output-to-temp-buffer BUFNAME BODY...) */) } -static void print (); -static void print_preprocess (); -static void print_preprocess_string (); -static void print_object (); +static void print (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag); +static void print_preprocess (Lisp_Object obj); +static void print_preprocess_string (INTERVAL interval, Lisp_Object arg); +static void print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag); DEFUN ("terpri", Fterpri, Sterpri, 0, 1, 0, doc: /* Output a newline to stream PRINTCHARFUN. If PRINTCHARFUN is omitted or nil, the value of `standard-output' is used. */) - (printcharfun) - Lisp_Object printcharfun; + (Lisp_Object printcharfun) { PRINTDECLARE; @@ -769,14 +711,10 @@ of these: If PRINTCHARFUN is omitted, the value of `standard-output' (which see) is used instead. */) - (object, printcharfun) - Lisp_Object object, printcharfun; + (Lisp_Object object, Lisp_Object printcharfun) { PRINTDECLARE; -#ifdef MAX_PRINT_CHARS - max_print = 0; -#endif /* MAX_PRINT_CHARS */ if (NILP (printcharfun)) printcharfun = Vstandard_output; PRINTPREPARE; @@ -799,8 +737,7 @@ OBJECT is any of the Lisp data types: a number, a string, a symbol, a list, a buffer, a window, a frame, etc. A printed representation of an object is text which describes that object. */) - (object, noescape) - Lisp_Object object, noescape; + (Lisp_Object object, Lisp_Object noescape) { Lisp_Object printcharfun; /* struct gcpro gcpro1, gcpro2; */ @@ -868,8 +805,7 @@ of these: If PRINTCHARFUN is omitted, the value of `standard-output' (which see) is used instead. */) - (object, printcharfun) - Lisp_Object object, printcharfun; + (Lisp_Object object, Lisp_Object printcharfun) { PRINTDECLARE; @@ -904,16 +840,11 @@ of these: If PRINTCHARFUN is omitted, the value of `standard-output' (which see) is used instead. */) - (object, printcharfun) - Lisp_Object object, printcharfun; + (Lisp_Object object, Lisp_Object printcharfun) { PRINTDECLARE; struct gcpro gcpro1; -#ifdef MAX_PRINT_CHARS - print_chars = 0; - max_print = MAX_PRINT_CHARS; -#endif /* MAX_PRINT_CHARS */ if (NILP (printcharfun)) printcharfun = Vstandard_output; GCPRO1 (object); @@ -922,10 +853,6 @@ is used instead. */) print (object, printcharfun, 1); PRINTCHAR ('\n'); PRINTFINISH; -#ifdef MAX_PRINT_CHARS - max_print = 0; - print_chars = 0; -#endif /* MAX_PRINT_CHARS */ UNGCPRO; return object; } @@ -938,8 +865,7 @@ DEFUN ("external-debugging-output", Fexternal_debugging_output, Sexternal_debugg doc: /* Write CHARACTER to stderr. You can call print while debugging emacs, and pass it this function to make it write to the debugging output. */) - (character) - Lisp_Object character; + (Lisp_Object character) { CHECK_NUMBER (character); putc (XINT (character), stderr); @@ -960,8 +886,7 @@ to make it write to the debugging output. */) print_output_debug_flag from being optimized away. */ void -debug_output_compilation_hack (x) - int x; +debug_output_compilation_hack (int x) { print_output_debug_flag = x; } @@ -982,8 +907,7 @@ DEFUN ("redirect-debugging-output", Fredirect_debugging_output, Sredirect_debugg If FILE is nil, reset target to the initial stderr stream. Optional arg APPEND non-nil (interactively, with prefix arg) means append to existing target file. */) - (file, append) - Lisp_Object file, append; + (Lisp_Object file, Lisp_Object append) { if (initial_stderr_stream != NULL) { @@ -1015,16 +939,14 @@ append to existing target file. */) /* This is the interface for debugging printing. */ void -debug_print (arg) - Lisp_Object arg; +debug_print (Lisp_Object arg) { Fprin1 (arg, Qexternal_debugging_output); fprintf (stderr, "\r\n"); } void -safe_debug_print (arg) - Lisp_Object arg; +safe_debug_print (Lisp_Object arg) { int valid = valid_lisp_object_p (arg); @@ -1043,8 +965,7 @@ DEFUN ("error-message-string", Ferror_message_string, Serror_message_string, doc: /* Convert an error value (ERROR-SYMBOL . DATA) to an error message. See Info anchor `(elisp)Definition of signal' for some details on how this error message is constructed. */) - (obj) - Lisp_Object obj; + (Lisp_Object obj) { struct buffer *old = current_buffer; Lisp_Object value; @@ -1078,10 +999,8 @@ error message is constructed. */) CALLER is the Lisp function inside which the error was signaled. */ void -print_error_message (data, stream, context, caller) - Lisp_Object data, stream; - char *context; - Lisp_Object caller; +print_error_message (Lisp_Object data, Lisp_Object stream, const char *context, + Lisp_Object caller) { Lisp_Object errname, errmsg, file_error, tail; struct gcpro gcpro1; @@ -1096,7 +1015,7 @@ print_error_message (data, stream, context, caller) { Lisp_Object cname = SYMBOL_NAME (caller); char *name = alloca (SBYTES (cname)); - bcopy (SDATA (cname), name, SBYTES (cname)); + memcpy (name, SDATA (cname), SBYTES (cname)); message_dolog (name, SBYTES (cname), 0, 0); message_dolog (": ", 2, 0, 0); } @@ -1166,9 +1085,7 @@ print_error_message (data, stream, context, caller) */ void -float_to_string (buf, data) - unsigned char *buf; - double data; +float_to_string (unsigned char *buf, double data) { unsigned char *cp; int width; @@ -1291,10 +1208,7 @@ float_to_string (buf, data) static void -print (obj, printcharfun, escapeflag) - Lisp_Object obj; - register Lisp_Object printcharfun; - int escapeflag; +print (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag) { new_backquote_output = 0; @@ -1353,8 +1267,7 @@ print (obj, printcharfun, escapeflag) The status fields of Vprint_number_table mean whether each object appears more than once in OBJ: Qnil at the first time, and Qt after that . */ static void -print_preprocess (obj) - Lisp_Object obj; +print_preprocess (Lisp_Object obj) { int i; EMACS_INT size; @@ -1381,7 +1294,8 @@ print_preprocess (obj) loop: if (STRINGP (obj) || CONSP (obj) || VECTORP (obj) - || COMPILEDP (obj) || CHAR_TABLE_P (obj) || SUB_CHAR_TABLE_P (obj) + || FUNVECP (obj) || CHAR_TABLE_P (obj) || SUB_CHAR_TABLE_P (obj) + || HASH_TABLE_P (obj) || (! NILP (Vprint_gensym) && SYMBOLP (obj) && !SYMBOL_INTERNED_P (obj))) @@ -1456,6 +1370,13 @@ print_preprocess (obj) size &= PSEUDOVECTOR_SIZE_MASK; for (i = 0; i < size; i++) print_preprocess (XVECTOR (obj)->contents[i]); + if (HASH_TABLE_P (obj)) + { /* For hash tables, the key_and_value slot is past + `size' because it needs to be marked specially in case + the table is weak. */ + struct Lisp_Hash_Table *h = XHASH_TABLE (obj); + print_preprocess (h->key_and_value); + } break; default: @@ -1466,9 +1387,7 @@ print_preprocess (obj) } static void -print_preprocess_string (interval, arg) - INTERVAL interval; - Lisp_Object arg; +print_preprocess_string (INTERVAL interval, Lisp_Object arg) { print_preprocess (interval->plist); } @@ -1476,9 +1395,8 @@ print_preprocess_string (interval, arg) /* A flag to control printing of `charset' text property. The default value is Qdefault. */ Lisp_Object Vprint_charset_text_property; -extern Lisp_Object Qdefault; -static void print_check_string_charset_prop (); +static void print_check_string_charset_prop (INTERVAL interval, Lisp_Object string); #define PRINT_STRING_NON_CHARSET_FOUND 1 #define PRINT_STRING_UNSAFE_CHARSET_FOUND 2 @@ -1487,9 +1405,7 @@ static void print_check_string_charset_prop (); static int print_check_string_result; static void -print_check_string_charset_prop (interval, string) - INTERVAL interval; - Lisp_Object string; +print_check_string_charset_prop (INTERVAL interval, Lisp_Object string) { Lisp_Object val; @@ -1536,8 +1452,7 @@ print_check_string_charset_prop (interval, string) static Lisp_Object print_prune_charset_plist; static Lisp_Object -print_prune_string_charset (string) - Lisp_Object string; +print_prune_string_charset (Lisp_Object string) { print_check_string_result = 0; traverse_intervals (STRING_INTERVALS (string), 0, @@ -1561,18 +1476,20 @@ print_prune_string_charset (string) } static void -print_object (obj, printcharfun, escapeflag) - Lisp_Object obj; - register Lisp_Object printcharfun; - int escapeflag; +print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag) { char buf[40]; QUIT; + /* See similar code in print_preprocess. */ + if (print_depth >= PRINT_CIRCLE) + error ("Apparently circular structure being printed"); + /* Detect circularities and truncate them. */ if (STRINGP (obj) || CONSP (obj) || VECTORP (obj) - || COMPILEDP (obj) || CHAR_TABLE_P (obj) || SUB_CHAR_TABLE_P (obj) + || FUNVECP (obj) || CHAR_TABLE_P (obj) || SUB_CHAR_TABLE_P (obj) + || HASH_TABLE_P (obj) || (! NILP (Vprint_gensym) && SYMBOLP (obj) && !SYMBOL_INTERNED_P (obj))) @@ -1620,20 +1537,9 @@ print_object (obj, printcharfun, escapeflag) print_depth++; - /* See similar code in print_preprocess. */ - if (print_depth > PRINT_CIRCLE) - error ("Apparently circular structure being printed"); -#ifdef MAX_PRINT_CHARS - if (max_print && print_chars > max_print) - { - PRINTCHAR ('\n'); - print_chars = 0; - } -#endif /* MAX_PRINT_CHARS */ - switch (XTYPE (obj)) { - case Lisp_Int: + case_Lisp_Int: if (sizeof (int) == sizeof (EMACS_INT)) sprintf (buf, "%d", (int) XINT (obj)); else if (sizeof (long) == sizeof (EMACS_INT)) @@ -1690,8 +1596,7 @@ print_object (obj, printcharfun, escapeflag) if (multibyte) { - c = STRING_CHAR_AND_LENGTH (str + i_byte, - size_byte - i_byte, len); + c = STRING_CHAR_AND_LENGTH (str + i_byte, len); i_byte += len; } else @@ -1799,7 +1704,7 @@ print_object (obj, printcharfun, escapeflag) { while (p != end && ((*p >= '0' && *p <= '9') /* Needed for \2e10. */ - || *p == 'e')) + || *p == 'e' || *p == 'E')) p++; confusing = (end == p); } @@ -2016,12 +1921,7 @@ print_object (obj, printcharfun, escapeflag) { QUIT; c = XBOOL_VECTOR (obj)->data[i]; - if (! ASCII_BYTE_P (c)) - { - sprintf (buf, "\\%03o", c); - strout (buf, -1, -1, printcharfun, 0); - } - else if (c == '\n' && print_escape_newlines) + if (c == '\n' && print_escape_newlines) { PRINTCHAR ('\\'); PRINTCHAR ('n'); @@ -2084,6 +1984,8 @@ print_object (obj, printcharfun, escapeflag) else if (HASH_TABLE_P (obj)) { struct Lisp_Hash_Table *h = XHASH_TABLE (obj); + int i, real_size, size; +#if 0 strout ("#test)) { @@ -2100,6 +2002,65 @@ print_object (obj, printcharfun, escapeflag) sprintf (buf, " 0x%lx", (unsigned long) h); strout (buf, -1, -1, printcharfun, 0); PRINTCHAR ('>'); +#endif + /* Implement a readable output, e.g.: + #s(hash-table size 2 test equal data (k1 v1 k2 v2)) */ + /* Always print the size. */ + sprintf (buf, "#s(hash-table size %ld", + (long) XVECTOR (h->next)->size); + strout (buf, -1, -1, printcharfun, 0); + + if (!NILP (h->test)) + { + strout (" test ", -1, -1, printcharfun, 0); + print_object (h->test, printcharfun, 0); + } + + if (!NILP (h->weak)) + { + strout (" weakness ", -1, -1, printcharfun, 0); + print_object (h->weak, printcharfun, 0); + } + + if (!NILP (h->rehash_size)) + { + strout (" rehash-size ", -1, -1, printcharfun, 0); + print_object (h->rehash_size, printcharfun, 0); + } + + if (!NILP (h->rehash_threshold)) + { + strout (" rehash-threshold ", -1, -1, printcharfun, 0); + print_object (h->rehash_threshold, printcharfun, 0); + } + + strout (" data ", -1, -1, printcharfun, 0); + + /* Print the data here as a plist. */ + real_size = HASH_TABLE_SIZE (h); + size = real_size; + + /* Don't print more elements than the specified maximum. */ + if (NATNUMP (Vprint_length) + && XFASTINT (Vprint_length) < size) + size = XFASTINT (Vprint_length); + + PRINTCHAR ('('); + for (i = 0; i < size; i++) + if (!NILP (HASH_HASH (h, i))) + { + if (i) PRINTCHAR (' '); + print_object (HASH_KEY (h, i), printcharfun, 1); + PRINTCHAR (' '); + print_object (HASH_VALUE (h, i), printcharfun, 1); + } + + if (size < real_size) + strout (" ...", 4, 4, printcharfun, 0); + + PRINTCHAR (')'); + PRINTCHAR (')'); + } else if (BUFFERP (obj)) { @@ -2159,7 +2120,7 @@ print_object (obj, printcharfun, escapeflag) else { EMACS_INT size = XVECTOR (obj)->size; - if (COMPILEDP (obj)) + if (FUNVECP (obj)) { PRINTCHAR ('#'); size &= PSEUDOVECTOR_SIZE_MASK; @@ -2169,6 +2130,13 @@ print_object (obj, printcharfun, escapeflag) /* We print a char-table as if it were a vector, lumping the parent and default slots in with the character slots. But we add #^ as a prefix. */ + + /* Make each lowest sub_char_table start a new line. + Otherwise we'll make a line extremely long, which + results in slow redisplay. */ + if (SUB_CHAR_TABLE_P (obj) + && XINT (XSUB_CHAR_TABLE (obj)->depth) == 3) + PRINTCHAR ('\n'); PRINTCHAR ('#'); PRINTCHAR ('^'); if (SUB_CHAR_TABLE_P (obj)) @@ -2244,70 +2212,6 @@ print_object (obj, printcharfun, escapeflag) strout ("#", -1, -1, printcharfun, 0); break; - case Lisp_Misc_Intfwd: - sprintf (buf, "#", (long) *XINTFWD (obj)->intvar); - strout (buf, -1, -1, printcharfun, 0); - break; - - case Lisp_Misc_Boolfwd: - sprintf (buf, "#", - (*XBOOLFWD (obj)->boolvar ? "t" : "nil")); - strout (buf, -1, -1, printcharfun, 0); - break; - - case Lisp_Misc_Objfwd: - strout ("#objvar, printcharfun, escapeflag); - PRINTCHAR ('>'); - break; - - case Lisp_Misc_Buffer_Objfwd: - strout ("#offset), - printcharfun, escapeflag); - PRINTCHAR ('>'); - break; - - case Lisp_Misc_Kboard_Objfwd: - strout ("#offset), - printcharfun, escapeflag); - PRINTCHAR ('>'); - break; - - case Lisp_Misc_Buffer_Local_Value: - strout ("#local_if_set) - strout ("[local-if-set] ", -1, -1, printcharfun, 0); - strout ("[realvalue] ", -1, -1, printcharfun, 0); - print_object (XBUFFER_LOCAL_VALUE (obj)->realvalue, - printcharfun, escapeflag); - if (XBUFFER_LOCAL_VALUE (obj)->found_for_buffer) - strout ("[local in buffer] ", -1, -1, printcharfun, 0); - else - strout ("[buffer] ", -1, -1, printcharfun, 0); - print_object (XBUFFER_LOCAL_VALUE (obj)->buffer, - printcharfun, escapeflag); - if (XBUFFER_LOCAL_VALUE (obj)->check_frame) - { - if (XBUFFER_LOCAL_VALUE (obj)->found_for_frame) - strout ("[local in frame] ", -1, -1, printcharfun, 0); - else - strout ("[frame] ", -1, -1, printcharfun, 0); - print_object (XBUFFER_LOCAL_VALUE (obj)->frame, - printcharfun, escapeflag); - } - strout ("[alist-elt] ", -1, -1, printcharfun, 0); - print_object (XCAR (XBUFFER_LOCAL_VALUE (obj)->cdr), - printcharfun, escapeflag); - strout ("[default-value] ", -1, -1, printcharfun, 0); - print_object (XCDR (XBUFFER_LOCAL_VALUE (obj)->cdr), - printcharfun, escapeflag); - PRINTCHAR ('>'); - break; - case Lisp_Misc_Save_Value: strout ("#plist)) return; @@ -2365,9 +2267,9 @@ print_interval (interval, printcharfun) void -syms_of_print () +syms_of_print (void) { - Qtemp_buffer_setup_hook = intern ("temp-buffer-setup-hook"); + Qtemp_buffer_setup_hook = intern_c_string ("temp-buffer-setup-hook"); staticpro (&Qtemp_buffer_setup_hook); DEFVAR_LISP ("standard-output", &Vstandard_output, @@ -2377,7 +2279,7 @@ It may also be a buffer (output is inserted before point) or a marker (output is inserted and the marker is advanced) or the symbol t (output appears in the echo area). */); Vstandard_output = Qt; - Qstandard_output = intern ("standard-output"); + Qstandard_output = intern_c_string ("standard-output"); staticpro (&Qstandard_output); DEFVAR_LISP ("float-output-format", &Vfloat_output_format, @@ -2397,7 +2299,7 @@ decimal point. 0 is not allowed with `e' or `g'. A value of nil means to use the shortest notation that represents the number without losing information. */); Vfloat_output_format = Qnil; - Qfloat_output_format = intern ("float-output-format"); + Qfloat_output_format = intern_c_string ("float-output-format"); staticpro (&Qfloat_output_format); DEFVAR_LISP ("print-length", &Vprint_length, @@ -2503,16 +2405,16 @@ priorities. */); defsubr (&Sredirect_debugging_output); #endif - Qexternal_debugging_output = intern ("external-debugging-output"); + Qexternal_debugging_output = intern_c_string ("external-debugging-output"); staticpro (&Qexternal_debugging_output); - Qprint_escape_newlines = intern ("print-escape-newlines"); + Qprint_escape_newlines = intern_c_string ("print-escape-newlines"); staticpro (&Qprint_escape_newlines); - Qprint_escape_multibyte = intern ("print-escape-multibyte"); + Qprint_escape_multibyte = intern_c_string ("print-escape-multibyte"); staticpro (&Qprint_escape_multibyte); - Qprint_escape_nonascii = intern ("print-escape-nonascii"); + Qprint_escape_nonascii = intern_c_string ("print-escape-nonascii"); staticpro (&Qprint_escape_nonascii); print_prune_charset_plist = Qnil;