[rkward/work/render_rmd] rkward: Add option to adjust system path. This will often be needed for adding pandoc, for instance.

Thomas Friedrichsmeier null at kde.org
Wed Sep 26 10:28:22 BST 2018


Git commit 30e24e951c9632ba5edbdb985aab88d30eaea246 by Thomas Friedrichsmeier.
Committed on 26/09/2018 at 09:26.
Pushed by tfry into branch 'work/render_rmd'.

Add option to adjust system path. This will often be needed for adding pandoc, for instance.

Note: Commit includes noise from roxygenization.

M  +1    -1    rkward/rbackend/rpackages/rkward/DESCRIPTION
M  +1    -0    rkward/rbackend/rpackages/rkward/NAMESPACE
M  +22   -0    rkward/rbackend/rpackages/rkward/R/rk.utility-functions.R
M  +0    -1    rkward/rbackend/rpackages/rkward/man/RKdevice.Rd
M  +3    -3    rkward/rbackend/rpackages/rkward/man/rk.assign.preview.data.Rd
M  +5    -6    rkward/rbackend/rpackages/rkward/man/rk.call.plugin.Rd
M  +3    -4    rkward/rbackend/rpackages/rkward/man/rk.demo.Rd
M  +6    -4    rkward/rbackend/rpackages/rkward/man/rk.edit.Rd
M  +0    -1    rkward/rbackend/rpackages/rkward/man/rk.embed.device.Rd
M  +8    -6    rkward/rbackend/rpackages/rkward/man/rk.get.tempfile.name.Rd
M  +5    -5    rkward/rbackend/rpackages/rkward/man/rk.graph.on.Rd
M  +8    -4    rkward/rbackend/rpackages/rkward/man/rk.label.Rd
M  +4    -4    rkward/rbackend/rpackages/rkward/man/rk.list.plugins.Rd
M  +3    -4    rkward/rbackend/rpackages/rkward/man/rk.load.pluginmaps.Rd
M  +4    -3    rkward/rbackend/rpackages/rkward/man/rk.misc.Rd
M  +0    -1    rkward/rbackend/rpackages/rkward/man/rk.old.packages.Rd
M  +3    -4    rkward/rbackend/rpackages/rkward/man/rk.printer.device.Rd
M  +0    -1    rkward/rbackend/rpackages/rkward/man/rk.record.commands.Rd
M  +3    -4    rkward/rbackend/rpackages/rkward/man/rk.replace.function.Rd
M  +10   -6    rkward/rbackend/rpackages/rkward/man/rk.results.Rd
M  +0    -1    rkward/rbackend/rpackages/rkward/man/rk.screen.device.Rd
M  +3    -4    rkward/rbackend/rpackages/rkward/man/rk.sessionInfo.Rd
M  +6    -5    rkward/rbackend/rpackages/rkward/man/rk.show.messages.Rd
M  +0    -1    rkward/rbackend/rpackages/rkward/man/rk.switch.frontend.language.Rd
M  +4    -4    rkward/rbackend/rpackages/rkward/man/rk.sync.Rd
M  +0    -1    rkward/rbackend/rpackages/rkward/man/rk.with.window.hints.Rd
M  +0    -1    rkward/rbackend/rpackages/rkward/man/rk.without.plot.history.Rd
M  +5    -5    rkward/rbackend/rpackages/rkward/man/rk.workplace.Rd
M  +0    -1    rkward/rbackend/rpackages/rkward/man/rkward-package.Rd
M  +48   -0    rkward/settings/rksettingsmoduler.cpp
M  +4    -0    rkward/settings/rksettingsmoduler.h

https://commits.kde.org/rkward/30e24e951c9632ba5edbdb985aab88d30eaea246

diff --git a/rkward/rbackend/rpackages/rkward/DESCRIPTION b/rkward/rbackend/rpackages/rkward/DESCRIPTION
index f32ce516..80585be0 100644
--- a/rkward/rbackend/rpackages/rkward/DESCRIPTION
+++ b/rkward/rbackend/rpackages/rkward/DESCRIPTION
@@ -41,4 +41,4 @@ Collate:
     'rk.workspace-functions.R'
     'rkward-package.R'
     'ver.R'
-RoxygenNote: 5.0.1
+RoxygenNote: 6.0.1
diff --git a/rkward/rbackend/rpackages/rkward/NAMESPACE b/rkward/rbackend/rpackages/rkward/NAMESPACE
index 5d7c6cd3..3edf352e 100644
--- a/rkward/rbackend/rpackages/rkward/NAMESPACE
+++ b/rkward/rbackend/rpackages/rkward/NAMESPACE
@@ -52,6 +52,7 @@ export(q)
 export(quartz)
 export(quit)
 export(require)
+export(rk.adjust.system.path)
 export(rk.assign.preview.data)
 export(rk.call.plugin)
 export(rk.clear.plot.history)
diff --git a/rkward/rbackend/rpackages/rkward/R/rk.utility-functions.R b/rkward/rbackend/rpackages/rkward/R/rk.utility-functions.R
index d4863cb9..d39dad33 100644
--- a/rkward/rbackend/rpackages/rkward/R/rk.utility-functions.R
+++ b/rkward/rbackend/rpackages/rkward/R/rk.utility-functions.R
@@ -177,3 +177,25 @@
 "rk.switch.frontend.language" <- function (LANG="C") {
    .rk.do.plain.call ("switchLanguage", as.character (LANG))
 }
+
+#' Add one or more paths to the filesystem search path used in this session
+#'
+#' Add the given path to to the "PATH" environment variable of the running R session. This
+#' can be useful to make sure external binaries are found by Sys.which. Paths are normalized
+#' before being added, and duplicates are stripped from the path.
+#'
+#' @param add Paths to add. May be missing, in which case the path will no be touched.
+#'
+#' @return A vector of the directories in the file sytem path after the adjustment
+#'
+#' @export
+"rk.adjust.system.path" <- function (add) {
+	if (!missing (add)) {
+		oldpath <- unlist (strsplit(Sys.getenv("PATH"), .Platform$path.sep))
+		newpath <- paste (unlist (unique (c (oldpath, normalizePath (add)))), collapse=.Platform$path.sep)
+		Sys.setenv("PATH"=newpath)
+	}
+
+	# return
+	unlist (strsplit(Sys.getenv("PATH"), .Platform$path.sep))
+}
diff --git a/rkward/rbackend/rpackages/rkward/man/RKdevice.Rd b/rkward/rbackend/rpackages/rkward/man/RKdevice.Rd
index e87bf2ca..af3eaf2a 100644
--- a/rkward/rbackend/rpackages/rkward/man/RKdevice.Rd
+++ b/rkward/rbackend/rpackages/rkward/man/RKdevice.Rd
@@ -30,4 +30,3 @@ including the device independent fonts names "sans", "serif", and "mono"}
 The default settings for \code{width}, and \code{height} can be modified from Settings -> Configure RKWard -> Onscreen Graphics.
 }
 \keyword{devices}
-
diff --git a/rkward/rbackend/rpackages/rkward/man/rk.assign.preview.data.Rd b/rkward/rbackend/rpackages/rkward/man/rk.assign.preview.data.Rd
index 0d306c0e..9b30a067 100644
--- a/rkward/rbackend/rpackages/rkward/man/rk.assign.preview.data.Rd
+++ b/rkward/rbackend/rpackages/rkward/man/rk.assign.preview.data.Rd
@@ -1,10 +1,11 @@
 % Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/rk.plugin-functions.R
 \name{rk.assign.preview.data}
-\alias{.rk.discard.preview.data}
 \alias{rk.assign.preview.data}
-\alias{rk.discard.preview.data}
 \alias{rk.get.preview.data}
+\alias{.rk.discard.preview.data}
+\alias{rk.get.preview.data}
+\alias{rk.discard.preview.data}
 \title{Manage (shortly) persistent data for previews (for use in RKWard plugins wishing to provide custom previews)}
 \usage{
 rk.assign.preview.data(id, value = list())
@@ -59,4 +60,3 @@ try ({
 Thomas Friedrichsmeier \email{rkward-devel at kde.org}
 }
 \keyword{utilities}
-
diff --git a/rkward/rbackend/rpackages/rkward/man/rk.call.plugin.Rd b/rkward/rbackend/rpackages/rkward/man/rk.call.plugin.Rd
index 587bf2fe..4e441155 100644
--- a/rkward/rbackend/rpackages/rkward/man/rk.call.plugin.Rd
+++ b/rkward/rbackend/rpackages/rkward/man/rk.call.plugin.Rd
@@ -10,6 +10,8 @@ rk.call.plugin(plugin, ..., submit.mode = c("manual", "auto", "submit"))
 \item{plugin}{character string, giving the name of the plugin to call. See
 Details.}
 
+\item{\dots}{arguments passed to the \code{plugin}}
+
 \item{submit.mode}{character string, specifying the submission mode:
 \code{"manual"} will open the plugin GUI and leave it to the user to
 submit it manually, \code{"auto"} will try to submit the plugin, if it can
@@ -21,8 +23,6 @@ generate an error, if it cannot be submitted. \code{"manual"} will always
 return immediately, \code{"auto"} may or may not return immediately, and
 \code{"submit"} will always wait until the plugin has been run, or produce
 an error.}
-
-\item{\dots}{arguments passed to the \code{plugin}}
 }
 \value{
 \code{rk.call.plugin} returns \code{TRUE} invisibly.
@@ -63,12 +63,11 @@ rk.call.plugin ("rkward::t_test_two_vars",
   submit.mode="submit")
 })
 
-}
-\author{
-Thomas Friedrichsmeier \email{rkward-devel at kde.org}
 }
 \seealso{
 \code{\link{rk.results}}, \url{rkward://page/rkward_output}
 }
+\author{
+Thomas Friedrichsmeier \email{rkward-devel at kde.org}
+}
 \keyword{utilities}
-
diff --git a/rkward/rbackend/rpackages/rkward/man/rk.demo.Rd b/rkward/rbackend/rpackages/rkward/man/rk.demo.Rd
index 6f1d14e9..d9bba3b3 100644
--- a/rkward/rbackend/rpackages/rkward/man/rk.demo.Rd
+++ b/rkward/rbackend/rpackages/rkward/man/rk.demo.Rd
@@ -27,13 +27,12 @@ the specification of a topic is mandatory.
 ## Not run
 rk.demo("graphics")
 }
-\author{
-Thomas Friedrichsmeier \email{rkward-devel at kde.org}
-}
 \seealso{
 \code{\link{rk.edit.files}}, \code{\link{rk.show.files}},
   \code{\link{demo}}
 }
+\author{
+Thomas Friedrichsmeier \email{rkward-devel at kde.org}
+}
 \keyword{IO}
 \keyword{utilities}
-
diff --git a/rkward/rbackend/rpackages/rkward/man/rk.edit.Rd b/rkward/rbackend/rpackages/rkward/man/rk.edit.Rd
index 88eeb251..e4854b70 100644
--- a/rkward/rbackend/rpackages/rkward/man/rk.edit.Rd
+++ b/rkward/rbackend/rpackages/rkward/man/rk.edit.Rd
@@ -5,6 +5,9 @@
 \alias{rk.edit.files}
 \alias{rk.show.files}
 \alias{rk.show.html}
+\alias{rk.edit.files}
+\alias{rk.show.files}
+\alias{rk.show.html}
 \title{Edit / show an object / file}
 \usage{
 rk.edit(x)
@@ -59,13 +62,12 @@ and \code{getOption("browser")}.
 x <- data.frame (a=c(1:3), b=c(2:4))
 rk.edit(x)
 }
-\author{
-Thomas Friedrichsmeier \email{rkward-devel at kde.org}
-}
 \seealso{
 \code{\link{edit}}, \code{\link{file.edit}},
   \code{\link{file.show}}, \code{\link{browseURL}}
 }
+\author{
+Thomas Friedrichsmeier \email{rkward-devel at kde.org}
+}
 \keyword{IO}
 \keyword{utilities}
-
diff --git a/rkward/rbackend/rpackages/rkward/man/rk.embed.device.Rd b/rkward/rbackend/rpackages/rkward/man/rk.embed.device.Rd
index 12fa7226..c023e49b 100644
--- a/rkward/rbackend/rpackages/rkward/man/rk.embed.device.Rd
+++ b/rkward/rbackend/rpackages/rkward/man/rk.embed.device.Rd
@@ -32,4 +32,3 @@ plot (rnorm (10))
 \seealso{
 \link{RK}
 }
-
diff --git a/rkward/rbackend/rpackages/rkward/man/rk.get.tempfile.name.Rd b/rkward/rbackend/rpackages/rkward/man/rk.get.tempfile.name.Rd
index 91fc8fc4..e4395f55 100644
--- a/rkward/rbackend/rpackages/rkward/man/rk.get.tempfile.name.Rd
+++ b/rkward/rbackend/rpackages/rkward/man/rk.get.tempfile.name.Rd
@@ -1,11 +1,14 @@
 % Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/rk.filename-functions.R
 \name{rk.get.tempfile.name}
-\alias{rk.flush.output}
-\alias{rk.get.output.html.file}
 \alias{rk.get.tempfile.name}
 \alias{rk.get.workspace.url}
+\alias{rk.get.output.html.file}
 \alias{rk.set.output.html.file}
+\alias{rk.get.workspace.url}
+\alias{rk.get.output.html.file}
+\alias{rk.set.output.html.file}
+\alias{rk.flush.output}
 \title{RKWard file names}
 \usage{
 rk.get.tempfile.name(prefix = "image", extension = ".jpg")
@@ -89,14 +92,13 @@ rk.show.html(rk.get.output.html.file())
 rk.flush.output()
 rk.set.output.html.file(outfile)
 
-}
-\author{
-Thomas Friedrichsmeier \email{rkward-devel at kde.org}
 }
 \seealso{
 \url{rkward://page/rkward_output}, \link{tempfile}, \link{file},
   \link{rk.print}
 }
+\author{
+Thomas Friedrichsmeier \email{rkward-devel at kde.org}
+}
 \keyword{IO}
 \keyword{utilities}
-
diff --git a/rkward/rbackend/rpackages/rkward/man/rk.graph.on.Rd b/rkward/rbackend/rpackages/rkward/man/rk.graph.on.Rd
index fc41fe24..1dc01bf8 100644
--- a/rkward/rbackend/rpackages/rkward/man/rk.graph.on.Rd
+++ b/rkward/rbackend/rpackages/rkward/man/rk.graph.on.Rd
@@ -1,8 +1,9 @@
 % Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/public_graphics.R
 \name{rk.graph.on}
-\alias{rk.graph.off}
 \alias{rk.graph.on}
+\alias{rk.graph.off}
+\alias{rk.graph.off}
 \title{Plot graphics to HTML output file}
 \usage{
 rk.graph.on(device.type = getOption("rk.graphics.type"),
@@ -50,12 +51,11 @@ rk.graph.off ()
 #plot (rnorm (100))
 #dev.print (device = rk.graph.on)
 
-}
-\author{
-Thomas Friedrichsmeier \email{rkward-devel at kde.org}
 }
 \seealso{
 \link{rk.results} \link{rk.print} \link{rk.get.output.html.file} \link{dev.off} \link{svg} \link{png} \link{jpg}
 }
+\author{
+Thomas Friedrichsmeier \email{rkward-devel at kde.org}
+}
 \keyword{devices}
-
diff --git a/rkward/rbackend/rpackages/rkward/man/rk.label.Rd b/rkward/rbackend/rpackages/rkward/man/rk.label.Rd
index 9cbe145a..37bf459a 100644
--- a/rkward/rbackend/rpackages/rkward/man/rk.label.Rd
+++ b/rkward/rbackend/rpackages/rkward/man/rk.label.Rd
@@ -1,14 +1,19 @@
 % Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/rk.label-functions.R
 \name{rk.get.label}
-\alias{.rk.make.short.name}
-\alias{rk.get.description}
 \alias{rk.get.label}
+\alias{rk.set.label}
 \alias{rk.get.short.name}
+\alias{rk.get.description}
+\alias{rk.list.names}
 \alias{rk.list}
+\alias{rk.set.label}
 \alias{rk.list.labels}
+\alias{rk.get.short.name}
+\alias{.rk.make.short.name}
+\alias{rk.get.description}
+\alias{rk.list}
 \alias{rk.list.names}
-\alias{rk.set.label}
 \title{Various label related utility functions}
 \usage{
 rk.get.label(x)
@@ -91,4 +96,3 @@ names (rk.list (x$a, x$b))                # "x$a (First column)" "x$b"
 Thomas Friedrichsmeier \email{rkward-devel at kde.org}
 }
 \keyword{utilities}
-
diff --git a/rkward/rbackend/rpackages/rkward/man/rk.list.plugins.Rd b/rkward/rbackend/rpackages/rkward/man/rk.list.plugins.Rd
index 48e6bb3b..06aad83f 100644
--- a/rkward/rbackend/rpackages/rkward/man/rk.list.plugins.Rd
+++ b/rkward/rbackend/rpackages/rkward/man/rk.list.plugins.Rd
@@ -3,6 +3,7 @@
 \name{rk.list.plugins}
 \alias{rk.list.plugins}
 \alias{rk.set.plugin.status}
+\alias{rk.set.plugin.status}
 \title{List of modify loaded plugins}
 \usage{
 rk.list.plugins()
@@ -49,12 +50,11 @@ rk.list.plugins ()
 rk.set.plugin.status ("rkward::t_test", visible=FALSE)
 ## END NOT RUN
 
-}
-\author{
-Thomas Friedrichsmeier \email{rkward-devel at kde.org}
 }
 \seealso{
 \code{\link{rk.call.plugin}} for invoking a plugin, programatically
 }
+\author{
+Thomas Friedrichsmeier \email{rkward-devel at kde.org}
+}
 \keyword{utilities}
-
diff --git a/rkward/rbackend/rpackages/rkward/man/rk.load.pluginmaps.Rd b/rkward/rbackend/rpackages/rkward/man/rk.load.pluginmaps.Rd
index 365bd6de..5c6cd94e 100644
--- a/rkward/rbackend/rpackages/rkward/man/rk.load.pluginmaps.Rd
+++ b/rkward/rbackend/rpackages/rkward/man/rk.load.pluginmaps.Rd
@@ -37,11 +37,10 @@ rk.load.pluginmaps()
 
 ## END NOT RUN
 }
-\author{
-Thomas Friedrichsmeier \email{rkward-devel at kde.org}
-}
 \seealso{
 \code{\link{rk.call.plugin}}, @seealso \code{\link{rkwarddev::rk.plugin.skeleton}}
 }
+\author{
+Thomas Friedrichsmeier \email{rkward-devel at kde.org}
+}
 \keyword{utilities}
-
diff --git a/rkward/rbackend/rpackages/rkward/man/rk.misc.Rd b/rkward/rbackend/rpackages/rkward/man/rk.misc.Rd
index 8717618a..22bef6f1 100644
--- a/rkward/rbackend/rpackages/rkward/man/rk.misc.Rd
+++ b/rkward/rbackend/rpackages/rkward/man/rk.misc.Rd
@@ -1,9 +1,11 @@
 % Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/rk.utility-functions.R
 \name{rk.rename.in.container}
-\alias{rk.make.repos.string}
-\alias{rk.misc}
 \alias{rk.rename.in.container}
+\alias{rk.misc}
+\alias{rk.make.repos.string}
+\alias{rk.select.CRAN.mirror}
+\alias{rk.make.repos.string}
 \alias{rk.select.CRAN.mirror}
 \title{Miscellaneous utility functions}
 \usage{
@@ -60,4 +62,3 @@ Thomas Friedrichsmeier \email{rkward-devel at kde.org}
 \keyword{attribute}
 \keyword{misc}
 \keyword{utilities}
-
diff --git a/rkward/rbackend/rpackages/rkward/man/rk.old.packages.Rd b/rkward/rbackend/rpackages/rkward/man/rk.old.packages.Rd
index 8fe336b2..0a8e9f58 100644
--- a/rkward/rbackend/rpackages/rkward/man/rk.old.packages.Rd
+++ b/rkward/rbackend/rpackages/rkward/man/rk.old.packages.Rd
@@ -32,4 +32,3 @@ Thomas Friedrichsmeier \email{rkward-devel at kde.org}
 \keyword{attribute}
 \keyword{misc}
 \keyword{utilities}
-
diff --git a/rkward/rbackend/rpackages/rkward/man/rk.printer.device.Rd b/rkward/rbackend/rpackages/rkward/man/rk.printer.device.Rd
index a5c519d9..7128999e 100644
--- a/rkward/rbackend/rpackages/rkward/man/rk.printer.device.Rd
+++ b/rkward/rbackend/rpackages/rkward/man/rk.printer.device.Rd
@@ -27,14 +27,13 @@ example, below.
 plot (rnorm (10))
 dev.print (rk.printer.device)
 
-}
-\author{
-Thomas Friedrichsmeier \email{rkward-devel at kde.org}
 }
 \seealso{
 \code{\link{postscript}}, \code{\link{dev.print}},
   \code{\link{rk.graph.on}}
 }
+\author{
+Thomas Friedrichsmeier \email{rkward-devel at kde.org}
+}
 \keyword{device}
 \keyword{utilities}
-
diff --git a/rkward/rbackend/rpackages/rkward/man/rk.record.commands.Rd b/rkward/rbackend/rpackages/rkward/man/rk.record.commands.Rd
index 21417968..1423c1b8 100644
--- a/rkward/rbackend/rpackages/rkward/man/rk.record.commands.Rd
+++ b/rkward/rbackend/rpackages/rkward/man/rk.record.commands.Rd
@@ -16,4 +16,3 @@ To stop recording, supply NULL or "" as filename.
 Currently used for the purpose of automated testing, only. Perhaps in the future
 this or a similar mechanism could also be added as a user feature.
 }
-
diff --git a/rkward/rbackend/rpackages/rkward/man/rk.replace.function.Rd b/rkward/rbackend/rpackages/rkward/man/rk.replace.function.Rd
index 7c3650f3..ddb9fa16 100644
--- a/rkward/rbackend/rpackages/rkward/man/rk.replace.function.Rd
+++ b/rkward/rbackend/rpackages/rkward/man/rk.replace.function.Rd
@@ -49,13 +49,12 @@ rk.replace.function ("history", as.environment ("package:utils"),
   })
 ## End not run
 
-}
-\author{
-Thomas Friedrichsmeier \email{rkward-devel at kde.org}
 }
 \seealso{
 \code{\link{assignInNamespace}}, \code{\link{debug}}
 }
+\author{
+Thomas Friedrichsmeier \email{rkward-devel at kde.org}
+}
 \keyword{IO}
 \keyword{utilities}
-
diff --git a/rkward/rbackend/rpackages/rkward/man/rk.results.Rd b/rkward/rbackend/rpackages/rkward/man/rk.results.Rd
index 26355162..1847b9c8 100644
--- a/rkward/rbackend/rpackages/rkward/man/rk.results.Rd
+++ b/rkward/rbackend/rpackages/rkward/man/rk.results.Rd
@@ -1,12 +1,17 @@
 % Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/rk.print-functions.R
 \name{rk.print}
-\alias{rk.describe.alternative}
-\alias{rk.header}
 \alias{rk.print}
 \alias{rk.print.code}
 \alias{rk.print.literal}
+\alias{rk.header}
+\alias{rk.results}
+\alias{rk.describe.alternative}
+\alias{rk.print.code}
+\alias{rk.header}
 \alias{rk.results}
+\alias{rk.print.literal}
+\alias{rk.describe.alternative}
 \title{Print objects and results to output}
 \usage{
 rk.print(x, ...)
@@ -115,14 +120,13 @@ rk.results (list (
   'confidence interval of difference'=result$conf.int ))
 })
 
-}
-\author{
-Thomas Friedrichsmeier \email{rkward-devel at kde.org}
 }
 \seealso{
 \code{\link{HTML}}, \code{\link{rk.get.output.html.file}},
   \code{\link{rk.get.description}}, \code{\link{rk.call.plugin}},
   \url{rkward://page/rkward_output}
 }
+\author{
+Thomas Friedrichsmeier \email{rkward-devel at kde.org}
+}
 \keyword{utilities}
-
diff --git a/rkward/rbackend/rpackages/rkward/man/rk.screen.device.Rd b/rkward/rbackend/rpackages/rkward/man/rk.screen.device.Rd
index a91a3d13..3648cf85 100644
--- a/rkward/rbackend/rpackages/rkward/man/rk.screen.device.Rd
+++ b/rkward/rbackend/rpackages/rkward/man/rk.screen.device.Rd
@@ -12,4 +12,3 @@ Depending on your use case, you should use \code{dev.new()}, \code{RK()} or \cod
 \seealso{
 \link{dev.new}, \link{RK}, \link{rk.embed.device}
 }
-
diff --git a/rkward/rbackend/rpackages/rkward/man/rk.sessionInfo.Rd b/rkward/rbackend/rpackages/rkward/man/rk.sessionInfo.Rd
index f726990d..28f3711f 100644
--- a/rkward/rbackend/rpackages/rkward/man/rk.sessionInfo.Rd
+++ b/rkward/rbackend/rpackages/rkward/man/rk.sessionInfo.Rd
@@ -23,12 +23,11 @@ from the menu. Internally, this will call \code{rk.sessionInfo()}.
 
 rk.sessionInfo()
 }
-\author{
-Thomas Friedrichsmeier \email{rkward-devel at kde.org}
-}
 \seealso{
 \code{\link{sessionInfo}}
 }
+\author{
+Thomas Friedrichsmeier \email{rkward-devel at kde.org}
+}
 \keyword{misc}
 \keyword{utilities}
-
diff --git a/rkward/rbackend/rpackages/rkward/man/rk.show.messages.Rd b/rkward/rbackend/rpackages/rkward/man/rk.show.messages.Rd
index 2077aa56..6b186b42 100644
--- a/rkward/rbackend/rpackages/rkward/man/rk.show.messages.Rd
+++ b/rkward/rbackend/rpackages/rkward/man/rk.show.messages.Rd
@@ -1,9 +1,11 @@
 % Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/rk.KDE_GUI-functions.R
 \name{rk.show.message}
-\alias{rk.select.list}
 \alias{rk.show.message}
 \alias{rk.show.question}
+\alias{rk.select.list}
+\alias{rk.show.question}
+\alias{rk.select.list}
 \title{Message boxes and selection list using native KDE GUI}
 \usage{
 rk.show.message(message, caption = "Information", wait = TRUE)
@@ -82,11 +84,10 @@ rk.select.list (LETTERS, preselect = c("A", "E", "I", "O", "U"),
 .rk.backups$select.list (LETTERS, preselect = c("A", "E", "I", "O", "U"), 
   multiple = TRUE, title = "vowels")
 }
-\author{
-Thomas Friedrichsmeier \email{rkward-devel at kde.org}
-}
 \seealso{
 \code{\link{system}}, \code{\link{select.list}}
 }
+\author{
+Thomas Friedrichsmeier \email{rkward-devel at kde.org}
+}
 \keyword{utilities}
-
diff --git a/rkward/rbackend/rpackages/rkward/man/rk.switch.frontend.language.Rd b/rkward/rbackend/rpackages/rkward/man/rk.switch.frontend.language.Rd
index a9b99c1f..00c84a94 100644
--- a/rkward/rbackend/rpackages/rkward/man/rk.switch.frontend.language.Rd
+++ b/rkward/rbackend/rpackages/rkward/man/rk.switch.frontend.language.Rd
@@ -20,4 +20,3 @@ show strings in the new lanuage, however.
 \details{
 To change the language in the backend, use \code{Sys.setenv(LANGUAGE=...)} or \code{Sys.setlocale()}.
 }
-
diff --git a/rkward/rbackend/rpackages/rkward/man/rk.sync.Rd b/rkward/rbackend/rpackages/rkward/man/rk.sync.Rd
index f92f11ef..b6576f0e 100644
--- a/rkward/rbackend/rpackages/rkward/man/rk.sync.Rd
+++ b/rkward/rbackend/rpackages/rkward/man/rk.sync.Rd
@@ -3,6 +3,7 @@
 \name{rk.sync}
 \alias{rk.sync}
 \alias{rk.sync.global}
+\alias{rk.sync.global}
 \title{Sync R object(s)}
 \usage{
 rk.sync(x)
@@ -35,13 +36,12 @@ environments (see examples).
 
 rk.sync (rkward::rk.record.plot)
 
-}
-\author{
-Thomas Friedrichsmeier \email{rkward-devel at kde.org}
 }
 \seealso{
 \url{rkward://page/rkward_workspace_browser}
 }
+\author{
+Thomas Friedrichsmeier \email{rkward-devel at kde.org}
+}
 \keyword{misc}
 \keyword{utilities}
-
diff --git a/rkward/rbackend/rpackages/rkward/man/rk.with.window.hints.Rd b/rkward/rbackend/rpackages/rkward/man/rk.with.window.hints.Rd
index 8b45eb5c..d8b78413 100644
--- a/rkward/rbackend/rpackages/rkward/man/rk.with.window.hints.Rd
+++ b/rkward/rbackend/rpackages/rkward/man/rk.with.window.hints.Rd
@@ -49,4 +49,3 @@ it will remain in place, with compatible parameters.
 Thomas Friedrichsmeier \email{rkward-devel at kde.org}
 }
 \keyword{utilities}
-
diff --git a/rkward/rbackend/rpackages/rkward/man/rk.without.plot.history.Rd b/rkward/rbackend/rpackages/rkward/man/rk.without.plot.history.Rd
index 4787e04a..7cf59296 100644
--- a/rkward/rbackend/rpackages/rkward/man/rk.without.plot.history.Rd
+++ b/rkward/rbackend/rpackages/rkward/man/rk.without.plot.history.Rd
@@ -11,4 +11,3 @@ rk.without.plot.history(expr)
 Run a (plotting) action, without recording anything in the plot history.
 Internally, the plot history option is turned off for the duration of the action.
 }
-
diff --git a/rkward/rbackend/rpackages/rkward/man/rk.workplace.Rd b/rkward/rbackend/rpackages/rkward/man/rk.workplace.Rd
index 5f938d14..a136a363 100644
--- a/rkward/rbackend/rpackages/rkward/man/rk.workplace.Rd
+++ b/rkward/rbackend/rpackages/rkward/man/rk.workplace.Rd
@@ -1,8 +1,9 @@
 % Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/rk.workspace-functions.R
 \name{rk.save.workplace}
-\alias{rk.restore.workplace}
 \alias{rk.save.workplace}
+\alias{rk.restore.workplace}
+\alias{rk.restore.workplace}
 \title{Save or restore RKWard workplace}
 \usage{
 rk.save.workplace(file = NULL, description = NULL)
@@ -47,12 +48,11 @@ rk.save.workplace ()
 rk.restore.workplace ()
 ## End not run
 
-}
-\author{
-Thomas Friedrichsmeier \email{rkward-devel at kde.org}
 }
 \seealso{
 \url{rkward://page/rkward_for_r_users}, \link{rk.get.workspace.url}
 }
+\author{
+Thomas Friedrichsmeier \email{rkward-devel at kde.org}
+}
 \keyword{utilities}
-
diff --git a/rkward/rbackend/rpackages/rkward/man/rkward-package.Rd b/rkward/rbackend/rpackages/rkward/man/rkward-package.Rd
index 39f583d7..6cb42487 100644
--- a/rkward/rbackend/rpackages/rkward/man/rkward-package.Rd
+++ b/rkward/rbackend/rpackages/rkward/man/rkward-package.Rd
@@ -27,4 +27,3 @@ functions only needed for the internal communication between RKWard and R, but s
 Thomas Friedrichsmeier, with contributions from RKWard-devel mailing list
 }
 \keyword{package}
-
diff --git a/rkward/settings/rksettingsmoduler.cpp b/rkward/settings/rksettingsmoduler.cpp
index cc9edfed..1201ad20 100644
--- a/rkward/settings/rksettingsmoduler.cpp
+++ b/rkward/settings/rksettingsmoduler.cpp
@@ -57,6 +57,7 @@ bool RKSettingsModuleR::options_checkbounds;
 QString RKSettingsModuleR::options_editor;
 QString RKSettingsModuleR::options_pager;
 QString RKSettingsModuleR::options_further;
+QStringList RKSettingsModuleR::options_addpaths;
 // static constants
 QString RKSettingsModuleR::builtin_editor = "<rkward>";
 // session constants
@@ -207,6 +208,12 @@ RKSettingsModuleR::RKSettingsModuleR (RKSettings *gui, QWidget *parent) : RKSett
 	grid->addWidget (further_input, ++row, 0, 1, 2);
 
 	main_vbox->addStretch ();
+
+	addpaths_selector = new MultiStringSelector (i18n ("Addition search paths for utilities used by R"), this);
+	addpaths_selector->setValues (options_addpaths);
+	connect (addpaths_selector, &MultiStringSelector::listChanged, this, &RKSettingsModuleR::settingChanged);
+	connect (addpaths_selector, &MultiStringSelector::getNewStrings, this, &RKSettingsModuleR::addPaths);
+	main_vbox->addWidget (addpaths_selector);
 }
 
 RKSettingsModuleR::~RKSettingsModuleR() {
@@ -239,6 +246,13 @@ void RKSettingsModuleR::applyChanges () {
 	options_editor = editor_input->currentText ();
 	options_pager = pager_input->currentText ();
 	options_further = further_input->toPlainText ();
+	// normalize system paths before adding
+	QStringList paths = addpaths_selector->getValues ();
+	options_addpaths.clear ();
+	for (int i = 0; i < paths.count (); ++i) {
+		QString path = QDir::cleanPath (paths[i]);
+		if (!options_addpaths.contains (path)) options_addpaths.append (path);
+	}
 
 // apply run time options in R
 	QStringList commands = makeRRunTimeOptionCommands ();
@@ -247,6 +261,31 @@ void RKSettingsModuleR::applyChanges () {
 	}
 }
 
+void RKSettingsModuleR::addPaths(QStringList* string_list) {
+	RK_TRACE (SETTINGS);
+
+	QDialog dialog (this);
+	dialog.setWindowTitle (i18n ("Add System Path Directory"));
+	QVBoxLayout *layout = new QVBoxLayout (&dialog);
+	QLabel *label = new QLabel (i18n ("Specify or select directory to add to the system file path of the running R session"));
+	label->setWordWrap (true);
+	layout->addWidget (label);
+
+	KUrlRequester *req = new KUrlRequester ();
+	req->setMode (KFile::Directory);
+	layout->addWidget (req);
+
+	QDialogButtonBox *buttons = new QDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
+	buttons->button(QDialogButtonBox::Ok)->setText (i18nc ("Add directory to list", "Add"));
+	connect (buttons, &QDialogButtonBox::accepted, &dialog, &QDialog::accept);
+	connect (buttons, &QDialogButtonBox::rejected, &dialog, &QDialog::reject);
+	layout->addWidget (buttons);
+
+	if (dialog.exec () == QDialog::Accepted) {
+		if (!req->text ().isEmpty ()) (*string_list).append (req->text ());
+	}
+}
+
 //static
 QStringList RKSettingsModuleR::makeRRunTimeOptionCommands () {
 	RK_TRACE (SETTINGS);
@@ -271,6 +310,13 @@ QStringList RKSettingsModuleR::makeRRunTimeOptionCommands () {
 	if (options_pager == builtin_editor) list.append ("options (pager=rk.show.files)\n");
 	else list.append ("options (pager=\"" + options_pager + "\")\n");
 	if (!options_further.isEmpty ()) list.append (options_further + '\n');
+	if (!options_addpaths.isEmpty ()) {
+		QString command = "rk.adjust.system.path (add=c(";
+		foreach (const QString &p, options_addpaths) {
+			command.append (RObject::rQuote (p));
+		}
+		list.append (command + "))\n");
+	}
 
 #ifdef __GNUC__
 #	warning TODO make the following options configurable
@@ -305,6 +351,7 @@ void RKSettingsModuleR::saveSettings (KConfig *config) {
 	cg.writeEntry ("editor", options_editor);
 	cg.writeEntry ("pager", options_pager);
 	cg.writeEntry ("further init commands", options_further);
+	cg.writeEntry ("addsyspaths", options_addpaths);
 }
 
 void RKSettingsModuleR::loadSettings (KConfig *config) {
@@ -324,6 +371,7 @@ void RKSettingsModuleR::loadSettings (KConfig *config) {
 	options_editor = cg.readEntry ("editor", builtin_editor);
 	options_pager = cg.readEntry ("pager", builtin_editor);
 	options_further = cg.readEntry ("further init commands", QString ());
+	options_addpaths = cg.readEntry ("addsyspaths", QStringList ());
 }
 
 //#################################################
diff --git a/rkward/settings/rksettingsmoduler.h b/rkward/settings/rksettingsmoduler.h
index d3db9c16..e3f6f367 100644
--- a/rkward/settings/rksettingsmoduler.h
+++ b/rkward/settings/rksettingsmoduler.h
@@ -58,6 +58,8 @@ public:
 	static int getDefaultWidth () { return options_width; };
 public slots:
 	void settingChanged ();
+private slots:
+	void addPaths (QStringList *string_list);
 private:
 	QLineEdit *outdec_input;
 	QSpinBox *width_input;
@@ -72,6 +74,7 @@ private:
 	QComboBox *editor_input;
 	QComboBox *pager_input;
 	QTextEdit *further_input;
+	MultiStringSelector *addpaths_selector;
 
 	static QString options_outdec;
 	static int options_width;
@@ -86,6 +89,7 @@ private:
 	static QString options_editor;
 	static QString options_pager;
 	static QString options_further;
+	static QStringList options_addpaths;
 
 // constants
 	static QString builtin_editor;



More information about the rkward-tracker mailing list