Skip to content

Commit 839f8c9

Browse files
committed
Merge pull request #15708 from JuliaLang/jb/istext
fix #12872, rename `istext` to `istextmime`
2 parents 47c29a9 + 861be19 commit 839f8c9

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

base/deprecated.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,3 +1002,6 @@ export call
10021002

10031003
# 1933
10041004
@deprecate_binding SingleAsyncWork AsyncCondition
1005+
1006+
# #12872
1007+
@deprecate istext istextmime

base/docs/helpdb/Base.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8135,7 +8135,7 @@ Returns an `AbstractString` or `Vector{UInt8}` containing the representation of
81358135
requested `mime` type, as written by `writemime` (throwing a `MethodError` if no appropriate
81368136
`writemime` is available). An `AbstractString` is returned for MIME types with textual
81378137
representations (such as `"text/html"` or `"application/postscript"`), whereas binary data
8138-
is returned as `Vector{UInt8}`. (The function `istext(mime)` returns whether or not Julia
8138+
is returned as `Vector{UInt8}`. (The function `istextmime(mime)` returns whether or not Julia
81398139
treats a given `mime` type as text.)
81408140
81418141
As a special case, if `x` is an `AbstractString` (for textual MIME types) or a
@@ -10095,11 +10095,11 @@ processes completed successfully.
1009510095
exit
1009610096

1009710097
"""
10098-
istext(m::MIME)
10098+
istextmime(m::MIME)
1009910099
1010010100
Determine whether a MIME type is text data.
1010110101
"""
10102-
istext
10102+
istextmime
1010310103

1010410104
"""
1010510105
merge!(collection, others...)

base/exports.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1239,7 +1239,7 @@ export
12391239
display,
12401240
displayable,
12411241
TextDisplay,
1242-
istext,
1242+
istextmime,
12431243
MIME,
12441244
@MIME,
12451245
@MIME_str,

base/multimedia.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
module Multimedia
44

55
export Display, display, pushdisplay, popdisplay, displayable, redisplay,
6-
MIME, @MIME, @MIME_str, writemime, reprmime, stringmime, istext,
6+
MIME, @MIME, @MIME_str, writemime, reprmime, stringmime, istextmime,
77
mimewritable, TextDisplay
88

99
###########################################################################
@@ -45,7 +45,7 @@ mimewritable(m::AbstractString, x) = mimewritable(MIME(m), x)
4545

4646
###########################################################################
4747
# MIME types are assumed to be binary data except for a set of types known
48-
# to be text data (possibly Unicode). istext(m) returns whether
48+
# to be text data (possibly Unicode). istextmime(m) returns whether
4949
# m::MIME is text data, and reprmime(m, x) returns x written to either
5050
# a string (for text m::MIME) or a Vector{UInt8} (for binary m::MIME),
5151
# assuming the corresponding write_mime method exists. stringmime
@@ -65,7 +65,7 @@ macro textmime(mime)
6565
Base.Multimedia.reprmime(m::mimeT, x::Vector{UInt8}) = sprint(writemime, m, x)
6666
Base.Multimedia.stringmime(m::mimeT, x::Vector{UInt8}) = reprmime(m, x)
6767

68-
Base.Multimedia.istext(::mimeT) = true
68+
Base.Multimedia.istextmime(::mimeT) = true
6969
if $(mime != "text/plain") # strings are shown escaped for text/plain
7070
Base.Multimedia.reprmime(m::mimeT, x::AbstractString) = x
7171
end
@@ -74,7 +74,7 @@ macro textmime(mime)
7474
end
7575
end
7676

77-
istext(::MIME) = false
77+
istextmime(::MIME) = false
7878
function reprmime(m::MIME, x)
7979
s = IOBuffer()
8080
writemime(s, m, x)
@@ -85,7 +85,7 @@ stringmime(m::MIME, x) = base64encode(writemime, m, x)
8585
stringmime(m::MIME, x::Vector{UInt8}) = base64encode(write, x)
8686

8787
# it is convenient to accept strings instead of ::MIME
88-
istext(m::AbstractString) = istext(MIME(m))
88+
istextmime(m::AbstractString) = istextmime(MIME(m))
8989
reprmime(m::AbstractString, x) = reprmime(MIME(m), x)
9090
stringmime(m::AbstractString, x) = stringmime(MIME(m), x)
9191

0 commit comments

Comments
 (0)