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

Bug 18703: Add message to library() in library(include.only=) calls where that directive is redundant #48

Open
hturner opened this issue Aug 14, 2024 · 1 comment
Labels
LatinR 2024 Misc Issues that cannot be classified otherwise needs patch Implement the agreed fix and prepare a patch for review R Issue should require knowledge of R only

Comments

@hturner
Copy link
Member

hturner commented Aug 14, 2024

As described in Bug 18703 this follows up on an R-devel thread discussing the behaviour of library() with the include.only argument. Three bugs (18703, 18704 and 18704) were created to implement follow-up actions. The task here is to add a message when a directive such as

library(Matrix, include.only="isDiagonal")

is redundant, because the Matrix package (or parts of it) are already loaded.

@hturner hturner added needs patch Implement the agreed fix and prepare a patch for review Misc Issues that cannot be classified otherwise Hutch 2024 Issues reserved for R Dev Day @ Hutch 2024 labels Aug 14, 2024
@hturner hturner added RSECon24 and removed Hutch 2024 Issues reserved for R Dev Day @ Hutch 2024 labels Aug 22, 2024
@hturner hturner changed the title Bug 18703: Add warning to library() in library(include.only=) calls where that directive is ignored Bug 18703: Add message to library() in library(include.only=) calls where that directive is redundant Oct 30, 2024
@hturner
Copy link
Member Author

hturner commented Oct 30, 2024

@mmaechler suggests on Bugzilla to use a classed message. An example of a classed message is given in the base::.packageStartupMessage() function:

    structure(list(message = message, call = call),
              class = c("packageStartupMessage",
                        "simpleMessage", "message", "condition"))

For an example of a classed warning, see grDevices:::warnLogCoords().

The actual message should use gettext() or gettextf() so the message is translated as required - see existing examples in the source code for library().

@hturner hturner added the R Issue should require knowledge of R only label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LatinR 2024 Misc Issues that cannot be classified otherwise needs patch Implement the agreed fix and prepare a patch for review R Issue should require knowledge of R only
Projects
None yet
Development

No branches or pull requests

1 participant