From 5336475e656938254d2a69642fd62a2384dfd085 Mon Sep 17 00:00:00 2001 From: Romain Francois Date: Thu, 26 Oct 2023 17:04:57 +0200 Subject: [PATCH] make routines public --- share/jupyter/kernels/xr/resources/routines.R | 2 +- share/jupyter/kernels/xr/resources/setup.R | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/share/jupyter/kernels/xr/resources/routines.R b/share/jupyter/kernels/xr/resources/routines.R index 4d57a75..57ad3cd 100644 --- a/share/jupyter/kernels/xr/resources/routines.R +++ b/share/jupyter/kernels/xr/resources/routines.R @@ -12,5 +12,5 @@ publish_stream <- function(name, text) { } display_data <- function(data = NULL, metadata = NULL) { - .Call("xeusr_display_data", jsonlite::toJSON(data), jsonlite::toJSON(metadata), PACKAGE = "(embedding)") + invisible(.Call("xeusr_display_data", jsonlite::toJSON(data), jsonlite::toJSON(metadata), PACKAGE = "(embedding)")) } diff --git a/share/jupyter/kernels/xr/resources/setup.R b/share/jupyter/kernels/xr/resources/setup.R index 3781436..143832f 100644 --- a/share/jupyter/kernels/xr/resources/setup.R +++ b/share/jupyter/kernels/xr/resources/setup.R @@ -17,7 +17,7 @@ local({ "..", "share", "jupyter", "kernels", "xr", "resources" ) - files <- setdiff(list.files(here), "setup.R") + files <- setdiff(list.files(here), c("setup.R", "routines.R")) xeus_env$.xeus_call <- function(fn, ...) { get(fn, envir = xeus_private_env)(...) @@ -26,5 +26,6 @@ local({ for (f in files) { sys.source(file.path(here, f), envir = xeus_private_env) } + sys.source(file.path(here, "routines.R"), envir = xeus_env) })