Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow suppression of warnings and messages with missing restarts #20

Open
wants to merge 579 commits into
base: trunk
Choose a base branch
from

Conversation

lionel-
Copy link
Owner

@lionel- lionel- commented Aug 9, 2019

The attached patch makes it possible to use suppressMessages() and
suppressWarnings() with code that signals messages and warnings with
non-default protocols. For example, signalling a message with
warning() or a warning with message() are instances of non-default
protocols. In that case, the restarts that are part of the default
signalling protocols for those condition classes are missing. This
currently causes suppressMessages() and suppressWarnings() to fail
with an error. The patch fixes this by first checking that the restart
exists before trying to invoke it.

Since that is needed in multiple places in base R and in packages, I
have extracted the pattern in a dedicated function maybeInvokeRestart().
Initially I made it an argument to invokeRestart(), but it didn't
feel right the control flow semantics of a function via an argument.
Furthermore, it seems the permissive pattern should be used whenever
the condition is signalled from foreign contexts over which the
developer has no control. On the other hand, the strict variant should
be used when restarts are used for control flow effects within a
package. Given these strictly different usages, a new variant seems
more appropriate than an option.

hornik and others added 30 commits June 18, 2019 17:22
a subsequent '[' literally (and not giving an optional item label).

git-svn-id: https://svn.r-project.org/R/trunk@76709 00db46b3-68df-0310-9c12-caf00c1e9a41
git-svn-id: https://svn.r-project.org/R/trunk@76711 00db46b3-68df-0310-9c12-caf00c1e9a41
git-svn-id: https://svn.r-project.org/R/trunk@76715 00db46b3-68df-0310-9c12-caf00c1e9a41
…TRUE

(related to PR#17478).


git-svn-id: https://svn.r-project.org/R/trunk@76718 00db46b3-68df-0310-9c12-caf00c1e9a41
git-svn-id: https://svn.r-project.org/R/trunk@76721 00db46b3-68df-0310-9c12-caf00c1e9a41
git-svn-id: https://svn.r-project.org/R/trunk@76725 00db46b3-68df-0310-9c12-caf00c1e9a41
git-svn-id: https://svn.r-project.org/R/trunk@76729 00db46b3-68df-0310-9c12-caf00c1e9a41
git-svn-id: https://svn.r-project.org/R/trunk@76732 00db46b3-68df-0310-9c12-caf00c1e9a41
git-svn-id: https://svn.r-project.org/R/trunk@76737 00db46b3-68df-0310-9c12-caf00c1e9a41
interference with code that locks GC.


git-svn-id: https://svn.r-project.org/R/trunk@76738 00db46b3-68df-0310-9c12-caf00c1e9a41
git-svn-id: https://svn.r-project.org/R/trunk@76739 00db46b3-68df-0310-9c12-caf00c1e9a41
git-svn-id: https://svn.r-project.org/R/trunk@76740 00db46b3-68df-0310-9c12-caf00c1e9a41
git-svn-id: https://svn.r-project.org/R/trunk@76743 00db46b3-68df-0310-9c12-caf00c1e9a41
… should be true; new argument `na.action = ".."` determines *how* NA/NaN are treated

git-svn-id: https://svn.r-project.org/R/trunk@76744 00db46b3-68df-0310-9c12-caf00c1e9a41
…eady includes

options (such as --force-local).


git-svn-id: https://svn.r-project.org/R/trunk@76746 00db46b3-68df-0310-9c12-caf00c1e9a41
git-svn-id: https://svn.r-project.org/R/trunk@76747 00db46b3-68df-0310-9c12-caf00c1e9a41
git-svn-id: https://svn.r-project.org/R/trunk@76749 00db46b3-68df-0310-9c12-caf00c1e9a41
gfortran >= 7 (on Windows, mirrors 76467).


git-svn-id: https://svn.r-project.org/R/trunk@76751 00db46b3-68df-0310-9c12-caf00c1e9a41
ripley and others added 28 commits August 16, 2019 15:00
git-svn-id: https://svn.r-project.org/R/trunk@77008 00db46b3-68df-0310-9c12-caf00c1e9a41
git-svn-id: https://svn.r-project.org/R/trunk@77009 00db46b3-68df-0310-9c12-caf00c1e9a41
git-svn-id: https://svn.r-project.org/R/trunk@77010 00db46b3-68df-0310-9c12-caf00c1e9a41
mention additional flags as used by Fedora/RHEL


git-svn-id: https://svn.r-project.org/R/trunk@77011 00db46b3-68df-0310-9c12-caf00c1e9a41
git-svn-id: https://svn.r-project.org/R/trunk@77012 00db46b3-68df-0310-9c12-caf00c1e9a41
git-svn-id: https://svn.r-project.org/R/trunk@77013 00db46b3-68df-0310-9c12-caf00c1e9a41
git-svn-id: https://svn.r-project.org/R/trunk@77016 00db46b3-68df-0310-9c12-caf00c1e9a41
git-svn-id: https://svn.r-project.org/R/trunk@77017 00db46b3-68df-0310-9c12-caf00c1e9a41
git-svn-id: https://svn.r-project.org/R/trunk@77019 00db46b3-68df-0310-9c12-caf00c1e9a41
git-svn-id: https://svn.r-project.org/R/trunk@77020 00db46b3-68df-0310-9c12-caf00c1e9a41
git-svn-id: https://svn.r-project.org/R/trunk@77024 00db46b3-68df-0310-9c12-caf00c1e9a41
git-svn-id: https://svn.r-project.org/R/trunk@77026 00db46b3-68df-0310-9c12-caf00c1e9a41
git-svn-id: https://svn.r-project.org/R/trunk@77027 00db46b3-68df-0310-9c12-caf00c1e9a41
git-svn-id: https://svn.r-project.org/R/trunk@77028 00db46b3-68df-0310-9c12-caf00c1e9a41
git-svn-id: https://svn.r-project.org/R/trunk@77029 00db46b3-68df-0310-9c12-caf00c1e9a41
git-svn-id: https://svn.r-project.org/R/trunk@77030 00db46b3-68df-0310-9c12-caf00c1e9a41
git-svn-id: https://svn.r-project.org/R/trunk@77034 00db46b3-68df-0310-9c12-caf00c1e9a41
git-svn-id: https://svn.r-project.org/R/trunk@77035 00db46b3-68df-0310-9c12-caf00c1e9a41
up
git-svn-id: https://svn.r-project.org/R/trunk@77037 00db46b3-68df-0310-9c12-caf00c1e9a41
git-svn-id: https://svn.r-project.org/R/trunk@77038 00db46b3-68df-0310-9c12-caf00c1e9a41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant