diff options
author | Hans Bolinder <[email protected]> | 2015-11-27 09:18:19 +0100 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2015-11-27 09:18:19 +0100 |
commit | 29f453a3b2af49cd8f2052959262fc3be8971c46 (patch) | |
tree | 89142ee26207adf830df3540a88536c1c68f5ead /lib | |
parent | cb971e3026082188be7f394ebf29603d5bd08118 (diff) | |
parent | a838b671ef9cc7582f0768778a0447df614b71dd (diff) | |
download | otp-29f453a3b2af49cd8f2052959262fc3be8971c46.tar.gz otp-29f453a3b2af49cd8f2052959262fc3be8971c46.tar.bz2 otp-29f453a3b2af49cd8f2052959262fc3be8971c46.zip |
Merge branch 'maint'
* maint:
stdlib: Fix the shell command rp and pretty-printing
Diffstat (limited to 'lib')
-rw-r--r-- | lib/stdlib/src/shell.erl | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/lib/stdlib/src/shell.erl b/lib/stdlib/src/shell.erl index f215a66812..ce1d9eb0ff 100644 --- a/lib/stdlib/src/shell.erl +++ b/lib/stdlib/src/shell.erl @@ -999,12 +999,7 @@ local_func(rl, [A], Bs0, _Shell, RT, Lf, Ef) -> {value,list_records(record_defs(RT, listify(Recs))),Bs}; local_func(rp, [A], Bs0, _Shell, RT, Lf, Ef) -> {[V],Bs} = expr_list([A], Bs0, Lf, Ef), - Cs = io_lib_pretty:print(V, ([{column, 1}, - {line_length, columns()}, - {depth, -1}, - {max_chars, ?CHAR_MAX}, - {record_print_fun, record_print_fun(RT)}] - ++ enc())), + Cs = pp(V, _Column=1, _Depth=-1, RT), io:requests([{put_chars, unicode, Cs}, nl]), {value,ok,Bs}; local_func(rr, [A], Bs0, _Shell, RT, Lf, Ef) -> @@ -1397,9 +1392,9 @@ get_history_and_results() -> {History, erlang:min(Results, History)}. pp(V, I, RT) -> - pp(V, I, RT, enc()). + pp(V, I, _Depth=?LINEMAX, RT). -pp(V, I, RT, Enc) -> +pp(V, I, D, RT) -> Strings = case application:get_env(stdlib, shell_strings) of {ok, false} -> @@ -1408,10 +1403,10 @@ pp(V, I, RT, Enc) -> true end, io_lib_pretty:print(V, ([{column, I}, {line_length, columns()}, - {depth, ?LINEMAX}, {max_chars, ?CHAR_MAX}, + {depth, D}, {max_chars, ?CHAR_MAX}, {strings, Strings}, {record_print_fun, record_print_fun(RT)}] - ++ Enc)). + ++ enc())). columns() -> case io:columns() of |