This does call show(io, A), but note that print calls the two-argument show function. You typically define the 3-argument show in addition to the 2-argument show, if you want a more verbose multi-line pretty-printing in addition to compact output (for use in e.g. REPL output via display), as explained in the manual on Custom pretty printing.
I’m not sure what you mean — you can still add indentation metadata to IOContext in the same way:
Base.show(io::IO, ::MIME"text/plain", a::A) = print(io, ' '^get(io, :indent, 0), ">>A$(a.x)")
function Base.show(io::IO, mime::MIME"text/plain", b::B)
indent = get(io, :indent, 0)
println(io, ' '^indent, "B containing:")
show(IOContext(io, :indent => indent+4), mime, b.x)
end
which gives
julia> B(A(1))
B containing:
>>A1