aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/io_lib_pretty.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2013-02-01 12:24:22 +0100
committerHans Bolinder <[email protected]>2013-02-15 12:21:44 +0100
commit07c086c1b9ea74996f20339d42ca91c3411966f5 (patch)
tree0380f6ae63b5f059498b69b4b85398ba0438c14e /lib/stdlib/src/io_lib_pretty.erl
parent675b8108486919739dc2e213587489c0daab80cb (diff)
downloadotp-07c086c1b9ea74996f20339d42ca91c3411966f5.tar.gz
otp-07c086c1b9ea74996f20339d42ca91c3411966f5.tar.bz2
otp-07c086c1b9ea74996f20339d42ca91c3411966f5.zip
[stdlib] Add new SDTLIB application variable 'shell_strings'
Use the new function shell:strings/1 to toggle how the Erlang shell outputs lists of integers.
Diffstat (limited to 'lib/stdlib/src/io_lib_pretty.erl')
-rw-r--r--lib/stdlib/src/io_lib_pretty.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/stdlib/src/io_lib_pretty.erl b/lib/stdlib/src/io_lib_pretty.erl
index c7d2ad97c7..525b534249 100644
--- a/lib/stdlib/src/io_lib_pretty.erl
+++ b/lib/stdlib/src/io_lib_pretty.erl
@@ -56,7 +56,7 @@ print(Term) ->
| {depth, depth()}
| {max_chars, max_chars()}
| {record_print_fun, rec_print_fun()}
- | {strings, io_lib:pretty_lists()}
+ | {strings, boolean()}
| {encoding, latin1 | utf8 | unicode}.
-type options() :: [option()].
@@ -332,7 +332,7 @@ print_length([], _D, _RF, _Enc, _Str) ->
print_length({}, _D, _RF, _Enc, _Str) ->
{"{}", 2};
print_length(List, D, RF, Enc, Str) when is_list(List) ->
- case Str =:= unicode andalso printable_list(List, D, Enc) of
+ case Str andalso printable_list(List, D, Enc) of
true ->
S = write_string(List, Enc),
{S, length(S)};
@@ -364,7 +364,7 @@ print_length(<<_/bitstring>>=Bin, D, _RF, Enc, Str) ->
case bit_size(Bin) rem 8 of
0 ->
D1 = D - 1,
- case Str =:= unicode andalso printable_bin(Bin, D1, Enc) of
+ case Str andalso printable_bin(Bin, D1, Enc) of
{true, List} when is_list(List) ->
S = io_lib:write_string(List, $"), %"
{[$<,$<,S,$>,$>], 4 + length(S)};