aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/print.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/print.c b/src/print.c
index b17ec337f70..b6ee89478c7 100644
--- a/src/print.c
+++ b/src/print.c
@@ -469,18 +469,18 @@ strout (const char *ptr, ptrdiff_t size, ptrdiff_t size_byte,
469 because printing one char can relocate. */ 469 because printing one char can relocate. */
470 470
471static void 471static void
472print_string (Lisp_Object string, Lisp_Object printcharfun) 472print_string_1 (Lisp_Object string, Lisp_Object printcharfun, bool escape_nonascii)
473{ 473{
474 if (EQ (printcharfun, Qt) || NILP (printcharfun)) 474 if (EQ (printcharfun, Qt) || NILP (printcharfun))
475 { 475 {
476 ptrdiff_t chars; 476 ptrdiff_t chars;
477 477
478 if (print_escape_nonascii) 478 if (escape_nonascii)
479 string = string_escape_byte8 (string); 479 string = string_escape_byte8 (string);
480 480
481 if (STRING_MULTIBYTE (string)) 481 if (STRING_MULTIBYTE (string))
482 chars = SCHARS (string); 482 chars = SCHARS (string);
483 else if (! print_escape_nonascii 483 else if (! escape_nonascii
484 && (EQ (printcharfun, Qt) 484 && (EQ (printcharfun, Qt)
485 ? ! NILP (BVAR (&buffer_defaults, enable_multibyte_characters)) 485 ? ! NILP (BVAR (&buffer_defaults, enable_multibyte_characters))
486 : ! NILP (BVAR (current_buffer, enable_multibyte_characters)))) 486 : ! NILP (BVAR (current_buffer, enable_multibyte_characters))))
@@ -543,6 +543,12 @@ print_string (Lisp_Object string, Lisp_Object printcharfun)
543 } 543 }
544 } 544 }
545} 545}
546
547static void
548print_string (Lisp_Object string, Lisp_Object printcharfun)
549{
550 print_string_1 (string, printcharfun, print_escape_nonascii);
551}
546 552
547DEFUN ("write-char", Fwrite_char, Swrite_char, 1, 2, 0, 553DEFUN ("write-char", Fwrite_char, Swrite_char, 1, 2, 0,
548 doc: /* Output character CHARACTER to stream PRINTCHARFUN. 554 doc: /* Output character CHARACTER to stream PRINTCHARFUN.
@@ -2282,7 +2288,7 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag)
2282 } 2288 }
2283 else if (STRINGP (num)) 2289 else if (STRINGP (num))
2284 { 2290 {
2285 strout (SSDATA (num), SCHARS (num), SBYTES (num), printcharfun); 2291 print_string_1 (num, printcharfun, false);
2286 goto next_obj; 2292 goto next_obj;
2287 } 2293 }
2288 } 2294 }