aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorPaul Eggert2015-05-31 20:04:05 -0700
committerPaul Eggert2015-05-31 20:04:43 -0700
commit467af178f53798e4cd102e04eb2990121eb655df (patch)
tree1e6e2cec1eb87963ae796289ef9a1afdd060a668 /doc
parent21d13bce38c2160bf21b3428cd8e56daadcf4698 (diff)
downloademacs-467af178f53798e4cd102e04eb2990121eb655df.tar.gz
emacs-467af178f53798e4cd102e04eb2990121eb655df.zip
Treat batch stdout/stderr like standard display
Calls like (print FOO) could generate improperly encoded or hard-to-read output if FOO contains characters outside the system locale. Fix this by treating batch stdout and stderr like interactive standard display, when it comes to transliterating and encoding characters (Bug#20545). * doc/emacs/mule.texi (Communication Coding): * doc/lispref/display.texi (Active Display Table): * doc/lispref/nonascii.texi (Locales): * etc/NEWS: * src/coding.c (syms_of_coding): * src/dispnew.c (syms_of_display): Document this. * src/print.c: Include disptab.h. (printchar_to_stream): New function, with much of the guts of the old Fexternal_debugging_output, except this one also uses the standard display table. (printchar, strout, Fexternal_debugging_output): Use it.
Diffstat (limited to 'doc')
-rw-r--r--doc/emacs/mule.texi4
-rw-r--r--doc/lispref/display.texi5
-rw-r--r--doc/lispref/nonascii.texi1
3 files changed, 7 insertions, 3 deletions
diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi
index 7336fdc8f47..80b1384feb6 100644
--- a/doc/emacs/mule.texi
+++ b/doc/emacs/mule.texi
@@ -1164,7 +1164,9 @@ current language environment.
1164to use when encoding and decoding system strings such as system error 1164to use when encoding and decoding system strings such as system error
1165messages and @code{format-time-string} formats and time stamps. That 1165messages and @code{format-time-string} formats and time stamps. That
1166coding system is also used for decoding non-@acronym{ASCII} keyboard 1166coding system is also used for decoding non-@acronym{ASCII} keyboard
1167input on the X Window System. You should choose a coding system that is compatible 1167input on the X Window System and for encoding text sent to the
1168standard output and error streams when in batch mode. You should
1169choose a coding system that is compatible
1168with the underlying system's text representation, which is normally 1170with the underlying system's text representation, which is normally
1169specified by one of the environment variables @env{LC_ALL}, 1171specified by one of the environment variables @env{LC_ALL},
1170@env{LC_CTYPE}, and @env{LANG}. (The first one, in the order 1172@env{LC_CTYPE}, and @env{LANG}. (The first one, in the order
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index b12995be6ed..357a3c33fa3 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -6522,8 +6522,9 @@ no buffer display table.
6522@defvar standard-display-table 6522@defvar standard-display-table
6523The value of this variable is the standard display table, which is 6523The value of this variable is the standard display table, which is
6524used when Emacs is displaying a buffer in a window with neither a 6524used when Emacs is displaying a buffer in a window with neither a
6525window display table nor a buffer display table defined. Its default 6525window display table nor a buffer display table defined, or when Emacs
6526is @code{nil}. 6526is outputting text to the standard output or error streams. Its
6527default is @code{nil}.
6527@end defvar 6528@end defvar
6528 6529
6529The @file{disp-table} library defines several functions for changing 6530The @file{disp-table} library defines several functions for changing
diff --git a/doc/lispref/nonascii.texi b/doc/lispref/nonascii.texi
index f16018417de..362c3a4dcbb 100644
--- a/doc/lispref/nonascii.texi
+++ b/doc/lispref/nonascii.texi
@@ -1959,6 +1959,7 @@ how Emacs interacts with these features.
1959@cindex keyboard input decoding on X 1959@cindex keyboard input decoding on X
1960This variable specifies the coding system to use for decoding system 1960This variable specifies the coding system to use for decoding system
1961error messages and---on X Window system only---keyboard input, for 1961error messages and---on X Window system only---keyboard input, for
1962sending batch output to the standard output and error streams, for
1962encoding the format argument to @code{format-time-string}, and for 1963encoding the format argument to @code{format-time-string}, and for
1963decoding the return value of @code{format-time-string}. 1964decoding the return value of @code{format-time-string}.
1964@end defvar 1965@end defvar