diff --git a/docs/src/ring_interface.md b/docs/src/ring_interface.md index da5bdd32c4..236c8ba288 100644 --- a/docs/src/ring_interface.md +++ b/docs/src/ring_interface.md @@ -846,8 +846,13 @@ canonical_unit(f::ConstPoly) = canonical_unit(f.c) # String I/O function show(io::IO, R::ConstPolyRing) - print(io, "Constant polynomials over ") - show(io, base_ring(R)) + @show_name(io, R) + @show_special(io, R) + print(io, "Constant polynomials") + if !is_terse(io) + io = pretty(io) + print(terse(io), "over", Lowercase(), base_ring(p)) + end end function show(io::IO, f::ConstPoly) diff --git a/src/MatRing.jl b/src/MatRing.jl index 7791420a0b..beb8ed9e8b 100644 --- a/src/MatRing.jl +++ b/src/MatRing.jl @@ -164,6 +164,8 @@ function show(io::IO, mime::MIME"text/plain", a::MatRing) end function show(io::IO, a::MatRing) + @show_name(io, a) + @show_special(io, a) if is_terse(io) print(io, "Matrix ring") else diff --git a/src/Matrix.jl b/src/Matrix.jl index 027ccfd0e4..279a49804e 100644 --- a/src/Matrix.jl +++ b/src/Matrix.jl @@ -791,6 +791,8 @@ function show(io::IO, ::MIME"text/plain", a::MatSpace) end function show(io::IO, a::MatSpace) + @show_name(io, a) + @show_special(io, a) if is_terse(io) print(io, "Matrix space") else diff --git a/test/PrettyPrinting-test.jl b/test/PrettyPrinting-test.jl index 597caef144..6befdbf120 100644 --- a/test/PrettyPrinting-test.jl +++ b/test/PrettyPrinting-test.jl @@ -342,6 +342,8 @@ end end function Base.show(io::IO, R::NewRing) + @show_name(io, R) + @show_special(io, R) if PrettyPrinting.is_terse(io) # no nested printing print(io, "terse printing of newring ") diff --git a/test/algorithms/GenericFunctions-test.jl b/test/algorithms/GenericFunctions-test.jl index 6b4db98da4..be9452a036 100644 --- a/test/algorithms/GenericFunctions-test.jl +++ b/test/algorithms/GenericFunctions-test.jl @@ -116,8 +116,13 @@ canonical_unit(f::ConstPoly) = canonical_unit(f.c) # String I/O function show(io::IO, R::ConstPolyRing) - print(io, "Constant polynomials over ") - show(io, base_ring(R)) + @show_name(io, R) + @show_special(io, R) + print(io, "Constant polynomials") + if !is_terse(io) + io = pretty(io) + print(terse(io), "over", Lowercase(), base_ring(p)) + end end function show(io::IO, f::ConstPoly)