Skip to content

Commit fd7dee0

Browse files
author
smeyer
committed
tweak messages
git-svn-id: https://svn.r-project.org/R/trunk@87387 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 95a3e63 commit fd7dee0

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/library/tools/R/RdConv2.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,8 @@ prepare2_Rd <- function(Rd, Rdfile, stages)
537537
if (length(enc)) {
538538
encoding <- Rd[[enc[1L]]]
539539
if (!identical(RdTags(encoding), "TEXT"))
540-
stopRd(encoding, Rdfile, "'encoding' must be plain text")
540+
stopRd(encoding, Rdfile,
541+
"\\encoding must be plain text on a line by itself")
541542
}
542543

543544
dt <- which(sections == "\\docType")
@@ -1124,8 +1125,8 @@ checkRd <- function(Rd, defines = .Platform$OS.type, stages = "render",
11241125
if (any(sections == "\\encoding")) def_enc <- TRUE
11251126
inEnc2 <- FALSE
11261127
for (i in seq_along(sections)) {
1127-
sectiontag <- sections[i]
1128-
checkSection(Rd[[i]], sections[i])
1128+
sectiontag <- sections[i] # also used in checkLIST()
1129+
checkSection(Rd[[i]], sectiontag)
11291130
}
11301131

11311132
structure(.messages, class = "checkRd")

src/library/tools/R/parseRd.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ parse_Rd <- function(file, srcfile = NULL, encoding = "unknown",
5151
## keep first one
5252
enc <- enc[1L]
5353
enc <- sub("^[[:space:]]*\\\\encoding\\{([^}]*)\\}.*", "\\1", enc)
54-
if(verbose) message("found encoding ", enc, domain = NA)
54+
if(verbose) message("found encoding ", sQuote(enc), domain = NA)
5555
encoding <- if(enc %in% c("UTF-8", "utf-8", "utf8")) "UTF-8" else enc
5656
}
5757
if (length(encoding) != 1L || encoding == "unknown") encoding <- ""

0 commit comments

Comments
 (0)