aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman2001-12-30 03:22:55 +0000
committerRichard M. Stallman2001-12-30 03:22:55 +0000
commitdb300f594401cebc32b18e2e9a04d0ed93747340 (patch)
treec4151c8e80b0b93f15e60fee09628091bda9f80a /src
parent14be1bc20240c3039bf6823d4e93ad71ebe12996 (diff)
downloademacs-db300f594401cebc32b18e2e9a04d0ed93747340.tar.gz
emacs-db300f594401cebc32b18e2e9a04d0ed93747340.zip
(print_object): In multibyte string, use hex escapes.
Use octal only for unibyte strings. (PRINTPREPARE): Don't ever set Qprint_escape_nonascii.
Diffstat (limited to 'src')
-rw-r--r--src/print.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/print.c b/src/print.c
index 2ad010a6232..9fe8bc30c1c 100644
--- a/src/print.c
+++ b/src/print.c
@@ -226,9 +226,6 @@ void print_interval ();
226 if (NILP (current_buffer->enable_multibyte_characters) \ 226 if (NILP (current_buffer->enable_multibyte_characters) \
227 && ! print_escape_multibyte) \ 227 && ! print_escape_multibyte) \
228 specbind (Qprint_escape_multibyte, Qt); \ 228 specbind (Qprint_escape_multibyte, Qt); \
229 if (! NILP (current_buffer->enable_multibyte_characters) \
230 && ! print_escape_nonascii) \
231 specbind (Qprint_escape_nonascii, Qt); \
232 if (print_buffer != 0) \ 229 if (print_buffer != 0) \
233 { \ 230 { \
234 string = make_string_from_bytes (print_buffer, \ 231 string = make_string_from_bytes (print_buffer, \
@@ -1384,6 +1381,7 @@ print_object (obj, printcharfun, escapeflag)
1384 /* 1 means we must ensure that the next character we output 1381 /* 1 means we must ensure that the next character we output
1385 cannot be taken as part of a hex character escape. */ 1382 cannot be taken as part of a hex character escape. */
1386 int need_nonhex = 0; 1383 int need_nonhex = 0;
1384 int multibyte = STRING_MULTIBYTE (obj);
1387 1385
1388 GCPRO1 (obj); 1386 GCPRO1 (obj);
1389 1387
@@ -1404,7 +1402,7 @@ print_object (obj, printcharfun, escapeflag)
1404 int len; 1402 int len;
1405 int c; 1403 int c;
1406 1404
1407 if (STRING_MULTIBYTE (obj)) 1405 if (multibyte)
1408 { 1406 {
1409 c = STRING_CHAR_AND_LENGTH (str + i_byte, 1407 c = STRING_CHAR_AND_LENGTH (str + i_byte,
1410 size_byte - i_byte, len); 1408 size_byte - i_byte, len);
@@ -1428,7 +1426,8 @@ print_object (obj, printcharfun, escapeflag)
1428 PRINTCHAR ('\\'); 1426 PRINTCHAR ('\\');
1429 PRINTCHAR ('f'); 1427 PRINTCHAR ('f');
1430 } 1428 }
1431 else if (! SINGLE_BYTE_CHAR_P (c) && print_escape_multibyte) 1429 else if (multibyte && ! ASCII_BYTE_P (c)
1430 && (print_escape_multibyte || print_escape_nonascii))
1432 { 1431 {
1433 /* When multibyte is disabled, 1432 /* When multibyte is disabled,
1434 print multibyte string chars using hex escapes. */ 1433 print multibyte string chars using hex escapes. */
@@ -1437,7 +1436,8 @@ print_object (obj, printcharfun, escapeflag)
1437 strout (outbuf, -1, -1, printcharfun, 0); 1436 strout (outbuf, -1, -1, printcharfun, 0);
1438 need_nonhex = 1; 1437 need_nonhex = 1;
1439 } 1438 }
1440 else if (SINGLE_BYTE_CHAR_P (c) && ! ASCII_BYTE_P (c) 1439 else if (! multibyte
1440 && SINGLE_BYTE_CHAR_P (c) && ! ASCII_BYTE_P (c)
1441 && print_escape_nonascii) 1441 && print_escape_nonascii)
1442 { 1442 {
1443 /* When printing in a multibyte buffer 1443 /* When printing in a multibyte buffer