diff options
| author | Paul Eggert | 2015-05-31 20:04:05 -0700 |
|---|---|---|
| committer | Paul Eggert | 2015-05-31 20:04:43 -0700 |
| commit | 467af178f53798e4cd102e04eb2990121eb655df (patch) | |
| tree | 1e6e2cec1eb87963ae796289ef9a1afdd060a668 /doc | |
| parent | 21d13bce38c2160bf21b3428cd8e56daadcf4698 (diff) | |
| download | emacs-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.texi | 4 | ||||
| -rw-r--r-- | doc/lispref/display.texi | 5 | ||||
| -rw-r--r-- | doc/lispref/nonascii.texi | 1 |
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. | |||
| 1164 | to use when encoding and decoding system strings such as system error | 1164 | to use when encoding and decoding system strings such as system error |
| 1165 | messages and @code{format-time-string} formats and time stamps. That | 1165 | messages and @code{format-time-string} formats and time stamps. That |
| 1166 | coding system is also used for decoding non-@acronym{ASCII} keyboard | 1166 | coding system is also used for decoding non-@acronym{ASCII} keyboard |
| 1167 | input on the X Window System. You should choose a coding system that is compatible | 1167 | input on the X Window System and for encoding text sent to the |
| 1168 | standard output and error streams when in batch mode. You should | ||
| 1169 | choose a coding system that is compatible | ||
| 1168 | with the underlying system's text representation, which is normally | 1170 | with the underlying system's text representation, which is normally |
| 1169 | specified by one of the environment variables @env{LC_ALL}, | 1171 | specified 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 |
| 6523 | The value of this variable is the standard display table, which is | 6523 | The value of this variable is the standard display table, which is |
| 6524 | used when Emacs is displaying a buffer in a window with neither a | 6524 | used when Emacs is displaying a buffer in a window with neither a |
| 6525 | window display table nor a buffer display table defined. Its default | 6525 | window display table nor a buffer display table defined, or when Emacs |
| 6526 | is @code{nil}. | 6526 | is outputting text to the standard output or error streams. Its |
| 6527 | default is @code{nil}. | ||
| 6527 | @end defvar | 6528 | @end defvar |
| 6528 | 6529 | ||
| 6529 | The @file{disp-table} library defines several functions for changing | 6530 | The @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 |
| 1960 | This variable specifies the coding system to use for decoding system | 1960 | This variable specifies the coding system to use for decoding system |
| 1961 | error messages and---on X Window system only---keyboard input, for | 1961 | error messages and---on X Window system only---keyboard input, for |
| 1962 | sending batch output to the standard output and error streams, for | ||
| 1962 | encoding the format argument to @code{format-time-string}, and for | 1963 | encoding the format argument to @code{format-time-string}, and for |
| 1963 | decoding the return value of @code{format-time-string}. | 1964 | decoding the return value of @code{format-time-string}. |
| 1964 | @end defvar | 1965 | @end defvar |