diff --git a/src/AbsMSeries.jl b/src/AbsMSeries.jl index b66807b1f0..6ddd203623 100644 --- a/src/AbsMSeries.jl +++ b/src/AbsMSeries.jl @@ -113,7 +113,10 @@ end @enable_all_show_via_expressify MSeriesElem -function show(io::IO, ::MIME"text/plain", p::MSeriesRing) +function show(io::IO, mime::MIME"text/plain", p::MSeriesRing) + @show_name(io, p) + @show_special(io, mime, p) + max_vars = 5 # largest number of variables to print n = nvars(p) print(io, "Multivariate power series ring") @@ -131,6 +134,8 @@ function show(io::IO, ::MIME"text/plain", p::MSeriesRing) end function show(io::IO, p::MSeriesRing) + @show_name(io, p) + @show_special(io, p) if is_terse(io) print(io, "Multivariate power series ring") else diff --git a/src/Fraction.jl b/src/Fraction.jl index 6f6af4380b..660241bf34 100644 --- a/src/Fraction.jl +++ b/src/Fraction.jl @@ -131,7 +131,10 @@ end @enable_all_show_via_expressify FracElem -function show(io::IO, ::MIME"text/plain", a::FracField) +function show(io::IO, mime::MIME"text/plain", a::FracField) + @show_name(io, a) + @show_special(io, mime, a) + println(io, "Fraction field") io = pretty(io) print(io, Indent(), "of ", Lowercase(), base_ring(a)) @@ -139,6 +142,8 @@ function show(io::IO, ::MIME"text/plain", a::FracField) end function show(io::IO, a::FracField) + @show_name(io, a) + @show_special(io, a) if is_terse(io) print(io, "Fraction field") else diff --git a/src/FreeAssAlgebra.jl b/src/FreeAssAlgebra.jl index 57cfa2f9b0..c62165768d 100644 --- a/src/FreeAssAlgebra.jl +++ b/src/FreeAssAlgebra.jl @@ -59,7 +59,10 @@ end @enable_all_show_via_expressify FreeAssAlgElem -function show(io::IO, ::MIME"text/plain", a::FreeAssAlgebra) +function show(io::IO, mime::MIME"text/plain", a::FreeAssAlgebra) + @show_name(io, a) + @show_special(io, mime, a) + max_vars = 5 # largest number of variables to print n = nvars(a) print(io, "Free associative algebra") @@ -77,6 +80,8 @@ function show(io::IO, ::MIME"text/plain", a::FreeAssAlgebra) end function show(io::IO, a::FreeAssAlgebra) + @show_name(io, a) + @show_special(io, a) if is_terse(io) print(io, "Free associative algebra") else diff --git a/src/LaurentMPoly.jl b/src/LaurentMPoly.jl index 0bebd23f4e..125fe84d46 100644 --- a/src/LaurentMPoly.jl +++ b/src/LaurentMPoly.jl @@ -32,7 +32,10 @@ end @enable_all_show_via_expressify LaurentMPolyRingElem -function show(io::IO, ::MIME"text/plain", p::LaurentMPolyRing) +function show(io::IO, mime::MIME"text/plain", p::LaurentMPolyRing) + @show_name(io, p) + @show_special(io, mime, p) + max_vars = 5 # largest number of variables to print n = nvars(p) print(io, "Multivariate Laurent polynomial ring") @@ -50,6 +53,8 @@ function show(io::IO, ::MIME"text/plain", p::LaurentMPolyRing) end function show(io::IO, p::LaurentMPolyRing) + @show_name(io, p) + @show_special(io, p) if is_terse(io) print(io, "Multivariate Laurent polynomial ring") else diff --git a/src/MPoly.jl b/src/MPoly.jl index 14e8f12b64..e65188f6f0 100644 --- a/src/MPoly.jl +++ b/src/MPoly.jl @@ -559,7 +559,10 @@ end @enable_all_show_via_expressify MPolyRingElem -function show(io::IO, ::MIME"text/plain", p::MPolyRing) +function show(io::IO, mime::MIME"text/plain", p::MPolyRing) + @show_name(io, p) + @show_special(io, mime, p) + max_vars = 5 # largest number of variables to print n = nvars(p) print(io, "Multivariate polynomial ring") @@ -577,6 +580,8 @@ function show(io::IO, ::MIME"text/plain", p::MPolyRing) end function show(io::IO, p::MPolyRing) + @show_name(io, p) + @show_special(io, p) if is_terse(io) print(io, "Multivariate polynomial ring") else diff --git a/src/Map.jl b/src/Map.jl index f110a21f26..5c3c9ae596 100644 --- a/src/Map.jl +++ b/src/Map.jl @@ -21,7 +21,7 @@ function check_composable(a::Map, b::Map) codomain(a) !== domain(b) && error("Incompatible maps") end -function Base.show(io::IO, ::MIME"text/plain", M::AbstractAlgebra.Map) +function Base.show(io::IO, mime::MIME"text/plain", M::AbstractAlgebra.Map) # the "header" is identical to the supercompact output; this # allows other map types to reuse this method println(terse(io), M) diff --git a/src/MatRing.jl b/src/MatRing.jl index 937ce8bda4..5f4f915714 100644 --- a/src/MatRing.jl +++ b/src/MatRing.jl @@ -161,7 +161,7 @@ is_square(a::MatRingElem) = true # ############################################################################### -function show(io::IO, ::MIME"text/plain", a::MatRing) +function show(io::IO, mime::MIME"text/plain", a::MatRing) print(io, "Matrix ring of") print(io, " degree ", a.n) println(io) diff --git a/src/NCPoly.jl b/src/NCPoly.jl index 39302ba200..a32c39b7e4 100644 --- a/src/NCPoly.jl +++ b/src/NCPoly.jl @@ -150,6 +150,8 @@ number_of_generators(R::NCPolyRing) = 1 ############################################################################### function show(io::IO, p::NCPolyRing) + @show_name(io, p) + @show_special(io, p) print(io, "Univariate polynomial ring in ", var(p), " over ") print(terse(pretty(io)), Lowercase(), base_ring(p)) end diff --git a/src/Poly.jl b/src/Poly.jl index 52108e3283..8091609798 100644 --- a/src/Poly.jl +++ b/src/Poly.jl @@ -466,6 +466,8 @@ end @enable_all_show_via_expressify Union{PolynomialElem, NCPolyRingElem} function show(io::IO, p::PolyRing) + @show_name(io, p) + @show_special(io, p) if is_terse(io) print(io, "Univariate polynomial ring") else diff --git a/src/RelSeries.jl b/src/RelSeries.jl index b0ec753d82..04040ec704 100644 --- a/src/RelSeries.jl +++ b/src/RelSeries.jl @@ -275,7 +275,10 @@ end @enable_all_show_via_expressify SeriesElem -function show(io::IO, ::MIME"text/plain", a::SeriesRing) +function show(io::IO, mime::MIME"text/plain", a::SeriesRing) + @show_name(io, a) + @show_special(io, mime, a) + print(io, "Univariate power series ring in ", var(a), " with precision ", a.prec_max) println(io) io = pretty(io) @@ -284,6 +287,8 @@ function show(io::IO, ::MIME"text/plain", a::SeriesRing) end function show(io::IO, a::SeriesRing) + @show_name(io, a) + @show_special(io, a) if is_terse(io) print(io, "Univariate power series ring") else diff --git a/src/Residue.jl b/src/Residue.jl index 3c95117783..dac8bc0f4a 100644 --- a/src/Residue.jl +++ b/src/Residue.jl @@ -142,6 +142,8 @@ end @enable_all_show_via_expressify ResElem function show(io::IO, a::ResidueRing) + @show_name(io, a) + @show_special(io, a) if is_terse(io) print(io, "Residue ring") else diff --git a/src/ResidueField.jl b/src/ResidueField.jl index ae798e06e0..e1fdecddba 100644 --- a/src/ResidueField.jl +++ b/src/ResidueField.jl @@ -132,6 +132,8 @@ end @enable_all_show_via_expressify ResFieldElem function show(io::IO, a::ResidueField) + @show_name(io, a) + @show_special(io, a) if is_terse(io) print(io, "Residue field") else diff --git a/src/algorithms/LaurentPoly.jl b/src/algorithms/LaurentPoly.jl index d398be2cd2..f8777beac5 100644 --- a/src/algorithms/LaurentPoly.jl +++ b/src/algorithms/LaurentPoly.jl @@ -203,7 +203,9 @@ canonical_unit(x::LaurentPolyRingElem) = canonical_unit(leading_coefficient(x)) # ############################################################################### -function show(io::IO, ::MIME"text/plain", p::LaurentPolyRing) +function show(io::IO, mime::MIME"text/plain", p::LaurentPolyRing) + @show_name(io, p) + @show_special(io, mime, p) print(io, "Univariate Laurent polynomial ring in ", var(p)) println(io) io = pretty(io) @@ -212,6 +214,8 @@ function show(io::IO, ::MIME"text/plain", p::LaurentPolyRing) end function show(io::IO, p::LaurentPolyRing) + @show_name(io, p) + @show_special(io, p) if is_terse(io) print(io, "Univariate Laurent polynomial ring") else diff --git a/src/generic/DirectSum.jl b/src/generic/DirectSum.jl index 389cf52496..c372280218 100644 --- a/src/generic/DirectSum.jl +++ b/src/generic/DirectSum.jl @@ -44,6 +44,8 @@ summands(M::DirectSumModule{T}) where T <: RingElement = M.m ############################################################################### function show(io::IO, N::DirectSumModule{T}) where T <: RingElement + @show_name(io, N) + @show_special(io, N) if is_terse(io) io = pretty(io) print(io, LowercaseOff(), "DirectSumModule") diff --git a/src/generic/FunctionField.jl b/src/generic/FunctionField.jl index c89a19f78d..2800f74c0f 100644 --- a/src/generic/FunctionField.jl +++ b/src/generic/FunctionField.jl @@ -772,6 +772,8 @@ end @enable_all_show_via_expressify FunctionFieldElem function show(io::IO, R::FunctionField) + @show_name(io, R) + @show_special(io, R) print(terse(pretty(io)), "Function Field over ", Lowercase(), base_ring(base_ring(R)), " with defining polynomial ", numerator(R)) diff --git a/src/generic/InvariantFactorDecomposition.jl b/src/generic/InvariantFactorDecomposition.jl index f06c1b00df..7dc6ad5fdf 100644 --- a/src/generic/InvariantFactorDecomposition.jl +++ b/src/generic/InvariantFactorDecomposition.jl @@ -56,6 +56,8 @@ end ############################################################################### function show(io::IO, N::SNFModule{T}) where T <: RingElement + @show_name(io, N) + @show_special(io, N) print(io, "Invariant factor decomposed module over ") print(terse(pretty(io)), Lowercase(), base_ring(N)) print(io, " with invariant factors ") @@ -63,6 +65,8 @@ function show(io::IO, N::SNFModule{T}) where T <: RingElement end function show(io::IO, N::SNFModule{T}) where T <: FieldElement + @show_name(io, N) + @show_special(io, N) print(io, "Vector space over ") print(terse(pretty(io)), Lowercase(), base_ring(N)) print(io, " with dimension ") diff --git a/src/generic/LaurentSeries.jl b/src/generic/LaurentSeries.jl index 3e46aa67d5..c49ff13853 100644 --- a/src/generic/LaurentSeries.jl +++ b/src/generic/LaurentSeries.jl @@ -517,6 +517,8 @@ function Base.show(io::IO, a::LaurentSeriesElem) end function show(io::IO, p::LaurentSeriesRing) + @show_name(io, p) + @show_special(io, p) if is_terse(io) print(io, "Laurent series ring") else @@ -527,6 +529,8 @@ function show(io::IO, p::LaurentSeriesRing) end function show(io::IO, p::LaurentSeriesField) + @show_name(io, p) + @show_special(io, p) if is_terse(io) print(io, "Laurent series field") else diff --git a/src/generic/Misc/Localization.jl b/src/generic/Misc/Localization.jl index e9c63f1e6f..a0ef7c36ad 100644 --- a/src/generic/Misc/Localization.jl +++ b/src/generic/Misc/Localization.jl @@ -166,6 +166,8 @@ function show(io::IO, a::LocalizedEuclideanRingElem) end function show(io::IO, L::LocalizedEuclideanRing) + @show_name(io, L) + @show_special(io, L) io = pretty(io) if L.comp print(io, "Localization of ", Lowercase(), base_ring(L), " at complement of ", prime(L)) diff --git a/src/generic/PuiseuxSeries.jl b/src/generic/PuiseuxSeries.jl index c7c345bba7..daf27283f0 100644 --- a/src/generic/PuiseuxSeries.jl +++ b/src/generic/PuiseuxSeries.jl @@ -313,6 +313,8 @@ function Base.show(io::IO, a::PuiseuxSeriesElem) end function show(io::IO, p::PuiseuxSeriesRing) + @show_name(io, p) + @show_special(io, p) if is_terse(io) print(io, "Puiseux series ring") else @@ -323,6 +325,8 @@ function show(io::IO, p::PuiseuxSeriesRing) end function show(io::IO, p::PuiseuxSeriesField) + @show_name(io, p) + @show_special(io, p) if is_terse(io) print(io, "Puiseux series field") else diff --git a/src/generic/QuotientModule.jl b/src/generic/QuotientModule.jl index 69a54f219b..e15365c4b3 100644 --- a/src/generic/QuotientModule.jl +++ b/src/generic/QuotientModule.jl @@ -64,12 +64,16 @@ function show_gens_rels(io::IO, N::AbstractAlgebra.FPModule{T}) where T <: RingE end function show(io::IO, N::QuotientModule{T}) where T <: RingElement + @show_name(io, N) + @show_special(io, N) print(io, "Quotient module over ") print(terse(pretty(io)), Lowercase(), base_ring(N)) show_gens_rels(io, N) end function show(io::IO, N::QuotientModule{T}) where T <: FieldElement + @show_name(io, N) + @show_special(io, N) print(io, "Quotient space over ") print(terse(pretty(io)), Lowercase(), base_ring(N)) show_gens_rels(io, N) diff --git a/src/generic/RationalFunctionField.jl b/src/generic/RationalFunctionField.jl index 7012cd8cd4..bb4ac08804 100644 --- a/src/generic/RationalFunctionField.jl +++ b/src/generic/RationalFunctionField.jl @@ -155,6 +155,8 @@ function show(io::IO, ::MIME"text/plain", a::RationalFunctionField) end function show(io::IO, a::RationalFunctionField) + @show_name(io, a) + @show_special(io, a) if is_terse(io) # no nested printing print(io, "Rational function field") diff --git a/src/generic/SparsePoly.jl b/src/generic/SparsePoly.jl index 0bcbc5493f..931d68e425 100644 --- a/src/generic/SparsePoly.jl +++ b/src/generic/SparsePoly.jl @@ -109,6 +109,8 @@ function Base.show(io::IO, a::SparsePoly) end function show(io::IO, p::SparsePolyRing) + @show_name(io, p) + @show_special(io, p) print(io, "Sparse univariate polynomial ring in ") print(io, string(p.S)) print(io, " over ") diff --git a/src/generic/TotalFraction.jl b/src/generic/TotalFraction.jl index 5a0f50b419..59775b8949 100644 --- a/src/generic/TotalFraction.jl +++ b/src/generic/TotalFraction.jl @@ -137,6 +137,8 @@ end @enable_all_show_via_expressify TotFrac function show(io::IO, a::TotFracRing) + @show_name(io, a) + @show_special(io, a) print(io, "Total ring of fractions of ") print(terse(pretty(io)), Lowercase(), base_ring(a)) end diff --git a/src/generic/UnivPoly.jl b/src/generic/UnivPoly.jl index 237253edae..267b8f3143 100644 --- a/src/generic/UnivPoly.jl +++ b/src/generic/UnivPoly.jl @@ -334,6 +334,8 @@ end ############################################################################### function show(io::IO, R::UniversalPolyRing) + @show_name(io, R) + @show_special(io, R) print(io, "Universal Polynomial Ring over ") show(io, base_ring(R)) end diff --git a/src/generic/imports.jl b/src/generic/imports.jl index 44c0f05a0c..a4f68e7ca5 100644 --- a/src/generic/imports.jl +++ b/src/generic/imports.jl @@ -73,6 +73,8 @@ using ..AbstractAlgebra import ..AbstractAlgebra: @attributes import ..AbstractAlgebra: @enable_all_show_via_expressify +import ..AbstractAlgebra: @show_name +import ..AbstractAlgebra: @show_special import ..AbstractAlgebra: CacheDictType import ..AbstractAlgebra: CycleDec import ..AbstractAlgebra: Dedent diff --git a/src/julia/GF.jl b/src/julia/GF.jl index 6ff71a1ded..1531244bb2 100644 --- a/src/julia/GF.jl +++ b/src/julia/GF.jl @@ -132,6 +132,8 @@ function show(io::IO, x::GFElem) end function show(io::IO, R::GFField) + @show_name(io, R) + @show_special(io, R) print(io, "Finite field F_", R.p) end