Commit 38940e93 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(print_escape_nonascii): New variable.

(print) <Lisp_String>: Use it to force printing single-byte
non-ASCII characters as octal escapes.
(syms_of_print): Define print-escape-nonascii.
parent 29b7163f
......@@ -130,6 +130,11 @@ int print_escape_newlines;
Lisp_Object Qprint_escape_newlines;
/* Nonzero means to print single-byte non-ascii characters in strings as
octal escapes. */
int print_escape_nonascii;
/* Nonzero means print (quote foo) forms as 'foo, etc. */
int print_quoted;
......@@ -1248,9 +1253,10 @@ print (obj, printcharfun, escapeflag)
}
else if (SINGLE_BYTE_CHAR_P (c)
&& ! ASCII_BYTE_P (c)
&& ! NILP (current_buffer->enable_multibyte_characters))
&& (! NILP (current_buffer->enable_multibyte_characters)
|| print_escape_nonascii))
{
/* When multibyte is enabled,
/* When multibyte is enabled or when explicitly requested,
print single-byte non-ASCII string chars
using octal escapes. */
unsigned char outbuf[5];
......@@ -1807,6 +1813,12 @@ A value of nil means no limit.");
Also print formfeeds as backslash-f.");
print_escape_newlines = 0;
DEFVAR_BOOL ("print-escape-nonascii", &print_escape_nonascii,
"Non-nil means print non-ASCII characters in strings as backslash-NNN.\n\
NNN is the octal representation of the character's value.\n\
Only single-byte characters are affected.");
print_escape_nonascii = 0;
DEFVAR_BOOL ("print-quoted", &print_quoted,
"Non-nil means print quoted forms with reader syntax.\n\
I.e., (quote foo) prints as 'foo, (function foo) as #'foo, and, backquoted\n\
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment