diff --git a/NAMESPACE b/NAMESPACE index 62c509bf7..75c862260 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -160,6 +160,9 @@ importFrom(fansi,strip_sgr) importFrom(fansi,substr2_ctl) importFrom(glue,as_glue) importFrom(lifecycle,deprecate_soft) +importFrom(lifecycle,deprecate_warn) +importFrom(lifecycle,deprecated) +importFrom(lifecycle,is_present) importFrom(utf8,utf8_width) importFrom(utils,head) importFrom(utils,str) diff --git a/R/ctl_pillar.R b/R/ctl_pillar.R index 84dc51d2d..35e70b418 100644 --- a/R/ctl_pillar.R +++ b/R/ctl_pillar.R @@ -142,8 +142,7 @@ rowidformat2 <- function(data, names, has_star) { #' @inheritParams pillar #' @param components A named list of components constructed with [pillar_component()]. #' @param class Name of subclass. -#' @param extra For compound pillars, indicate the names or indices of the -#' sub-pillars that could not be shown due to width constraints. +#' @param extra Deprecated. #' #' @export #' @examples @@ -161,9 +160,14 @@ rowidformat2 <- function(data, names, has_star) { #' lines = new_pillar_component(list(lines("=")), width = 1) #' )) new_pillar <- function(components, ..., width = NULL, class = NULL, - extra = NULL) { + extra = deprecated()) { "!!!!DEBUG new_pillar(`v(width)`, `v(class)`)" + if (is_present(extra)) { + # Signal the deprecation to the user + deprecate_warn("1.6.6", "pillar::new_pillar(extra = )") + } + check_dots_empty() if (length(components) > 0 && !is_named(components)) { abort("All components must have names.") @@ -172,8 +176,7 @@ new_pillar <- function(components, ..., width = NULL, class = NULL, structure( components, width = width, - class = c(class, "pillar"), - extra = extra + class = c(class, "pillar") ) } diff --git a/R/zzz.R b/R/zzz.R index 7da4068fe..aa950210f 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -3,7 +3,7 @@ #' @import rlang #' @import ellipsis #' @importFrom glue as_glue -#' @importFrom lifecycle deprecate_soft +#' @importFrom lifecycle deprecate_soft deprecate_warn is_present deprecated #' @importFrom vctrs data_frame #' @importFrom vctrs new_data_frame #' @importFrom vctrs new_list_of diff --git a/man/new_pillar.Rd b/man/new_pillar.Rd index ac41e74d2..9c803cc26 100644 --- a/man/new_pillar.Rd +++ b/man/new_pillar.Rd @@ -4,7 +4,7 @@ \alias{new_pillar} \title{Construct a custom pillar object} \usage{ -new_pillar(components, ..., width = NULL, class = NULL, extra = NULL) +new_pillar(components, ..., width = NULL, class = NULL, extra = deprecated()) } \arguments{ \item{components}{A named list of components constructed with \code{\link[=pillar_component]{pillar_component()}}.} @@ -15,8 +15,7 @@ new_pillar(components, ..., width = NULL, class = NULL, extra = NULL) \item{class}{Name of subclass.} -\item{extra}{For compound pillars, indicate the names or indices of the -sub-pillars that could not be shown due to width constraints.} +\item{extra}{Deprecated.} } \description{ \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}}