diff --git a/R/rd-family.R b/R/rd-family.R index 3b93013a..df036544 100644 --- a/R/rd-family.R +++ b/R/rd-family.R @@ -51,12 +51,15 @@ topics_process_family <- function(topics, env) { if (length(others) < 1) next - by_file <- map_chr(aliases[others], function(x) { + other_aliases <- aliases[others] + other_aliases_order <- map_chr(other_aliases, function(x) escape(x[1])) + + by_file <- map_chr(other_aliases[order_c(other_aliases_order)], function(x) { obj <- find_object(x[1], env) suffix <- if (is.function(obj$value)) "()" else "" paste0("\\code{\\link{", escape(x[1]), "}", suffix, "}") }) - links <- paste(sort_c(by_file), collapse = ",\n") + links <- paste(by_file, collapse = ",\n") seealso <- topics_process_family_prefix(family) topic$add(rd_section("seealso", paste0(seealso, "\n", links))) diff --git a/R/util-locale.R b/R/util-locale.R index fa324ce8..7360aabf 100644 --- a/R/util-locale.R +++ b/R/util-locale.R @@ -11,4 +11,10 @@ with_collate <- function(locale, code) { force(code) } -sort_c <- function(x, ...) with_collate("C", sort(x, ...)) +sort_c <- function(x, ...) { + with_collate("C", sort(x, ...)) +} + +order_c <- function(x, ...) { + with_collate("C", order(x, ...)) +} diff --git a/man/tags-index-crossref.Rd b/man/tags-index-crossref.Rd index 265e93bc..b8e4aec4 100644 --- a/man/tags-index-crossref.Rd +++ b/man/tags-index-crossref.Rd @@ -40,8 +40,8 @@ Other less frequently used tags: } \seealso{ Other documentation tags: -\code{\link{tags-rd-other}}, \code{\link{tags-rd}}, +\code{\link{tags-rd-other}}, \code{\link{tags-reuse}} } \concept{documentation tags} diff --git a/man/tags-reuse.Rd b/man/tags-reuse.Rd index d3aa3c3b..de062a56 100644 --- a/man/tags-reuse.Rd +++ b/man/tags-reuse.Rd @@ -56,7 +56,7 @@ Other less frequently used tags: \seealso{ Other documentation tags: \code{\link{tags-index-crossref}}, -\code{\link{tags-rd-other}}, -\code{\link{tags-rd}} +\code{\link{tags-rd}}, +\code{\link{tags-rd-other}} } \concept{documentation tags} diff --git a/tests/testthat/_snaps/rd-family.md b/tests/testthat/_snaps/rd-family.md index f437d3d0..64746072 100644 --- a/tests/testthat/_snaps/rd-family.md +++ b/tests/testthat/_snaps/rd-family.md @@ -18,8 +18,8 @@ \seealso{ Other a: \code{\link{Foofun3}()}, - \code{\link{foofun2}()}, - \code{\link{foofun}()} + \code{\link{foofun}()}, + \code{\link{foofun2}()} } \concept{a} @@ -38,8 +38,8 @@ \seealso{ Other a: \code{\link{Foofun3}()}, - \code{\link{foofun1}()}, - \code{\link{foofun}()} + \code{\link{foofun}()}, + \code{\link{foofun1}()} } \concept{a} @@ -57,9 +57,9 @@ } \seealso{ Other a: + \code{\link{foofun}()}, \code{\link{foofun1}()}, - \code{\link{foofun2}()}, - \code{\link{foofun}()} + \code{\link{foofun2}()} } \concept{a}