Skip to content

Commit 1d25761

Browse files
author
ripley
committed
note unused args to loadNamespace()
git-svn-id: https://svn.r-project.org/R/trunk@88659 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent d37c1ce commit 1d25761

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

doc/NEWS.Rd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@
8282
See
8383
\code{\link{RShowDoc}("R-exts#Bibliographic-citations-and-references")}
8484
for more information.
85+
86+
\item Arguments to \code{loadNamespace()} which will be ignored
87+
because the namespace is already loaded are now noted.
8588
}
8689
}
8790

src/library/base/R/namespace.R

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,16 @@ loadNamespace <- function (package, lib.loc = NULL,
207207
sQuote(package), current, zop, zversion),
208208
domain = NA)
209209
}
210-
## silently ignore all other arguments.
210+
## used to silently ignore all other arguments. Still ignore 'lib.loc'
211+
if(!missing(keep.source))
212+
message(gettextf("namespace '%s' is already loaded so argument '%s' will bw ignored.",
213+
package, "keep.source"))
214+
if(!missing(partial))
215+
message(gettextf("namespace '%s' is already loaded so argument '%s' will bw ignored.",
216+
package, "partial"))
217+
if(!missing(keep.parse.data))
218+
message(gettextf("namespace '%s' is already loaded so argument '%s' will bw ignored/",
219+
package, "keep.parse.data"))
211220
## return
212221
ns
213222
} else {

src/library/base/man/ns-load.Rd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ isNamespaceLoaded(name)
3737
recorded in object \code{.Depends} in the package.}
3838
\item{package}{string naming the package/name space to load.}
3939
\item{lib.loc}{character vector specifying library search path (the location
40-
of \R library trees to search through.}
40+
of \R library trees to search through. Only used if the name space
41+
is not already loaded.}
4142
\item{keep.source}{now ignored except during package installation.}
4243
\item{keep.parse.data}{ignored except during package installation.}
4344
\item{partial}{logical; if true, stop just after loading code.}

0 commit comments

Comments
 (0)