Skip to content

Commit

Permalink
discard messages when keep_message = FALSE, and warnings when keep_wa…
Browse files Browse the repository at this point in the history
…rning = FALSE (yihui/knitr#1880 (comment))
  • Loading branch information
yihui committed Nov 21, 2022
1 parent bb87476 commit 5e8fc32
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: evaluate
Type: Package
Title: Parsing and Evaluation Tools that Provide More Details than the Default
Version: 0.18.1
Version: 0.18.2
Authors@R: c(
person("Hadley", "Wickham", role = "aut"),
person("Yihui", "Xie", role = c("aut", "cre"), email = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666")),
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Version 0.19
================================================================================

- In `evaluate()`, `keep_message` and `keep_warning` will completely drop messages and warnings, respectively, when their values are `FALSE`. Previously messages would still be emitted (to the console) even if they take `FALSE` values.

Version 0.18
================================================================================

Expand Down
4 changes: 2 additions & 2 deletions R/eval.r
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ evaluate_call <- function(call, src = NULL,
output_handler$warning(wn)
}
invokeRestart("muffleWarning")
} else identity
} else function() {}
eHandler <- if (use_try) function(e) {
handle_condition(e)
output_handler$error(e)
Expand All @@ -165,7 +165,7 @@ evaluate_call <- function(call, src = NULL,
handle_condition(m)
output_handler$message(m)
invokeRestart("muffleMessage")
} else identity
} else function() {}

ev <- list(value = NULL, visible = FALSE)

Expand Down

0 comments on commit 5e8fc32

Please sign in to comment.