Skip to content

Commit

Permalink
Relocate the package startup messages into the enable_errorist() / …
Browse files Browse the repository at this point in the history
…`disable_errorist()` modes.

Remove enable/disable calls in package documentation proceeding shim activation.
  • Loading branch information
coatless committed Jan 27, 2018
1 parent 06bcd13 commit 9a39df3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 24 deletions.
10 changes: 2 additions & 8 deletions R/handlers.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
#' @author James Joseph Balamuta
#' @examples
#'
#' # Disable errorist mode if already engaged.
#' disable_errorist()
#'
#' ### Default search engine is Google
#'
#' # Enable automatic search
Expand Down Expand Up @@ -51,13 +48,15 @@
#' @rdname errorist_init
enable_errorist = function(error_search_func = getOption("errorist.warning", searcher::search_google),
warning_search_func = getOption("errorist.warning", searcher::search_google)) {
message("Warnings and errors will automatically trigger a web search.")
enable_error_shim(error_search_func)
enable_warning_shim(warning_search_func)
}

#' @export
#' @rdname errorist_init
disable_errorist = function() {
message("Warnings and errors are no longer automatically searched.")
disable_error_shim()
disable_warning_shim()
}
Expand Down Expand Up @@ -132,8 +131,6 @@ warning_handler = function(search_func =
#' @author James Joseph Balamuta
#' @examples
#'
#' # Disable the errorist hooks if already loaded
#' disable_errorist()
#'
#' # Default setup
#' enable_warning_shim()
Expand Down Expand Up @@ -179,9 +176,6 @@ disable_warning_shim = function() {
#' @export
#' @examples
#'
#' # Disable the errorist hooks if already loaded
#' disable_errorist()
#'
#' # Enable only the error shim
#' enable_error_shim()
#'
Expand Down
10 changes: 2 additions & 8 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,14 @@
"Please supply either: TRUE or FALSE.")

} else if (autoload_config == TRUE) {
packageStartupMessage("Warnings and errors will automatically trigger a web search.")

enable_error_shim()
enable_warning_shim()
enable_errorist()
}

invisible()
}

.onUnload = function(libpath) {
message("Warnings and errors are no longer automatically searched.")

disable_error_shim()
disable_warning_shim()
disable_errorist()

invisible()
}
3 changes: 0 additions & 3 deletions man/errorist_init.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions man/shims.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9a39df3

Please sign in to comment.