24 |
#include <stdio.h> |
#include <stdio.h> |
25 |
#include "lisp.h" |
#include "lisp.h" |
26 |
#include "buffer.h" |
#include "buffer.h" |
27 |
#include "charset.h" |
#include "character.h" |
28 |
#include "keyboard.h" |
#include "keyboard.h" |
29 |
#include "frame.h" |
#include "frame.h" |
30 |
#include "window.h" |
#include "window.h" |
460 |
{ |
{ |
461 |
int chars; |
int chars; |
462 |
|
|
463 |
|
if (print_escape_nonascii) |
464 |
|
string = string_escape_byte8 (string); |
465 |
|
|
466 |
if (STRING_MULTIBYTE (string)) |
if (STRING_MULTIBYTE (string)) |
467 |
chars = XSTRING (string)->size; |
chars = XSTRING (string)->size; |
468 |
else if (EQ (printcharfun, Qt) |
else if (! print_escape_nonascii |
469 |
? ! NILP (buffer_defaults.enable_multibyte_characters) |
&& (EQ (printcharfun, Qt) |
470 |
: ! NILP (current_buffer->enable_multibyte_characters)) |
? ! NILP (buffer_defaults.enable_multibyte_characters) |
471 |
|
: ! NILP (current_buffer->enable_multibyte_characters))) |
472 |
{ |
{ |
473 |
/* If unibyte string STRING contains 8-bit codes, we must |
/* If unibyte string STRING contains 8-bit codes, we must |
474 |
convert STRING to a multibyte string containing the same |
convert STRING to a multibyte string containing the same |
1413 |
{ |
{ |
1414 |
c = STRING_CHAR_AND_LENGTH (str + i_byte, |
c = STRING_CHAR_AND_LENGTH (str + i_byte, |
1415 |
size_byte - i_byte, len); |
size_byte - i_byte, len); |
1416 |
if (CHAR_VALID_P (c, 0)) |
i_byte += len; |
|
i_byte += len; |
|
|
else |
|
|
c = str[i_byte++]; |
|
1417 |
} |
} |
1418 |
else |
else |
1419 |
c = str[i_byte++]; |
c = str[i_byte++]; |
1431 |
PRINTCHAR ('f'); |
PRINTCHAR ('f'); |
1432 |
} |
} |
1433 |
else if (multibyte && ! ASCII_BYTE_P (c) |
else if (multibyte && ! ASCII_BYTE_P (c) |
1434 |
&& print_escape_multibyte) |
&& (print_escape_multibyte || CHAR_BYTE8_P (c))) |
1435 |
{ |
{ |
1436 |
/* When multibyte is disabled, |
/* When multibyte is disabled, |
1437 |
print multibyte string chars using hex escapes. */ |
print multibyte string chars using hex escapes. */ |
1438 |
unsigned char outbuf[50]; |
unsigned char outbuf[50]; |
1439 |
sprintf (outbuf, "\\x%x", c); |
|
1440 |
|
if (CHAR_BYTE8_P (c)) |
1441 |
|
sprintf (outbuf, "\\%03o", CHAR_TO_BYTE8 (c)); |
1442 |
|
else |
1443 |
|
sprintf (outbuf, "\\x%04x", c); |
1444 |
strout (outbuf, -1, -1, printcharfun, 0); |
strout (outbuf, -1, -1, printcharfun, 0); |
1445 |
need_nonhex = 1; |
need_nonhex = 1; |
1446 |
} |
} |
1792 |
PRINTCHAR ('#'); |
PRINTCHAR ('#'); |
1793 |
size &= PSEUDOVECTOR_SIZE_MASK; |
size &= PSEUDOVECTOR_SIZE_MASK; |
1794 |
} |
} |
1795 |
if (CHAR_TABLE_P (obj)) |
if (CHAR_TABLE_P (obj) || SUB_CHAR_TABLE_P (obj)) |
1796 |
{ |
{ |
1797 |
/* We print a char-table as if it were a vector, |
/* We print a char-table as if it were a vector, |
1798 |
lumping the parent and default slots in with the |
lumping the parent and default slots in with the |