gnucash master: Multiple changes pushed

Geert Janssens gjanssens at code.gnucash.org
Sat Dec 7 03:17:09 EST 2019


Updated	 via  https://github.com/Gnucash/gnucash/commit/f52c581d (commit)
	 via  https://github.com/Gnucash/gnucash/commit/633f2e30 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/7f636741 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/88706e56 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/e8451ae1 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/c1493c8c (commit)
	 via  https://github.com/Gnucash/gnucash/commit/d52aa0a0 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/90aa5399 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/43647c7a (commit)
	 via  https://github.com/Gnucash/gnucash/commit/0de3dc6b (commit)
	 via  https://github.com/Gnucash/gnucash/commit/4c77f767 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/95b81844 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/b96dc6ff (commit)
	 via  https://github.com/Gnucash/gnucash/commit/bd311d5d (commit)
	 via  https://github.com/Gnucash/gnucash/commit/25cce83f (commit)
	 via  https://github.com/Gnucash/gnucash/commit/ee722b85 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/c00bf6bc (commit)
	 via  https://github.com/Gnucash/gnucash/commit/5a650ad5 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/63e89aec (commit)
	 via  https://github.com/Gnucash/gnucash/commit/043c6367 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/8aed43ec (commit)
	 via  https://github.com/Gnucash/gnucash/commit/2c616621 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/331039cd (commit)
	 via  https://github.com/Gnucash/gnucash/commit/fbd73c83 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/6eb0ccfa (commit)
	 via  https://github.com/Gnucash/gnucash/commit/096a5151 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/6a3505d0 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/9ed96213 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/d777128e (commit)
	 via  https://github.com/Gnucash/gnucash/commit/759bbe1d (commit)
	 via  https://github.com/Gnucash/gnucash/commit/9b803428 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/0a635fad (commit)
	 via  https://github.com/Gnucash/gnucash/commit/2e1b9f93 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/04f10d66 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/c46c9682 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/02511401 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/77f669f1 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/48f3195e (commit)
	 via  https://github.com/Gnucash/gnucash/commit/e940ce85 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/3d4cc63d (commit)
	 via  https://github.com/Gnucash/gnucash/commit/1c7f835f (commit)
	 via  https://github.com/Gnucash/gnucash/commit/b1ba16c3 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/49bf27fa (commit)
	 via  https://github.com/Gnucash/gnucash/commit/a6b7eecd (commit)
	 via  https://github.com/Gnucash/gnucash/commit/a1898daf (commit)
	 via  https://github.com/Gnucash/gnucash/commit/ad8c3882 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/36c19b40 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/94fc5233 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/28fa4c64 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/18093b5e (commit)
	 via  https://github.com/Gnucash/gnucash/commit/33e1ff64 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/e493d42d (commit)
	 via  https://github.com/Gnucash/gnucash/commit/a0aa1058 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/f5e28c3d (commit)
	 via  https://github.com/Gnucash/gnucash/commit/cb273b13 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/543fab25 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/9f5cbb3a (commit)
	 via  https://github.com/Gnucash/gnucash/commit/02afa33e (commit)
	 via  https://github.com/Gnucash/gnucash/commit/efefac3e (commit)
	 via  https://github.com/Gnucash/gnucash/commit/f039cc80 (commit)
	from  https://github.com/Gnucash/gnucash/commit/69898647 (commit)



commit f52c581ddc5750f69a9bdd5333c8fdf1e7a9bb26
Merge: 633f2e300 7f6367410
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat Dec 7 09:15:48 2019 +0100

    Merge branch 'dropgml'


commit 633f2e30011c09c68e4261ff6e18fe9acc6c7c6a
Merge: 698986472 9b803428e
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat Dec 7 09:15:39 2019 +0100

    Merge branch 'splitreg_copyops'


commit 7f6367410e2f98b57dc5078fae77a20812b8cec0
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Fri Dec 6 20:16:34 2019 +0100

    price quotes - move scm file from bindings to gnucash
    
    This isn't wrapping anything really.
    As discussed with John on PR#611

diff --git a/bindings/guile/CMakeLists.txt b/bindings/guile/CMakeLists.txt
index 6237635e3..0dca2e680 100644
--- a/bindings/guile/CMakeLists.txt
+++ b/bindings/guile/CMakeLists.txt
@@ -137,17 +137,10 @@ gnc_add_scheme_targets(scm-gnc-module
     FALSE
 )
 
-gnc_add_scheme_targets(price-quotes
-    price-quotes.scm
-    gnucash
-    "scm-engine;scm-app-utils;scm-gnome-utils"
-    FALSE)
-
 set_local_dist(guile_DIST_local
     CMakeLists.txt
     core-utils.scm
     gnc-module.scm
-    price-quotes.scm
     ${guile_SOURCES}
     ${guile_HEADERS}
     ${engine_SCHEME_0}
diff --git a/gnucash/CMakeLists.txt b/gnucash/CMakeLists.txt
index a205f02e8..3de5c204a 100644
--- a/gnucash/CMakeLists.txt
+++ b/gnucash/CMakeLists.txt
@@ -250,9 +250,16 @@ foreach(gres_file ${gresource_files})
   list(APPEND gresource_files ${rel_file})
 endforeach()
 
+
+gnc_add_scheme_targets(price-quotes
+    price-quotes.scm
+    gnucash
+    "scm-engine;scm-app-utils;scm-gnome-utils"
+    FALSE)
+
 set_local_dist(gnucash_DIST_local CMakeLists.txt environment.in generate-gnc-script
                gnucash-bin.c gnucash.rc.in gnucash-valgrind.in gnucash-gresources.xml ${gresource_files}
-               ${gnucash_EXTRA_DIST})
+               price-quotes.scm ${gnucash_EXTRA_DIST})
 
 set (gnucash_DIST ${gnucash_DIST_local} ${gnome_DIST} ${gnome_search_DIST} ${gnome_utils_DIST}
     ${gschemas_DIST} ${gtkbuilder_DIST} ${html_DIST} ${import_export_DIST} ${python_DIST} ${register_DIST}
diff --git a/bindings/guile/price-quotes.scm b/gnucash/price-quotes.scm
similarity index 100%
rename from bindings/guile/price-quotes.scm
rename to gnucash/price-quotes.scm
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 511f81b1c..0d90a0458 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -11,7 +11,6 @@ bindings/guile/gnc-guile-utils.c
 bindings/guile/gnc-kvp-guile.cpp
 bindings/guile/gnc-module.scm
 bindings/guile/gnc-numeric.scm
-bindings/guile/price-quotes.scm
 bindings/guile/utilities.scm
 borrowed/goffice/go-charmap-sel.c
 borrowed/goffice/go-glib-extras.c
@@ -383,6 +382,7 @@ gnucash/import-export/qif-imp/qif-parse.scm
 gnucash/import-export/qif-imp/qif-to-gnc.scm
 gnucash/import-export/qif-imp/qif-utils.scm
 gnucash/import-export/qif-imp/string.scm
+gnucash/price-quotes.scm
 gnucash/python/gncmod-python.c
 gnucash/register/ledger-core/gncEntryLedger.c
 gnucash/register/ledger-core/gncEntryLedgerControl.c

commit 88706e565758fddb09fdf8455a4de73f0d38c5a1
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Wed Nov 27 16:18:56 2019 +0100

    bindings/guile - remove gnc-module wrapper
    
    Emit appropriate deprecation warnings in case code tries to invoke the removed functions.
    Only for gnc:module-load a more elaborate compat function has
    been written which should allow code using this obsolete function
    to continue to function. The emitted deprecation warning will
    guide the user to update his/her code for future compatibility.

diff --git a/bindings/CMakeLists.txt b/bindings/CMakeLists.txt
index 99e2ca73b..651037956 100644
--- a/bindings/CMakeLists.txt
+++ b/bindings/CMakeLists.txt
@@ -6,6 +6,5 @@ set_local_dist(bindings_DIST_local
     business-core.i
     core-utils.i
     engine.i
-    engine-common.i
-    gnc-module.i)
+    engine-common.i)
 set(bindings_DIST ${bindings_DIST_local} ${guile_DIST} ${python_bindings_DIST} PARENT_SCOPE)
diff --git a/bindings/gnc-module.i b/bindings/gnc-module.i
deleted file mode 100644
index e3913b728..000000000
--- a/bindings/gnc-module.i
+++ /dev/null
@@ -1,39 +0,0 @@
-/********************************************************************\
- * This program is free software; you can redistribute it and/or    *
- * modify it under the terms of the GNU General Public License as   *
- * published by the Free Software Foundation; either version 2 of   *
- * the License, or (at your option) any later version.              *
- *                                                                  *
- * This program is distributed in the hope that it will be useful,  *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
- * GNU General Public License for more details.                     *
- *                                                                  *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact:                        *
- *                                                                  *
- * Free Software Foundation           Voice:  +1-617-542-5942       *
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
- * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
- *                                                                  *
-\********************************************************************/
-
-%module sw_gnc_module
-%{
-#include <gnc-module.h>
-%}
-#if defined(SWIGGUILE)
-%{
-#include "guile-mappings.h"
-
-SCM scm_init_sw_gnc_module_module (void);
-%}
-#endif
-
-%import "base-typemaps.i"
-
-void            gnc_module_system_init(void);
-void            gnc_module_system_refresh(void);
-GNCModule       gnc_module_load(gchar * module_name, gint interface);
-GNCModule       gnc_module_load_optional(gchar * module_name, gint interface);
-int             gnc_module_unload(GNCModule mod);
diff --git a/bindings/guile/CMakeLists.txt b/bindings/guile/CMakeLists.txt
index ced12f94d..6237635e3 100644
--- a/bindings/guile/CMakeLists.txt
+++ b/bindings/guile/CMakeLists.txt
@@ -20,15 +20,6 @@ gnc_add_swig_guile_command (swig-engine-c
     ${CMAKE_SOURCE_DIR}/bindings/engine-common.i
 )
 
-# Command to generate the swig-gnc-module.c wrapper file
-gnc_swig_extract_header_files (gnc-module GNC_MODULE_HEADERS)
-gnc_add_swig_guile_command (swig-gnc-module-c
-    SWIG_GNC_MODULE_C swig-gnc-module.c
-    ${CMAKE_SOURCE_DIR}/bindings/gnc-module.i
-    "${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_SOURCE_DIR}/libgnucash/gnc-module"
-    ${GNC_MODULE_HEADERS}
-)
-
 set(guile_HEADERS
     glib-guile.h
     gnc-engine-guile.h
@@ -46,8 +37,7 @@ add_library(gnucash-guile SHARED
     ${guile_SOURCES}
     ${guile_HEADERS}
     ${SWIG_CORE_UTILS_GUILE_C}
-    ${SWIG_ENGINE_C}
-    ${SWIG_GNC_MODULE_C})
+    ${SWIG_ENGINE_C})
 
 add_dependencies(gnucash-guile
     swig-runtime-h)
@@ -67,7 +57,6 @@ target_link_libraries(gnucash-guile
     PRIVATE
         gnc-core-utils
         gnc-engine
-        gnc-module
         ${GLIB2_LDFLAGS})
 
 install(TARGETS gnucash-guile
@@ -139,7 +128,6 @@ gnc_add_scheme_targets(scm-engine-2
 add_custom_target(scm-engine ALL DEPENDS scm-engine-2 scm-engine-1 scm-engine-0)
 
 set(scm_gnc_module_DEPENDS
-    gnc-module
     gnucash-guile)
 
 gnc_add_scheme_targets(scm-gnc-module
diff --git a/bindings/guile/gnc-guile-bindings.c b/bindings/guile/gnc-guile-bindings.c
index 424d31daf..4d40df5cd 100644
--- a/bindings/guile/gnc-guile-bindings.c
+++ b/bindings/guile/gnc-guile-bindings.c
@@ -34,7 +34,6 @@ static int is_initialized = 0;
 
 extern SCM scm_init_sw_core_utils_module (void);
 extern SCM scm_init_sw_engine_module (void);
-extern SCM scm_init_sw_gnc_module_module (void);
 
 void
 gnc_guile_bindings_init(void)
@@ -44,7 +43,6 @@ gnc_guile_bindings_init(void)
         /* Do what's necessary to initialize the bindings */
         scm_init_sw_core_utils_module();
         scm_init_sw_engine_module();
-        scm_init_sw_gnc_module_module();
 
         is_initialized = 1;
     }
diff --git a/bindings/guile/gnc-module.scm b/bindings/guile/gnc-module.scm
index 9785e8bae..d47cff6f2 100644
--- a/bindings/guile/gnc-module.scm
+++ b/bindings/guile/gnc-module.scm
@@ -27,23 +27,50 @@
 
 (define-module (gnucash gnc-module))
 
-;; Guile 2 needs to find the symbols from the extension at compile time already
-(eval-when
-      (compile load eval expand)
-      (load-extension "libgnucash-guile" "gnc_guile_bindings_init"))
-(use-modules (sw_gnc_module))
+(define (no-op-deprecation-warning)
+    (issue-deprecation-warning "* WARNING * Guile wrappers for the gnc module system have been deprecated.")
+    (issue-deprecation-warning "This particular function call is now a no-op. Please use equivalent (use-modules ...) calls instead."))
 
-; Export the swig-wrapped symbols in the public interface of this module
-(let ((i (module-public-interface (current-module))))
-     (module-use! i (resolve-interface '(sw_gnc_module))))
-
-(define-public gnc:module-system-init gnc-module-system-init)
-(define-public gnc:module-system-refresh gnc-module-system-refresh)
-(define-public gnc:module-load gnc-module-load)
-(define-public gnc:module-load-optional gnc-module-load-optional)
-(define-public gnc:module-unload gnc-module-unload)
-
-;; Guile 2 needs to load external modules at compile time
-(define-syntax-rule (gnc:module-begin-syntax form ...)
-      (eval-when (load compile eval expand) (begin form ...)))
-(export gnc:module-begin-syntax)
+(define-public (gnc:module-system-init)
+    (no-op-deprecation-warning))
+(define-public (gnc:module-system-refresh)
+    (no-op-deprecation-warning))
+(define-public (gnc:module-load-optional)
+    (no-op-deprecation-warning))
+(define-public (gnc:module-unload)
+    (no-op-deprecation-warning))
+(define-public (gnc:module-load gnc-mod-name mod-sys-version)
+    (let* ((mod-name-split (string-split gnc-mod-name #\/))
+           (mod-name-str (string-join mod-name-split " "))
+           (scm-mod-name (map string->symbol mod-name-split)))
+        (cond
+            ((string=? gnc-mod-name "gnucash/app-utils")
+             (issue-deprecation-warning "* WARNING * 'gnc:module-load (\"gnucash/app-utils\" 0)' has been deprecated and will be removed in gnucash 5.0.")
+             (issue-deprecation-warning "Use '(use-modules (gnucash engine)(gnucash app-utils))' instead.")
+             (issue-deprecation-warning "Use of the '(gnucash engine)' guile module is optional and depends on whether or not you use functions from this module in your code or not.")
+             (use-modules (gnucash engine)(gnucash app-utils)))
+            ((or
+                (string=? gnc-mod-name "gnucash/tax/de_DE")
+                (string=? gnc-mod-name "gnucash/tax/us"))
+             (set! scm-mod-name (list 'gnucash 'locale (list-ref scm-mod-name 2) 'tax))
+             (set! mod-name-str (string-join (map symbol->string scm-mod-name) " "))
+             (issue-deprecation-warning (string-concatenate (list "* WARNING * '(gnc:module-load \"" gnc-mod-name "\" 0)' has been deprecated.")))
+             (issue-deprecation-warning (string-concatenate (list "Use '(use-modules (" mod-name-str "))' instead.")))
+             (module-use! (current-module) (resolve-interface scm-mod-name)))
+            ((or
+                (string=? gnc-mod-name "gnucash/gnome-utils")
+                (string=? gnc-mod-name "gnucash/html")
+                (string=? gnc-mod-name "gnucash/report/report-system"))
+             (when (string=? gnc-mod-name"gnucash/report/report-system")
+                (set! mod-name-str "gnucash report"))
+                (set! scm-mod-name (list 'gnucash 'report))
+             (issue-deprecation-warning (string-concatenate (list "* WARNING * '(gnc:module-load \"" gnc-mod-name "\" 0)' has been deprecated.")))
+             (issue-deprecation-warning (string-concatenate (list "Use '(use-modules (gnucash engine)(gnucash app-utils)(" mod-name-str "))' instead.")))
+             (issue-deprecation-warning "Use of the '(gnucash engine)' or '(gnucash app-utils)' guile modules is optional and depends on whether or not you use functions from this module in your code or not.")
+             (use-modules (gnucash engine)(gnucash app-utils))
+             (module-use! (current-module) (resolve-interface scm-mod-name)))
+            (else
+             (issue-deprecation-warning (string-concatenate (list "* WARNING * '(gnc:module-load \"" gnc-mod-name "\" 0)' has been deprecated.")))
+             (issue-deprecation-warning (string-concatenate ( list "Use '(use-modules (" mod-name-str "))' instead.")))
+             (issue-deprecation-warning "Additional guile modules may have to be loaded depending on your specific code.")
+             (module-use! (current-module) (resolve-interface scm-mod-name))))))
diff --git a/bindings/guile/test/CMakeLists.txt b/bindings/guile/test/CMakeLists.txt
index 17be2b82c..41485785b 100644
--- a/bindings/guile/test/CMakeLists.txt
+++ b/bindings/guile/test/CMakeLists.txt
@@ -1,9 +1,5 @@
 # C(++) tests requiring a proper guile environment set up
 
-add_subdirectory(mod-foo)
-add_subdirectory(mod-bar)
-add_subdirectory(mod-baz)
-
 set(ENGINE_TEST_INCLUDE_DIRS
     ${CMAKE_SOURCE_DIR}/libgnucash/backend/xml
     ${CMAKE_SOURCE_DIR}/libgnucash/engine
@@ -115,43 +111,6 @@ if (HAVE_SRFI64)
 
 endif (HAVE_SRFI64)
 
-
-set (test_gnc_module_SCHEME
-    test-gnc-module-scm-init.scm
-    test-gnc-module-load-scm.scm
-    test-gnc-module-swigged-c.scm
-    test-gnc-module-load-deps.scm
-    test-gnc-module-scm-dynload.scm
-    test-gnc-module-scm-module.scm
-    test-gnc-module-scm-multi.scm
-)
-
-set (test_gnc_module_DEPENDS
-    scm-gnc-module
-    scm-test-core
-    scm-mod-foo
-    gncmod-bar
-    scm-mod-baz
-)
-
-gnc_add_scheme_test_targets (test-gnc-modules-scm
-    "${test_gnc_module_SCHEME}"
-    "tests"
-    "${test_gnc_module_DEPENDS}"
-    TRUE
-)
-gnc_add_scheme_tests ("${test_gnc_module_SCHEME}")
-if(NOT WIN32)
-  # This little dance is needed because gnc_module_init will assert if
-  # it finds libgncmod-futuremod.so outside of a test that expects it.
-  get_guile_env()
-  set(_GNC_MODULE_PATH "${LIBDIR_BUILD}:${LIBDIR_BUILD}/gnucash:${LIBDIR_BUILD}/gnucash/test")
-  foreach(test_file ${test_gnc_module_SCHEME})
-    get_filename_component(basename ${test_file} NAME_WE)
-    set_tests_properties(${basename} PROPERTIES ENVIRONMENT "${GUILE_ENV};GNC_MODULE_PATH=${_GNC_MODULE_PATH}")
-  endforeach()
-endif()
-
 set(test_engine_SCHEME_DIST
     srfi64-extras.scm
     ${bindings_test_SCHEME}
@@ -164,14 +123,10 @@ set_local_dist(test_guile_DIST_local
     CMakeLists.txt
     test-scm-query.cpp
     ${test_engine_SCHEME_DIST}
-    ${test_gnc_module_SCHEME}
     ${test_scm_SCHEME}
 )
 set(test_guile_DIST
     ${test_guile_DIST_local}
-    ${mod_bar_DIST}
-    ${mod_baz_DIST}
-    ${mod_foo_DIST}
     PARENT_SCOPE
 )
 
diff --git a/bindings/guile/test/mod-bar/CMakeLists.txt b/bindings/guile/test/mod-bar/CMakeLists.txt
deleted file mode 100644
index 3b70c9f3e..000000000
--- a/bindings/guile/test/mod-bar/CMakeLists.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-
-gnc_add_swig_guile_command (swig-bar-c
-    SWIG_BAR_C swig-bar.c
-    ${CMAKE_CURRENT_SOURCE_DIR}/bar.i "" bar.h
-)
-
-add_library(bar EXCLUDE_FROM_ALL bar.c bar.h)
-add_library(gncmod-bar EXCLUDE_FROM_ALL gnc-mod-bar.c)
-set_source_files_properties (gnc-mod-bar.c PROPERTY OBJECT_DEPENDS ${SWIG_BAR_C})
-
-target_link_libraries(gncmod-bar bar gnc-module)
-target_include_directories(gncmod-bar PRIVATE
-  ${CMAKE_BINARY_DIR}/common
-  ${CMAKE_CURRENT_SOURCE_DIR}
-  ${CMAKE_CURRENT_BINARY_DIR}
-  ${CMAKE_SOURCE_DIR}/common
-  ${CMAKE_SOURCE_DIR}/libgnucash/gnc-module
-  ${GLIB2_INCLUDE_DIRS}
-  ${GUILE_INCLUDE_DIRS}
-)
-
-gnc_add_scheme_test_targets(scm-mod-bar
-  gnucash/bar.scm
-  "tests/gnucash"
-  gncmod-bar
-  FALSE
-  )
-
-set_target_properties(bar gncmod-bar PROPERTIES
-  LIBRARY_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
-  ARCHIVE_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
-  RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/test
-  )
-
-set_dist_list(mod_bar_DIST CMakeLists.txt bar.c gnucash/bar.scm bar.h bar.i gnc-mod-bar.c)
diff --git a/bindings/guile/test/mod-bar/bar.c b/bindings/guile/test/mod-bar/bar.c
deleted file mode 100644
index 9c45f6b87..000000000
--- a/bindings/guile/test/mod-bar/bar.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* libfoo.  this is a dependency-free client library, equivalent to
- * the engine or some other core component that's ignorant of guile
- * and the module system */
-/********************************************************************\
- * This program is free software; you can redistribute it and/or    *
- * modify it under the terms of the GNU General Public License as   *
- * published by the Free Software Foundation; either version 2 of   *
- * the License, or (at your option) any later version.              *
- *                                                                  *
- * This program is distributed in the hope that it will be useful,  *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
- * GNU General Public License for more details.                     *
- *                                                                  *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact:                        *
- *                                                                  *
- * Free Software Foundation           Voice:  +1-617-542-5942       *
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
- * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
- *                                                                  *
-\********************************************************************/
-
-
-#include <stdio.h>
-
-#include "bar.h"
-
-int
-bar_hello(void)
-{
-    return 1;
-}
diff --git a/bindings/guile/test/mod-bar/bar.h b/bindings/guile/test/mod-bar/bar.h
deleted file mode 100644
index e52398f99..000000000
--- a/bindings/guile/test/mod-bar/bar.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* bar.h: header for a dependency-free, guile-free client lib */
-/********************************************************************\
- * This program is free software; you can redistribute it and/or    *
- * modify it under the terms of the GNU General Public License as   *
- * published by the Free Software Foundation; either version 2 of   *
- * the License, or (at your option) any later version.              *
- *                                                                  *
- * This program is distributed in the hope that it will be useful,  *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
- * GNU General Public License for more details.                     *
- *                                                                  *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact:                        *
- *                                                                  *
- * Free Software Foundation           Voice:  +1-617-542-5942       *
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
- * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
- *                                                                  *
-\********************************************************************/
-
-
-#ifndef BAR_H
-#define BAR_H
-
-int bar_hello(void);
-
-#endif
diff --git a/bindings/guile/test/mod-bar/bar.i b/bindings/guile/test/mod-bar/bar.i
deleted file mode 100644
index 5e3666f9d..000000000
--- a/bindings/guile/test/mod-bar/bar.i
+++ /dev/null
@@ -1,33 +0,0 @@
-/********************************************************************\
- * This program is free software; you can redistribute it and/or    *
- * modify it under the terms of the GNU General Public License as   *
- * published by the Free Software Foundation; either version 2 of   *
- * the License, or (at your option) any later version.              *
- *                                                                  *
- * This program is distributed in the hope that it will be useful,  *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
- * GNU General Public License for more details.                     *
- *                                                                  *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact:                        *
- *                                                                  *
- * Free Software Foundation           Voice:  +1-617-542-5942       *
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
- * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
- *                                                                  *
-\********************************************************************/
-
-%module sw_bar
-%{
-#include <bar.h>
-%}
-#if defined(SWIGGUILE)
-%{
-#include "guile-mappings.h"
-
-SCM scm_init_sw_bar_module (void);
-%}
-#endif
-
-int bar_hello(void);
diff --git a/bindings/guile/test/mod-bar/gnc-mod-bar.c b/bindings/guile/test/mod-bar/gnc-mod-bar.c
deleted file mode 100644
index a5fba1001..000000000
--- a/bindings/guile/test/mod-bar/gnc-mod-bar.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/* gnc-mod-bar.c : the Gnucash plugin that wraps the library
- * 'libbar.so'. it does this by being linked against libbar.so */
-/********************************************************************\
- * This program is free software; you can redistribute it and/or    *
- * modify it under the terms of the GNU General Public License as   *
- * published by the Free Software Foundation; either version 2 of   *
- * the License, or (at your option) any later version.              *
- *                                                                  *
- * This program is distributed in the hope that it will be useful,  *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
- * GNU General Public License for more details.                     *
- *                                                                  *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact:                        *
- *                                                                  *
- * Free Software Foundation           Voice:  +1-617-542-5942       *
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
- * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
- *                                                                  *
-\********************************************************************/
-
-
-#include <config.h>
-#include <stdio.h>
-#include <gmodule.h>
-#include <libguile.h>
-
-#include "gnc-module-api.h"
-#include "swig-bar.c"
-
-GNC_MODULE_API_DECL(libgncmod_bar)
-
-int libgncmod_bar_gnc_module_system_interface = 0;
-
-int libgncmod_bar_gnc_module_current = 0;
-int libgncmod_bar_gnc_module_age = 0;
-int libgncmod_bar_gnc_module_revision = 0;
-
-char *
-libgncmod_bar_gnc_module_path(void)
-{
-    return g_strdup("gnucash/bar");
-}
-
-char *
-libgncmod_bar_gnc_module_description(void)
-{
-    return g_strdup("this is a bar module");
-}
-
-int
-libgncmod_bar_gnc_module_init(int refcount)
-{
-    /* publish the wrapped Scheme bindings for libbar */
-    scm_init_sw_bar_module();
-    scm_c_eval_string("(use-modules (sw_bar))");
-
-    /* use the Scheme "bar" module */
-    scm_c_eval_string("(use-modules (gnucash bar))");
-
-    return TRUE;
-}
diff --git a/bindings/guile/test/mod-bar/gnucash/bar.scm b/bindings/guile/test/mod-bar/gnucash/bar.scm
deleted file mode 100644
index 881190bea..000000000
--- a/bindings/guile/test/mod-bar/gnucash/bar.scm
+++ /dev/null
@@ -1,31 +0,0 @@
-;; test of a Scheme module called gnc-mod-bar, which should get 
-;; loaded by the Gnucash module "bar"
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; This program is free software; you can redistribute it and/or
-;; modify it under the terms of the GNU General Public License as
-;; published by the Free Software Foundation; either version 2 of
-;; the License, or (at your option) any later version.
-;;
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
-;;
-;; You should have received a copy of the GNU General Public License
-;; along with this program; if not, contact:
-;;
-;; Free Software Foundation           Voice:  +1-617-542-5942
-;; 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652
-;; Boston, MA  02110-1301,  USA       gnu at gnu.org
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-
-(define-module (gnucash bar))
-
-(export bar:scheme-hello)
-
-(define (bar:scheme-hello)
-  #t)
-
-
-
diff --git a/bindings/guile/test/mod-baz/CMakeLists.txt b/bindings/guile/test/mod-baz/CMakeLists.txt
deleted file mode 100644
index 04ef81f9a..000000000
--- a/bindings/guile/test/mod-baz/CMakeLists.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-
-gnc_add_swig_guile_command (swig-baz-c
-    SWIG_BAZ_C swig-baz.c
-    ${CMAKE_CURRENT_SOURCE_DIR}/baz.i "" baz.h
-)
-
-add_library(baz EXCLUDE_FROM_ALL baz.c baz.h)
-target_include_directories(baz PRIVATE
-  ${CMAKE_SOURCE_DIR}/bindings/guile/test/mod-foo
-)
-target_link_libraries(baz foo)
-
-
-add_library(gncmod-baz EXCLUDE_FROM_ALL gnc-mod-baz.c)
-set_source_files_properties (gnc-mod-baz.c PROPERTY OBJECT_DEPENDS ${SWIG_BAZ_C})
-
-target_link_libraries(gncmod-baz baz gnc-module)
-target_include_directories(gncmod-baz PRIVATE
-  ${CMAKE_BINARY_DIR}/common
-  ${CMAKE_CURRENT_SOURCE_DIR}
-  ${CMAKE_CURRENT_BINARY_DIR}
-  ${CMAKE_SOURCE_DIR}/common
-  ${CMAKE_SOURCE_DIR}/libgnucash/gnc-module
-  ${GLIB2_INCLUDE_DIRS}
-  ${GUILE_INCLUDE_DIRS}
-)
-
-gnc_add_scheme_test_targets(scm-mod-baz
-  gnucash/baz.scm
-  "tests/gnucash"
-  gncmod-baz
-  FALSE
-  )
-
-set_target_properties(baz gncmod-baz PROPERTIES
-LIBRARY_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
-ARCHIVE_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
-RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/test)
-
-set_dist_list(mod_baz_DIST CMakeLists.txt baz.c gnucash/baz.scm baz.h baz.i gnc-mod-baz.c)
diff --git a/bindings/guile/test/mod-baz/baz.c b/bindings/guile/test/mod-baz/baz.c
deleted file mode 100644
index 1c809954b..000000000
--- a/bindings/guile/test/mod-baz/baz.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* libbaz.  this library depends on foo */
-/********************************************************************\
- * This program is free software; you can redistribute it and/or    *
- * modify it under the terms of the GNU General Public License as   *
- * published by the Free Software Foundation; either version 2 of   *
- * the License, or (at your option) any later version.              *
- *                                                                  *
- * This program is distributed in the hope that it will be useful,  *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
- * GNU General Public License for more details.                     *
- *                                                                  *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact:                        *
- *                                                                  *
- * Free Software Foundation           Voice:  +1-617-542-5942       *
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
- * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
- *                                                                  *
-\********************************************************************/
-
-
-#include <stdio.h>
-
-#include "baz.h"
-#include "foo.h"
-
-int
-baz_hello(void)
-{
-    foo_hello();
-    return 1;
-}
-
diff --git a/bindings/guile/test/mod-baz/baz.h b/bindings/guile/test/mod-baz/baz.h
deleted file mode 100644
index 3aaa6760a..000000000
--- a/bindings/guile/test/mod-baz/baz.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* baz.h: header for a dependency-free, guile-free client lib */
-/********************************************************************\
- * This program is free software; you can redistribute it and/or    *
- * modify it under the terms of the GNU General Public License as   *
- * published by the Free Software Foundation; either version 2 of   *
- * the License, or (at your option) any later version.              *
- *                                                                  *
- * This program is distributed in the hope that it will be useful,  *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
- * GNU General Public License for more details.                     *
- *                                                                  *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact:                        *
- *                                                                  *
- * Free Software Foundation           Voice:  +1-617-542-5942       *
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
- * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
- *                                                                  *
-\********************************************************************/
-
-
-#ifndef BAZ_H
-#define BAZ_H
-
-int baz_hello(void);
-
-#endif
diff --git a/bindings/guile/test/mod-baz/baz.i b/bindings/guile/test/mod-baz/baz.i
deleted file mode 100644
index e16ec52de..000000000
--- a/bindings/guile/test/mod-baz/baz.i
+++ /dev/null
@@ -1,33 +0,0 @@
-/********************************************************************\
- * This program is free software; you can redistribute it and/or    *
- * modify it under the terms of the GNU General Public License as   *
- * published by the Free Software Foundation; either version 2 of   *
- * the License, or (at your option) any later version.              *
- *                                                                  *
- * This program is distributed in the hope that it will be useful,  *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
- * GNU General Public License for more details.                     *
- *                                                                  *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact:                        *
- *                                                                  *
- * Free Software Foundation           Voice:  +1-617-542-5942       *
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
- * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
- *                                                                  *
-\********************************************************************/
-
-%module sw_baz
-%{
-#include <baz.h>
-%}
-#if defined(SWIGGUILE)
-%{
-#include "guile-mappings.h"
-
-SCM scm_init_sw_baz_module (void);
-%}
-#endif
-
-int baz_hello(void);
diff --git a/bindings/guile/test/mod-baz/gnc-mod-baz.c b/bindings/guile/test/mod-baz/gnc-mod-baz.c
deleted file mode 100644
index d15442d6d..000000000
--- a/bindings/guile/test/mod-baz/gnc-mod-baz.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* gnc-mod-baz.c : the Gnucash plugin that wraps the library
- * 'libbaz.so'. it does this by being linked against libbaz.so */
-/********************************************************************\
- * This program is free software; you can redistribute it and/or    *
- * modify it under the terms of the GNU General Public License as   *
- * published by the Free Software Foundation; either version 2 of   *
- * the License, or (at your option) any later version.              *
- *                                                                  *
- * This program is distributed in the hope that it will be useful,  *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
- * GNU General Public License for more details.                     *
- *                                                                  *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact:                        *
- *                                                                  *
- * Free Software Foundation           Voice:  +1-617-542-5942       *
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
- * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
- *                                                                  *
-\********************************************************************/
-
-
-#include <config.h>
-#include <stdio.h>
-#include <gmodule.h>
-#include <libguile.h>
-
-#include "gnc-module.h"
-#include "gnc-module-api.h"
-#include "swig-baz.c"
-
-GNC_MODULE_API_DECL(libgncmod_baz)
-
-int libgncmod_baz_gnc_module_system_interface = 0;
-
-int libgncmod_baz_gnc_module_current = 0;
-int libgncmod_baz_gnc_module_age = 0;
-int libgncmod_baz_gnc_module_revision = 0;
-
-char *
-libgncmod_baz_gnc_module_path(void)
-{
-    return g_strdup("gnucash/baz");
-}
-
-char *
-libgncmod_baz_gnc_module_description(void)
-{
-    return g_strdup("this is the baz module");
-}
-
-int
-libgncmod_baz_gnc_module_init(int refcount)
-{
-    /* load libfoo */
-    if (gnc_module_load("gnucash/foo", 0))
-    {
-        /* publish the wrapped Scheme bindings for libbaz */
-        scm_init_sw_baz_module();
-        scm_c_eval_string("(use-modules (sw_baz))");
-
-        /* use the Scheme "baz" module */
-        scm_c_eval_string("(use-modules (gnucash baz))");
-
-        return TRUE;
-    }
-    else
-    {
-        return FALSE;
-    }
-}
diff --git a/bindings/guile/test/mod-baz/gnucash/baz.scm b/bindings/guile/test/mod-baz/gnucash/baz.scm
deleted file mode 100644
index 7b38f3539..000000000
--- a/bindings/guile/test/mod-baz/gnucash/baz.scm
+++ /dev/null
@@ -1,31 +0,0 @@
-;; test of a Scheme module called gnc-mod-baz, which should get 
-;; loaded by the Gnucash module "baz"
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; This program is free software; you can redistribute it and/or
-;; modify it under the terms of the GNU General Public License as
-;; published by the Free Software Foundation; either version 2 of
-;; the License, or (at your option) any later version.
-;;
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
-;;
-;; You should have received a copy of the GNU General Public License
-;; along with this program; if not, contact:
-;;
-;; Free Software Foundation           Voice:  +1-617-542-5942
-;; 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652
-;; Boston, MA  02110-1301,  USA       gnu at gnu.org
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-
-(define-module (gnucash baz))
-
-(export baz:scheme-hello)
-
-(define (baz:scheme-hello)
-  #t)
-
-
-
diff --git a/bindings/guile/test/mod-foo/CMakeLists.txt b/bindings/guile/test/mod-foo/CMakeLists.txt
deleted file mode 100644
index 6de0b79d9..000000000
--- a/bindings/guile/test/mod-foo/CMakeLists.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-
-gnc_add_swig_guile_command (swig-foo-c
-    SWIG_FOO_C swig-foo.c
-    ${CMAKE_CURRENT_SOURCE_DIR}/foo.i "" foo.h
-)
-
-add_library(foo EXCLUDE_FROM_ALL foo.c foo.h)
-add_library(gncmod-foo EXCLUDE_FROM_ALL gnc-mod-foo.c)
-set_source_files_properties (gnc-mod-foo.c PROPERTY OBJECT_DEPENDS ${SWIG_FOO_C})
-
-target_link_libraries(gncmod-foo foo gnc-module)
-target_include_directories(gncmod-foo PRIVATE
-  ${CMAKE_BINARY_DIR}/common
-  ${CMAKE_CURRENT_SOURCE_DIR}
-  ${CMAKE_CURRENT_BINARY_DIR}
-  ${CMAKE_SOURCE_DIR}/common
-  ${CMAKE_SOURCE_DIR}/libgnucash/gnc-module
-  ${GLIB2_INCLUDE_DIRS}
-  ${GUILE_INCLUDE_DIRS}
-)
-
-gnc_add_scheme_test_targets(scm-mod-foo
-  gnucash/foo.scm
-  "tests/gnucash"
-  gncmod-foo
-  FALSE
-  )
-
-set_target_properties(foo gncmod-foo PROPERTIES
-LIBRARY_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
-ARCHIVE_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
-RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/test)
-
-set_dist_list(mod_foo_DIST CMakeLists.txt foo.i gnucash/foo.scm foo.c foo.h gnc-mod-foo.c)
diff --git a/bindings/guile/test/mod-foo/foo.c b/bindings/guile/test/mod-foo/foo.c
deleted file mode 100644
index 889f61f42..000000000
--- a/bindings/guile/test/mod-foo/foo.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* libfoo.  this is a dependency-free client library, equivalent to
- * the engine or some other core component that's ignorant of guile
- * and the module system */
-/********************************************************************\
- * This program is free software; you can redistribute it and/or    *
- * modify it under the terms of the GNU General Public License as   *
- * published by the Free Software Foundation; either version 2 of   *
- * the License, or (at your option) any later version.              *
- *                                                                  *
- * This program is distributed in the hope that it will be useful,  *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
- * GNU General Public License for more details.                     *
- *                                                                  *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact:                        *
- *                                                                  *
- * Free Software Foundation           Voice:  +1-617-542-5942       *
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
- * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
- *                                                                  *
-\********************************************************************/
-
-
-#include <stdio.h>
-
-#include "foo.h"
-
-int
-foo_hello(void)
-{
-    return 10;
-}
diff --git a/bindings/guile/test/mod-foo/foo.h b/bindings/guile/test/mod-foo/foo.h
deleted file mode 100644
index b462323bf..000000000
--- a/bindings/guile/test/mod-foo/foo.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* foo.h: header for a dependency-free, guile-free client lib */
-/********************************************************************\
- * This program is free software; you can redistribute it and/or    *
- * modify it under the terms of the GNU General Public License as   *
- * published by the Free Software Foundation; either version 2 of   *
- * the License, or (at your option) any later version.              *
- *                                                                  *
- * This program is distributed in the hope that it will be useful,  *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
- * GNU General Public License for more details.                     *
- *                                                                  *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact:                        *
- *                                                                  *
- * Free Software Foundation           Voice:  +1-617-542-5942       *
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
- * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
- *                                                                  *
-\********************************************************************/
-
-
-#ifndef FOO_H
-#define FOO_H
-
-int foo_hello(void);
-
-#endif
diff --git a/bindings/guile/test/mod-foo/foo.i b/bindings/guile/test/mod-foo/foo.i
deleted file mode 100644
index 5c883a712..000000000
--- a/bindings/guile/test/mod-foo/foo.i
+++ /dev/null
@@ -1,33 +0,0 @@
-/********************************************************************\
- * This program is free software; you can redistribute it and/or    *
- * modify it under the terms of the GNU General Public License as   *
- * published by the Free Software Foundation; either version 2 of   *
- * the License, or (at your option) any later version.              *
- *                                                                  *
- * This program is distributed in the hope that it will be useful,  *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
- * GNU General Public License for more details.                     *
- *                                                                  *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact:                        *
- *                                                                  *
- * Free Software Foundation           Voice:  +1-617-542-5942       *
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
- * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
- *                                                                  *
-\********************************************************************/
-
-%module sw_foo
-%{
-#include <foo.h>
-%}
-#if defined(SWIGGUILE)
-%{
-#include "guile-mappings.h"
-
-SCM scm_init_sw_foo_module (void);
-%}
-#endif
-
-int foo_hello(void);
diff --git a/bindings/guile/test/mod-foo/gnc-mod-foo.c b/bindings/guile/test/mod-foo/gnc-mod-foo.c
deleted file mode 100644
index f41cc9549..000000000
--- a/bindings/guile/test/mod-foo/gnc-mod-foo.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/* gnc-mod-foo.c : the Gnucash plugin that wraps the library
- * 'libfoo.so'. it does this by being linked against libfoo.so */
-/********************************************************************\
- * This program is free software; you can redistribute it and/or    *
- * modify it under the terms of the GNU General Public License as   *
- * published by the Free Software Foundation; either version 2 of   *
- * the License, or (at your option) any later version.              *
- *                                                                  *
- * This program is distributed in the hope that it will be useful,  *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
- * GNU General Public License for more details.                     *
- *                                                                  *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact:                        *
- *                                                                  *
- * Free Software Foundation           Voice:  +1-617-542-5942       *
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
- * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
- *                                                                  *
-\********************************************************************/
-
-
-#include <config.h>
-#include <stdio.h>
-#include <gmodule.h>
-#include <libguile.h>
-
-#include "gnc-module-api.h"
-#include "swig-foo.c"
-
-GNC_MODULE_API_DECL(libgncmod_foo)
-
-int libgncmod_foo_gnc_module_system_interface = 0;
-
-int libgncmod_foo_gnc_module_current = 0;
-int libgncmod_foo_gnc_module_age = 0;
-int libgncmod_foo_gnc_module_revision = 0;
-
-char *
-libgncmod_foo_gnc_module_path(void)
-{
-    return g_strdup("gnucash/foo");
-}
-
-char *
-libgncmod_foo_gnc_module_description(void)
-{
-    return g_strdup("this is a foo module");
-}
-
-int
-libgncmod_foo_gnc_module_init(int refcount)
-{
-    /* publish the wrapped Scheme bindings for libfoo */
-    scm_init_sw_foo_module();
-    scm_c_eval_string("(use-modules (sw_foo))");
-
-    /* use the Scheme "foo" module */
-    scm_c_eval_string("(use-modules (gnucash foo))");
-
-    return TRUE;
-}
diff --git a/bindings/guile/test/mod-foo/gnucash/foo.scm b/bindings/guile/test/mod-foo/gnucash/foo.scm
deleted file mode 100644
index 6d2d1c666..000000000
--- a/bindings/guile/test/mod-foo/gnucash/foo.scm
+++ /dev/null
@@ -1,31 +0,0 @@
-;; test of a Scheme module called gnc-mod-foo, which should get 
-;; loaded by the Gnucash module "foo"
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; This program is free software; you can redistribute it and/or
-;; modify it under the terms of the GNU General Public License as
-;; published by the Free Software Foundation; either version 2 of
-;; the License, or (at your option) any later version.
-;;
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
-;;
-;; You should have received a copy of the GNU General Public License
-;; along with this program; if not, contact:
-;;
-;; Free Software Foundation           Voice:  +1-617-542-5942
-;; 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652
-;; Boston, MA  02110-1301,  USA       gnu at gnu.org
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-
-(define-module (gnucash foo))
-
-(export foo:scheme-hello)
-
-(define (foo:scheme-hello)
-  #t)
-
-
-
diff --git a/bindings/guile/test/test-create-account.scm b/bindings/guile/test/test-create-account.scm
index d816d2bc4..b97228981 100644
--- a/bindings/guile/test/test-create-account.scm
+++ b/bindings/guile/test/test-create-account.scm
@@ -20,12 +20,10 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash engine))
 
 (define (run-test)
   (setenv "GNC_UNINSTALLED" "1")
-  (gnc:module-system-init)
 
   (let* ((session (qof-session-new))
          (book (qof-session-get-book session))
diff --git a/bindings/guile/test/test-gnc-module-load-deps.scm b/bindings/guile/test/test-gnc-module-load-deps.scm
deleted file mode 100755
index 16a55ced0..000000000
--- a/bindings/guile/test/test-gnc-module-load-deps.scm
+++ /dev/null
@@ -1,11 +0,0 @@
-(use-modules (gnucash gnc-module))
-
-(gnc:module-system-init)
-(gnc:module-load "gnucash/baz" 0)
-
-(baz-hello)
-(foo-hello)
-(baz:scheme-hello)
-(foo:scheme-hello)
-
-(exit 0)
diff --git a/bindings/guile/test/test-gnc-module-load-scm.scm b/bindings/guile/test/test-gnc-module-load-scm.scm
deleted file mode 100755
index 37443f081..000000000
--- a/bindings/guile/test/test-gnc-module-load-scm.scm
+++ /dev/null
@@ -1,6 +0,0 @@
-(use-modules (gnucash gnc-module))
-
-(gnc:module-system-init)
-(gnc:module-load "gnucash/foo" 0)
-
-(exit 0)
diff --git a/bindings/guile/test/test-gnc-module-scm-dynload.scm b/bindings/guile/test/test-gnc-module-scm-dynload.scm
deleted file mode 100755
index 8d7a82a74..000000000
--- a/bindings/guile/test/test-gnc-module-scm-dynload.scm
+++ /dev/null
@@ -1,2 +0,0 @@
-(dynamic-link "libgnc-module")
-(exit 0)
diff --git a/bindings/guile/test/test-gnc-module-scm-init.scm b/bindings/guile/test/test-gnc-module-scm-init.scm
deleted file mode 100755
index 7a6685ac8..000000000
--- a/bindings/guile/test/test-gnc-module-scm-init.scm
+++ /dev/null
@@ -1,5 +0,0 @@
-(use-modules (gnucash gnc-module))
-
-(gnc:module-system-init)
-
-(exit 0)
diff --git a/bindings/guile/test/test-gnc-module-scm-module.scm b/bindings/guile/test/test-gnc-module-scm-module.scm
deleted file mode 100755
index 47e7dc430..000000000
--- a/bindings/guile/test/test-gnc-module-scm-module.scm
+++ /dev/null
@@ -1,6 +0,0 @@
-(use-modules (gnucash gnc-module))
-
-(gnc:module-system-init)
-(if (not (gnc:module-load "gnucash/foo" 0)) (exit -1))
-
-(exit (foo:scheme-hello))
diff --git a/bindings/guile/test/test-gnc-module-scm-multi.scm b/bindings/guile/test/test-gnc-module-scm-multi.scm
deleted file mode 100755
index edebd9bec..000000000
--- a/bindings/guile/test/test-gnc-module-scm-multi.scm
+++ /dev/null
@@ -1,14 +0,0 @@
-(use-modules (gnucash gnc-module))
-
-(gnc:module-system-init)
-(gnc:module-load "gnucash/foo" 0)
-(foo-hello)
-(foo:scheme-hello)
-
-(gnc:module-load "gnucash/bar" 0)
-(foo-hello)
-(foo:scheme-hello)
-(bar-hello)
-(bar:scheme-hello)
-
-(exit 0)
diff --git a/bindings/guile/test/test-gnc-module-swigged-c.scm b/bindings/guile/test/test-gnc-module-swigged-c.scm
deleted file mode 100755
index a74e68ff3..000000000
--- a/bindings/guile/test/test-gnc-module-swigged-c.scm
+++ /dev/null
@@ -1,5 +0,0 @@
-(use-modules (gnucash gnc-module))
-
-(gnc:module-system-init)
-(gnc:module-load "gnucash/foo" 0)
-(exit (eq? 10 (foo-hello)))
diff --git a/bindings/guile/test/test-scm-query-import.scm b/bindings/guile/test/test-scm-query-import.scm
index 9f30797a3..ace8885bd 100644
--- a/bindings/guile/test/test-scm-query-import.scm
+++ b/bindings/guile/test/test-scm-query-import.scm
@@ -20,12 +20,10 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash engine))
 
 (define (run-test)
   (setenv "GNC_UNINSTALLED" "1")
-  (gnc:module-system-init)
 
   (display "\tTesting the Query Import interface... \n")
   (display "\tYou may see \"Error: xaccQueryAddGUIDMatch: Invalid match type\".\n")
diff --git a/common/cmake_modules/GncAddTest.cmake b/common/cmake_modules/GncAddTest.cmake
index 5a0ca004f..caa918f9c 100644
--- a/common/cmake_modules/GncAddTest.cmake
+++ b/common/cmake_modules/GncAddTest.cmake
@@ -32,9 +32,6 @@ function(get_guile_env)
   list(APPEND env "GUILE=${GUILE_EXECUTABLE}")
 
   set(guile_load_paths "")
-  list(APPEND guile_load_paths "${CMAKE_CURRENT_SOURCE_DIR}/mod-foo")
-  list(APPEND guile_load_paths "${CMAKE_CURRENT_SOURCE_DIR}/mod-bar")
-  list(APPEND guile_load_paths "${CMAKE_CURRENT_SOURCE_DIR}/mod-baz")
   #list(APPEND guile_load_paths "${CMAKE_BINARY_DIR}/${GUILE_REL_SITEDIR}")
   list(APPEND guile_load_paths "${CMAKE_BINARY_DIR}/${GUILE_REL_SITEDIR}/gnucash/deprecated") # Path to gnucash' deprecated modules
   set(guile_load_path "${guile_load_paths}")
diff --git a/gnucash/gnome-utils/test/test-load-gnome-utils-module.scm b/gnucash/gnome-utils/test/test-load-gnome-utils-module.scm
index 530eb66b5..8eaab5595 100755
--- a/gnucash/gnome-utils/test/test-load-gnome-utils-module.scm
+++ b/gnucash/gnome-utils/test/test-load-gnome-utils-module.scm
@@ -1,14 +1,21 @@
+(define exit-code 0)
 (setenv "GNC_UNINSTALLED" "1")
-(use-modules (gnucash gnc-module))
-(gnc:module-system-init)
 
 (display "  testing gnome-utils module load ... ")
-(if (gnc:module-load "gnucash/gnome-utils" 0)
+(use-modules (gnucash gnome-utils))
 
-   (begin 
-      (display "ok\n")
-      (exit 0))
-    (begin 
-      (display "failed\n")
-      (exit 1)))
+(cond
+    ((defined? 'gnc:make-menu)
+        (display "Procedure gnc:make-menu found\n"))
+    (else
+        (display "Failed - procedure gnc:make-menu not found\n")
+        (set! exit-code -1)))
 
+(cond
+    ((defined? 'gnc:set-ui-status)
+        (display "Procedure gnc:set-ui-status found\n"))
+    (else
+        (display "Failed - procedure gnc:set-ui-status not found\n")
+        (set! exit-code -1)))
+
+(exit exit-code)
diff --git a/gnucash/report/test/test-load-report-module.scm b/gnucash/report/test/test-load-report-module.scm
index 270fe4b9a..9c59a8fb5 100755
--- a/gnucash/report/test/test-load-report-module.scm
+++ b/gnucash/report/test/test-load-report-module.scm
@@ -1,17 +1,21 @@
-(debug-enable 'backtrace)
-
-(debug-set! stack 500000)
+(define exit-code 0)
+(setenv "GNC_UNINSTALLED" "1")
 
 (display "  testing report module load ... ")
-(setenv "GNC_UNINSTALLED" "1")
-(use-modules (gnucash gnc-module))
+(use-modules (gnucash report))
+
+(cond
+    ((defined? 'gnc:define-report)
+        (display "Procedure gnc:define-report found\n"))
+    (else
+        (display "Failed - procedure gnc:define-report not found\n")
+        (set! exit-code -1)))
 
-(gnc:module-system-init)
+(cond
+    ((defined? 'gnc:make-html-chart)
+        (display "Procedure gnc:make-html-chart found\n"))
+    (else
+      (display "Failed - procedure gnc:make-html-chart not found\n")
+      (set! exit-code -1)))
 
-(if (gnc:module-load "gnucash/report" 0)
-    (begin 
-      (display "ok\n")
-      (exit 0))
-    (begin 
-      (display "failed\n")
-      (exit -1)))
+(exit exit-code)

commit e8451ae1db9c180d5f8c6fd4e5ece2a3fda6a17d
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Nov 26 21:30:28 2019 +0100

    tax - remove gncmod boilerplate
    
    This is now an ordinary shared library
    
    * Remove test to load the gnc-module in scheme
    * Rewrite test to load the module in C to actually test something.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 169ecd43d..4ff9a2e20 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -868,7 +868,7 @@ configure_file(
 add_custom_target(uninstall
         COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
 
-set(_MODULES gnc-core-utils gnc-engine gnc-app-utils gnc-module gnc-backend-xml-utils gnucash-guile)
+set(_MODULES gnc-core-utils gnc-engine gnc-app-utils gnc-module gnc-locale-tax gnc-backend-xml-utils gnucash-guile)
 
 if (WITH_SQL)
   list(APPEND _MODULES gnc-backend-sql)
diff --git a/gnucash/gnome/CMakeLists.txt b/gnucash/gnome/CMakeLists.txt
index c8e319e45..5bb755117 100644
--- a/gnucash/gnome/CMakeLists.txt
+++ b/gnucash/gnome/CMakeLists.txt
@@ -145,6 +145,7 @@ target_link_libraries(gnc-gnome
     gncmod-register-core
     gncmod-gnome-utils
     gnc-engine
+    gnc-locale-tax
     gnucash-guile
     ${Boost_LIBRARIES}
     PkgConfig::GTK3
diff --git a/gnucash/gnome/dialog-tax-info.c b/gnucash/gnome/dialog-tax-info.c
index 464c69395..787ba6e2a 100644
--- a/gnucash/gnome/dialog-tax-info.c
+++ b/gnucash/gnome/dialog-tax-info.c
@@ -36,6 +36,7 @@
 #include "Account.h"
 #include "gnc-ui-util.h"
 #include "dialog-utils.h"
+#include "gnc-locale-tax.h"
 #include "gnc-prefs.h"
 #include "gnc-tree-view-account.h"
 #include "gnc-component-manager.h"
@@ -145,10 +146,8 @@ typedef struct
 static void
 initialize_getters (void)
 {
-    if (!gnc_module_load("gnucash/locale/tax", 0))
-    {
-        return;
-    }
+    gnc_locale_tax_init();
+
     getters.payer_name_source = scm_c_eval_string ("gnc:txf-get-payer-name-source");
     getters.form              = scm_c_eval_string ("gnc:txf-get-form");
     getters.description       = scm_c_eval_string ("gnc:txf-get-description");
diff --git a/libgnucash/app-utils/CMakeLists.txt b/libgnucash/app-utils/CMakeLists.txt
index 81562e4f7..96eafc2c0 100644
--- a/libgnucash/app-utils/CMakeLists.txt
+++ b/libgnucash/app-utils/CMakeLists.txt
@@ -74,6 +74,7 @@ set(app_utils_ALL_SOURCES ${app_utils_SOURCES} ${app_utils_HEADERS} ${app_utils_
 set(app_utils_ALL_LIBRARIES
     gnc-engine
     gnc-module
+    gnc-locale-tax
     gnucash-guile
     ${GIO_LDFLAGS}
     ${LIBXML2_LDFLAGS}
diff --git a/libgnucash/app-utils/gnc-ui-util.c b/libgnucash/app-utils/gnc-ui-util.c
index 924119bf8..483d532bf 100644
--- a/libgnucash/app-utils/gnc-ui-util.c
+++ b/libgnucash/app-utils/gnc-ui-util.c
@@ -53,6 +53,7 @@
 #include "gnc-engine.h"
 #include "gnc-euro.h"
 #include "gnc-hooks.h"
+#include "gnc-locale-tax.h"
 #include "gnc-session.h"
 #include "engine-helpers.h"
 #include "gnc-locale-utils.h"
@@ -625,14 +626,9 @@ gnc_ui_account_get_tax_info_string (const Account *account)
 
         if (get_form == SCM_UNDEFINED)
         {
-            GNCModule module;
             const gchar *tax_module;
-            /* load the tax info
-               Note that the module "gnucash/locale/tax" will handle selecting
-               the proper locale specific tax info */
-            module = gnc_module_load ("gnucash/locale/tax", 0);
-
-            g_return_val_if_fail (module, NULL);
+            /* load the tax info */
+            gnc_locale_tax_init ();
 
             get_form = scm_c_eval_string
                        ("(false-if-exception gnc:txf-get-form)");
diff --git a/libgnucash/tax/CMakeLists.txt b/libgnucash/tax/CMakeLists.txt
index 82751602e..b0f0560fa 100644
--- a/libgnucash/tax/CMakeLists.txt
+++ b/libgnucash/tax/CMakeLists.txt
@@ -1,23 +1,24 @@
 add_subdirectory(test)
 
-set(locale_tax_SOURCES gncmod-locale-tax.c)
+set(locale_tax_SOURCES gnc-locale-tax.c gnc-locale-tax.h)
 
 # Add dependency on config.h
 set_source_files_properties (${locale_tax_SOURCES} PROPERTIES OBJECT_DEPENDS ${CONFIG_H})
 
-add_library(gncmod-locale-tax ${locale_tax_SOURCES})
-target_link_libraries(gncmod-locale-tax gnc-module ${GLIB2_LDFLAGS} ${GUILE_LDFLAGS})
+add_library(gnc-locale-tax ${locale_tax_SOURCES})
+target_link_libraries(gnc-locale-tax gnc-module ${GLIB2_LDFLAGS} ${GUILE_LDFLAGS})
 
-target_include_directories(gncmod-locale-tax
+target_include_directories(gnc-locale-tax
+    PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
     PRIVATE ${CMAKE_BINARY_DIR}/common ${GUILE_INCLUDE_DIRS})
 
 if (APPLE)
-  set_target_properties (gncmod-locale-tax PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/gnucash")
+  set_target_properties (gnc-locale-tax PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}")
 endif()
 
-install(TARGETS gncmod-locale-tax
-  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/gnucash
-  ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/gnucash
+install(TARGETS gnc-locale-tax
+  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+  ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
   RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
 # No headers to install
 
diff --git a/libgnucash/tax/gnc-locale-tax.c b/libgnucash/tax/gnc-locale-tax.c
index 10751575e..f40e22318 100644
--- a/libgnucash/tax/gnc-locale-tax.c
+++ b/libgnucash/tax/gnc-locale-tax.c
@@ -1,8 +1,8 @@
 /*********************************************************************
- * gncmod-locale-tax.c
- * module definition/initialization for us tax info
+ * gnc-locale-tax.c
+ * hack to load the proper guile based tax system
  *
- * Copyright (c) 2001 Linux Developers Group, Inc.
+ * Copyright (c) 2019 Geert Janssens <geert at kobaltwit.be>
  *********************************************************************/
 /********************************************************************\
  * This program is free software; you can redistribute it and/or    *
@@ -28,45 +28,15 @@
 #include <config.h>
 #include <string.h>
 #include <locale.h>
-#include <gmodule.h>
 #include <libguile.h>
+#include <glib.h>
 
-#include "gnc-module.h"
-#include "gnc-module-api.h"
+#include "gnc-locale-tax.h"
 
-GNC_MODULE_API_DECL(libgncmod_locale_tax)
 
-/* version of the gnc module system interface we require */
-int libgncmod_locale_tax_gnc_module_system_interface = 0;
 
-/* module versioning uses libtool semantics. */
-int libgncmod_locale_tax_gnc_module_current  = 0;
-int libgncmod_locale_tax_gnc_module_revision = 0;
-int libgncmod_locale_tax_gnc_module_age      = 0;
-
-
-char *
-libgncmod_locale_tax_gnc_module_path(void)
-{
-    return g_strdup("gnucash/locale/tax");
-}
-
-char *
-libgncmod_locale_tax_gnc_module_description(void)
-{
-    return g_strdup("Locale dependent income tax information. Currently supported are 'us' and 'de_DE'. Default is 'us'");
-}
-
-static void
-lmod(char * mn)
-{
-    char * form = g_strdup_printf("(use-modules %s)\n", mn);
-    scm_c_eval_string(form);
-    g_free(form);
-}
-
-int
-libgncmod_locale_tax_gnc_module_init(int refcount)
+void
+gnc_locale_tax_init(void)
 {
     /* This is a very simple hack that loads the (new, special) German
        tax definition file in a German locale, or (default) loads the
@@ -80,14 +50,7 @@ libgncmod_locale_tax_gnc_module_init(int refcount)
     gboolean is_de_DE = (strncmp(thislocale, "de_DE", 5) == 0);
 # endif /* G_OS_WIN32 */
     if (is_de_DE)
-        lmod("(gnucash locale de_DE tax)");
+        scm_c_use_module("gnucash locale de_DE tax");
     else
-        lmod("(gnucash locale us tax)");
-    return TRUE;
-}
-
-int
-libgncmod_locale_tax_gnc_module_end(int refcount)
-{
-    return TRUE;
+        scm_c_use_module("gnucash locale us tax");
 }
diff --git a/libgnucash/tax/gnc-locale-tax.h b/libgnucash/tax/gnc-locale-tax.h
new file mode 100644
index 000000000..0e6de189a
--- /dev/null
+++ b/libgnucash/tax/gnc-locale-tax.h
@@ -0,0 +1,30 @@
+/*********************************************************************
+ * gnc-locale-tax.h -
+ * a simple hack to load the proper guile base tax system
+ *
+ * Copyright 2019 Geert Janssens <geert at kobaltwit.be>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, contact:
+ *
+ * Free Software Foundation           Voice:  +1-617-542-5942
+ * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652
+ * Boston, MA  02110-1301,  USA       gnu at gnu.org
+ ********************************************************************/
+
+#ifndef GNC_LOCALE_TAX_H_
+#define GNC_LOCALE_TAX_H_
+
+void gnc_locale_tax_init (void);
+
+#endif
diff --git a/libgnucash/tax/test/CMakeLists.txt b/libgnucash/tax/test/CMakeLists.txt
index 5156048a7..eceeced2a 100644
--- a/libgnucash/tax/test/CMakeLists.txt
+++ b/libgnucash/tax/test/CMakeLists.txt
@@ -1,22 +1,10 @@
-set(LOCALE_TAX_TEST_INCLUDE_DIRS "")
-set(LOCALE_TAX_TEST_LIBS "")
+set(LOCALE_TAX_TEST_INCLUDE_DIRS ${GUILE_INCLUDE_DIRS})
+set(LOCALE_TAX_TEST_LIBS
+    gnc-engine
+    gnc-locale-tax
+    ${GUILE_LDFLAGS})
 
-gnc_add_test(test-link-module-tax-us test-link-module.c
-  LOCALE_TAX_TEST_INCLUDE_DIRS LOCALE_TAX_TEST_LIBS
-)
+gnc_add_test_with_guile(test-link-module-tax-us test-link-module.c
+LOCALE_TAX_TEST_INCLUDE_DIRS LOCALE_TAX_TEST_LIBS)
 
-# FIXME why is this test not run ?
-#set(GUILE_DEPENDS
-#  gnc-core-utils
-#  scm-gnc-module
-#)
-#
-#gnc_add_scheme_test_targets(scm-test-load-tax-us-module
-#  "test-load-locale-tax-module.scm"
-#  "tests"
-#  "${GUILE_DEPENDS}"
-#  FALSE
-#)
-#gnc_add_scheme_test(test-load-locale-tax-module.scm)
-
-set_dist_list(test_locale_tax_DIST CMakeLists.txt test-link-module.c test-load-locale-tax-module.scm)
+set_dist_list(test_locale_tax_DIST CMakeLists.txt test-link-module.c)
diff --git a/libgnucash/tax/test/test-link-module.c b/libgnucash/tax/test/test-link-module.c
index e1c54dcc5..58e07e944 100644
--- a/libgnucash/tax/test/test-link-module.c
+++ b/libgnucash/tax/test/test-link-module.c
@@ -18,9 +18,30 @@
  *                                                                  *
 \********************************************************************/
 
+#include "gnc-locale-tax.h"
+
+#include <config.h>
+#include <glib.h>
+#include <qof.h>
+#include <libguile.h>
+
+static void
+guile_main (void *closure, int argc, char **argv)
+{
+    gnc_locale_tax_init();
+
+    scm_c_lookup ("gnc:txf-get-description");
+}
+
 int
-main(int argc, char ** argv)
+main (int argc, char *argv[])
 {
+    qof_init (); 			/* Initialize the GObject system */
+    qof_log_init_filename_special ("stderr"); /* Init the log system */
+    g_test_init (&argc, &argv, NULL); 	/* initialize test program */
+    //qof_log_set_level("gnc", G_LOG_LEVEL_DEBUG);
+    g_test_bug_base("https://bugs.gnucash.org/show_bug.cgi?id="); /* init the bugzilla URL */
+    g_setenv ("GNC_UNINSTALLED", "1", TRUE);
+    scm_boot_guile (argc, argv, guile_main, NULL);
     return 0;
 }
-
diff --git a/libgnucash/tax/test/test-load-locale-tax-module.scm b/libgnucash/tax/test/test-load-locale-tax-module.scm
deleted file mode 100755
index 336142ba3..000000000
--- a/libgnucash/tax/test/test-load-locale-tax-module.scm
+++ /dev/null
@@ -1,11 +0,0 @@
-(display "  testing locale tax info module load ... ")
-(use-modules (gnucash gnc-module))
-(gnc:module-system-init)
-
-(if (gnc:module-load "gnucash/locale/tax" 0)
-    (begin 
-      (display "ok\n")
-      (exit 0))
-    (begin 
-      (display "failed\n")
-      (exit -1)))
diff --git a/libgnucash/tax/us/txf.scm b/libgnucash/tax/us/txf.scm
index c08866132..7065a826d 100644
--- a/libgnucash/tax/us/txf.scm
+++ b/libgnucash/tax/us/txf.scm
@@ -41,6 +41,7 @@
 
 
 (use-modules (gnucash engine))
+(use-modules (gnucash core-utils))
 (use-modules (gnucash app-utils))
 (use-modules (srfi srfi-2))
 
diff --git a/po/POTFILES.in b/po/POTFILES.in
index c54d4bbf6..511f81b1c 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -690,7 +690,7 @@ libgnucash/gnc-module/gnc-module.c
 libgnucash/tax/de_DE/tax.scm
 libgnucash/tax/de_DE/txf-help.scm
 libgnucash/tax/de_DE/txf.scm
-libgnucash/tax/gncmod-locale-tax.c
+libgnucash/tax/gnc-locale-tax.c
 libgnucash/tax/us/tax.scm
 libgnucash/tax/us/txf-help.scm
 libgnucash/tax/us/txf.scm

commit c1493c8c8545159fc6c3104aee3be1362d656af5
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Wed Nov 27 09:28:48 2019 +0100

    cleanup - use guile's C interface to load modules when in C context
    
    That should be slightly more efficient than having it first
    parse a string.

diff --git a/gnucash/gnome-utils/gncmod-gnome-utils.c b/gnucash/gnome-utils/gncmod-gnome-utils.c
index 97dde32e2..79f316411 100644
--- a/gnucash/gnome-utils/gncmod-gnome-utils.c
+++ b/gnucash/gnome-utils/gncmod-gnome-utils.c
@@ -56,22 +56,14 @@ libgncmod_gnome_utils_gnc_module_description(void)
     return g_strdup("Utilities for using Gnome/Gtk with GnuCash");
 }
 
-static void
-lmod(char * mn)
-{
-    char * form = g_strdup_printf("(use-modules %s)\n", mn);
-    scm_c_eval_string(form);
-    g_free(form);
-}
-
 extern SCM scm_init_sw_gnome_utils_module(void);
 
 int
 libgncmod_gnome_utils_gnc_module_init(int refcount)
 {
     scm_init_sw_gnome_utils_module();
-    lmod("(sw_gnome_utils)");
-    lmod("(gnucash gnome-utils)");
+    scm_c_use_module ("sw_gnome_utils");
+    scm_c_use_module("gnucash gnome-utils");
 
     /* Initialize the options-ui database */
     if (refcount == 0)
diff --git a/gnucash/html/gncmod-html.c b/gnucash/html/gncmod-html.c
index b62cd8060..31629d009 100644
--- a/gnucash/html/gncmod-html.c
+++ b/gnucash/html/gncmod-html.c
@@ -60,14 +60,6 @@ libgncmod_html_gnc_module_description( void )
     return g_strdup( "Utilities for using HTML with GnuCash" );
 }
 
-static void
-lmod( char* mn )
-{
-    char* form = g_strdup_printf( "(use-modules %s)\n", mn );
-    scm_c_eval_string( form );
-    g_free( form );
-}
-
 extern SCM scm_init_sw_gnc_html_module( void );
 
 int
@@ -75,8 +67,7 @@ libgncmod_html_gnc_module_init( int refcount )
 {
     scm_init_sw_gnc_html_module();
     gnc_html_initialize();
-    lmod( "(sw_gnc_html)" );
-//	lmod( "(gnucash gnc_html)" );
+    scm_c_use_module( "sw_gnc_html" );
 
     return TRUE;
 }
diff --git a/gnucash/import-export/qif-imp/gncmod-qif-import.c b/gnucash/import-export/qif-imp/gncmod-qif-import.c
index 2bcb9e606..0d51884a8 100644
--- a/gnucash/import-export/qif-imp/gncmod-qif-import.c
+++ b/gnucash/import-export/qif-imp/gncmod-qif-import.c
@@ -76,7 +76,7 @@ libgncmod_qif_import_gnc_module_init(int refcount)
         ((void (*)())gnc_file_qif_import);
     }
 
-    scm_c_eval_string("(use-modules (gnucash qif-import))");
+    scm_c_use_module("gnucash qif-import");
 
     gnc_plugin_qif_import_create_plugin();
 
diff --git a/gnucash/report/gncmod-report.c b/gnucash/report/gncmod-report.c
index 8f2fe4656..e65236ee6 100644
--- a/gnucash/report/gncmod-report.c
+++ b/gnucash/report/gncmod-report.c
@@ -62,7 +62,7 @@ libgncmod_report_gnc_module_init(int refcount)
 {
     scm_init_sw_report_module();
 
-    scm_c_eval_string("(use-modules (gnucash report))");
+    scm_c_use_module ("gnucash report");
 
     /* if this is the first time the module's being loaded, initialize
      * the relative date system */

commit d52aa0a0dd8de839d9889afbc2b3d4b8f6eb5d81
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Nov 26 18:27:13 2019 +0100

    app-utils - remove gnc-module boilerplate
    
    app-utils now is an ordinery shared library
    
    A few bits worth mentioning:
    1. it's not guile-free just yet, so instead of a gnc_module_load
       your code may have to call scm_c_use_module("gnucash app-utils");
       to expose the scm side of the app-utils api. This call has been
       added to gnucash-bin.c for example
    2. while lots of noise in this commit is to rename from gncmodule-app-utils
       to gnc-app-utils, I'll point out the library has also been moved from
       <libdir>/gnucash to <libdir>. This required changes in app-util's
       CMakeLists.txt file for the install side and in the top level
       CMakeLists.txt file for the build directory structure.
    3. The C side link module test has been removed as linking an ordinary
       shared library should be considered well tested by the compiler devs.
       The scheme side module load test has been slightly tweaked to no longer
       try to use gnc:module-load, but instead now checks whether the app-utils
       api is properly exposed to scheme after loading it via use-modules.
    4. Dropped a completely obsolete README file.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5b3544bac..169ecd43d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -868,7 +868,7 @@ configure_file(
 add_custom_target(uninstall
         COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
 
-set(_MODULES gnc-core-utils gnc-engine gnc-module gnc-backend-xml-utils gnucash-guile)
+set(_MODULES gnc-core-utils gnc-engine gnc-app-utils gnc-module gnc-backend-xml-utils gnucash-guile)
 
 if (WITH_SQL)
   list(APPEND _MODULES gnc-backend-sql)
diff --git a/bindings/python/CMakeLists.txt b/bindings/python/CMakeLists.txt
index 79775f28e..b8619fafc 100644
--- a/bindings/python/CMakeLists.txt
+++ b/bindings/python/CMakeLists.txt
@@ -76,7 +76,7 @@ if(WITH_PYTHON)
   add_library(gnucash_core_c MODULE ${SWIG_GNUCASH_CORE_C})
   target_include_directories(gnucash_core_c PRIVATE ${gnucash_core_c_INCLUDE_DIRS})
 
-  target_link_libraries(gnucash_core_c gncmod-app-utils gnc-engine gnc-module ${GLIB_LIBS} ${PYTHON_LIBRARIES})
+  target_link_libraries(gnucash_core_c gnc-app-utils gnc-engine gnc-module ${GLIB_LIBS} ${PYTHON_LIBRARIES})
   set_target_properties(gnucash_core_c PROPERTIES PREFIX "_")
   target_compile_options(gnucash_core_c PRIVATE -Wno-implicit -Wno-missing-prototypes -Wno-declaration-after-statement -Wno-missing-declarations)
   if (HAVE_STRINGOP_TRUNCATION)
@@ -84,7 +84,7 @@ if(WITH_PYTHON)
   endif()
 
   add_executable(sqlite3test EXCLUDE_FROM_ALL sqlite3test.c ${SWIG_GNUCASH_CORE_C})
-  target_link_libraries(sqlite3test gncmod-app-utils gnc-engine gnc-module ${GLIB_LIBS} ${PYTHON_LIBRARIES})
+  target_link_libraries(sqlite3test gnc-app-utils gnc-engine gnc-module ${GLIB_LIBS} ${PYTHON_LIBRARIES})
   target_include_directories(sqlite3test PRIVATE ${gnucash_core_c_INCLUDE_DIRS})
   target_compile_options(sqlite3test PRIVATE -Wno-implicit -Wno-missing-prototypes -Wno-declaration-after-statement -Wno-missing-declarations)
   if (HAVE_STRINGOP_TRUNCATION)
diff --git a/gnucash/CMakeLists.txt b/gnucash/CMakeLists.txt
index 3d70de63d..a205f02e8 100644
--- a/gnucash/CMakeLists.txt
+++ b/gnucash/CMakeLists.txt
@@ -51,7 +51,7 @@ if (BUILDING_FROM_VCS)
 endif (BUILDING_FROM_VCS)
 
 target_link_libraries (gnucash
-   gncmod-ledger-core gnc-gnome gncmod-gnome-utils gncmod-app-utils
+   gncmod-ledger-core gnc-gnome gncmod-gnome-utils gnc-app-utils
    gnc-engine gnc-module gnc-core-utils gncmod-report gnucash-guile
    PkgConfig::GTK3 ${GUILE_LDFLAGS} ${GLIB2_LDFLAGS} ${GTK_MAC_LDFLAGS}
 )
diff --git a/gnucash/gnome-utils/CMakeLists.txt b/gnucash/gnome-utils/CMakeLists.txt
index 31846fc79..7b5dfd48e 100644
--- a/gnucash/gnome-utils/CMakeLists.txt
+++ b/gnucash/gnome-utils/CMakeLists.txt
@@ -207,7 +207,7 @@ add_library (gncmod-gnome-utils
 )
 
 target_link_libraries(gncmod-gnome-utils
-    gncmod-app-utils
+    gnc-app-utils
     gnc-engine
     gnc-backend-xml-utils
     gnucash-guile
diff --git a/gnucash/gnome-utils/gncmod-gnome-utils.c b/gnucash/gnome-utils/gncmod-gnome-utils.c
index 0d901bd85..97dde32e2 100644
--- a/gnucash/gnome-utils/gncmod-gnome-utils.c
+++ b/gnucash/gnome-utils/gncmod-gnome-utils.c
@@ -26,17 +26,12 @@
 
 
 #include <config.h>
-
-#include <gmodule.h>
 #include <libguile.h>
 
-#include "gnc-module.h"
 #include "gnc-module-api.h"
 
 #include "gnc-component-manager.h"
 #include "dialog-options.h"
-#include "qof.h"
-#include "gnc-gui-query.h"
 
 GNC_MODULE_API_DECL(libgncmod_gnome_utils)
 
@@ -74,11 +69,6 @@ extern SCM scm_init_sw_gnome_utils_module(void);
 int
 libgncmod_gnome_utils_gnc_module_init(int refcount)
 {
-    if (!gnc_module_load("gnucash/app-utils", 0))
-    {
-        return FALSE;
-    }
-
     scm_init_sw_gnome_utils_module();
     lmod("(sw_gnome_utils)");
     lmod("(gnucash gnome-utils)");
diff --git a/gnucash/gnome-utils/test/CMakeLists.txt b/gnucash/gnome-utils/test/CMakeLists.txt
index 509777b33..03be6eb42 100644
--- a/gnucash/gnome-utils/test/CMakeLists.txt
+++ b/gnucash/gnome-utils/test/CMakeLists.txt
@@ -31,7 +31,7 @@ set(GUILE_DEPENDS
   scm-gnome-utils
   test-core
   gncmod-test-engine
-  gncmod-app-utils
+  gnc-app-utils
   gnc-core-utils
   gnc-engine
 )
diff --git a/gnucash/gnucash-bin.c b/gnucash/gnucash-bin.c
index b77bf3514..f946ffadd 100644
--- a/gnucash/gnucash-bin.c
+++ b/gnucash/gnucash-bin.c
@@ -487,7 +487,6 @@ load_gnucash_modules()
         gboolean optional;
     } modules[] =
     {
-        { "gnucash/app-utils", 0, FALSE },
         { "gnucash/gnome-utils", 0, FALSE },
         { "gnucash/gnome-search", 0, FALSE },
         { "gnucash/register/ledger-core", 0, FALSE },
@@ -602,10 +601,12 @@ inner_main (void *closure, int argc, char **argv)
     SCM main_mod;
     char* fn = NULL;
 
+
     scm_c_eval_string("(debug-set! stack 200000)");
 
     main_mod = scm_c_resolve_module("gnucash utilities");
     scm_set_current_module(main_mod);
+    scm_c_use_module("gnucash app-utils");
 
     /* Check whether the settings need a version update */
     gnc_gsettings_version_upgrade ();
diff --git a/gnucash/html/gncmod-html.c b/gnucash/html/gncmod-html.c
index 8a4d08277..b62cd8060 100644
--- a/gnucash/html/gncmod-html.c
+++ b/gnucash/html/gncmod-html.c
@@ -73,11 +73,6 @@ extern SCM scm_init_sw_gnc_html_module( void );
 int
 libgncmod_html_gnc_module_init( int refcount )
 {
-    if ( !gnc_module_load( "gnucash/app-utils", 0 ) )
-    {
-        return FALSE;
-    }
-
     scm_init_sw_gnc_html_module();
     gnc_html_initialize();
     lmod( "(sw_gnc_html)" );
diff --git a/gnucash/import-export/aqb/gncmod-aqbanking.c b/gnucash/import-export/aqb/gncmod-aqbanking.c
index 4f678891f..dc288500c 100644
--- a/gnucash/import-export/aqb/gncmod-aqbanking.c
+++ b/gnucash/import-export/aqb/gncmod-aqbanking.c
@@ -62,8 +62,7 @@ gint
 libgncmod_aqbanking_gnc_module_init(gint refcount)
 {
     /* Load modules we depend on */
-    if (!gnc_module_load("gnucash/app-utils", 0)
-            || !gnc_module_load("gnucash/gnome-utils", 0)
+    if (!gnc_module_load("gnucash/gnome-utils", 0)
             || !gnc_module_load("gnucash/import-export", 0))
     {
         return FALSE;
diff --git a/gnucash/import-export/aqb/test/CMakeLists.txt b/gnucash/import-export/aqb/test/CMakeLists.txt
index 30ad13014..8ce0b73da 100644
--- a/gnucash/import-export/aqb/test/CMakeLists.txt
+++ b/gnucash/import-export/aqb/test/CMakeLists.txt
@@ -21,7 +21,7 @@ set(test_aqb_INCLUDE_DIRS
 
 set(test_aqb_LIBS
   gncmod-aqbanking gncmod-generic-import gnc-gnome gncmod-gnome-utils
-  gncmod-ledger-core gncmod-app-utils
+  gncmod-ledger-core gnc-app-utils
   gncmod-backend-xml-utils gnc-engine gnc-core-utils gnc-module
   ${GLIB2_LDFLAGS}
 )
diff --git a/gnucash/import-export/bi-import/CMakeLists.txt b/gnucash/import-export/bi-import/CMakeLists.txt
index 1ec36809a..90255fea2 100644
--- a/gnucash/import-export/bi-import/CMakeLists.txt
+++ b/gnucash/import-export/bi-import/CMakeLists.txt
@@ -21,7 +21,7 @@ add_library(gncmod-bi-import ${bi_import_noinst_HEADERS} ${bi_import_SOURCES})
 target_link_libraries(gncmod-bi-import
   gncmod-gnome-utils
   gncmod-gnome-search
-  gncmod-app-utils
+  gnc-app-utils
   gnc-engine
   gnc-core-utils
   gnc-module
diff --git a/gnucash/import-export/bi-import/gncmod-bi-import.c b/gnucash/import-export/bi-import/gncmod-bi-import.c
index 1aa763207..b7091f4d5 100644
--- a/gnucash/import-export/bi-import/gncmod-bi-import.c
+++ b/gnucash/import-export/bi-import/gncmod-bi-import.c
@@ -65,10 +65,6 @@ libgncmod_bi_import_gnc_module_description (void)
 int
 libgncmod_bi_import_gnc_module_init (int refcount)
 {
-    if (!gnc_module_load ("gnucash/app-utils", 0))
-    {
-        return FALSE;
-    }
     if (!gnc_module_load ("gnucash/gnome-utils", 0))
     {
         return FALSE;
diff --git a/gnucash/import-export/csv-exp/CMakeLists.txt b/gnucash/import-export/csv-exp/CMakeLists.txt
index 8351e7a24..44dd90a55 100644
--- a/gnucash/import-export/csv-exp/CMakeLists.txt
+++ b/gnucash/import-export/csv-exp/CMakeLists.txt
@@ -19,7 +19,7 @@ set(csv_export_noinst_HEADERS
 add_library(gncmod-csv-export ${csv_export_noinst_HEADERS} ${csv_export_SOURCES})
 
 target_link_libraries(gncmod-csv-export gncmod-register-gnome gncmod-register-core gncmod-ledger-core gnc-engine
-                         gnc-module gncmod-gnome-utils gnc-gnome gncmod-app-utils gnc-core-utils)
+                         gnc-module gncmod-gnome-utils gnc-gnome gnc-app-utils gnc-core-utils)
 
 target_compile_definitions(gncmod-csv-export PRIVATE -DG_LOG_DOMAIN=\"gnc.export.csv\")
 
diff --git a/gnucash/import-export/csv-exp/gncmod-csv-export.c b/gnucash/import-export/csv-exp/gncmod-csv-export.c
index 7a2dca980..1435bf904 100644
--- a/gnucash/import-export/csv-exp/gncmod-csv-export.c
+++ b/gnucash/import-export/csv-exp/gncmod-csv-export.c
@@ -59,10 +59,6 @@ libgncmod_csv_export_gnc_module_description(void)
 int
 libgncmod_csv_export_gnc_module_init(int refcount)
 {
-    if (!gnc_module_load("gnucash/app-utils", 0))
-    {
-        return FALSE;
-    }
     if (!gnc_module_load("gnucash/gnome-utils", 0))
     {
         return FALSE;
diff --git a/gnucash/import-export/csv-imp/CMakeLists.txt b/gnucash/import-export/csv-imp/CMakeLists.txt
index e600912ed..446c45e1d 100644
--- a/gnucash/import-export/csv-imp/CMakeLists.txt
+++ b/gnucash/import-export/csv-imp/CMakeLists.txt
@@ -68,7 +68,7 @@ target_link_libraries(
   ${ICU4C_I18N_LDFLAGS}
   gncmod-generic-import
   gncmod-gnome-utils
-  gncmod-app-utils
+  gnc-app-utils
   gnc-engine
   gnc-core-utils
   gnc-module)
diff --git a/gnucash/import-export/csv-imp/gncmod-csv-import.c b/gnucash/import-export/csv-imp/gncmod-csv-import.c
index 52be6ea52..e92cc5696 100644
--- a/gnucash/import-export/csv-imp/gncmod-csv-import.c
+++ b/gnucash/import-export/csv-imp/gncmod-csv-import.c
@@ -59,10 +59,6 @@ libgncmod_csv_import_gnc_module_description(void)
 int
 libgncmod_csv_import_gnc_module_init(int refcount)
 {
-    if (!gnc_module_load("gnucash/app-utils", 0))
-    {
-        return FALSE;
-    }
     if (!gnc_module_load("gnucash/gnome-utils", 0))
     {
         return FALSE;
diff --git a/gnucash/import-export/customer-import/CMakeLists.txt b/gnucash/import-export/customer-import/CMakeLists.txt
index 3380d4ddf..a33e61225 100644
--- a/gnucash/import-export/customer-import/CMakeLists.txt
+++ b/gnucash/import-export/customer-import/CMakeLists.txt
@@ -17,7 +17,7 @@ set(customer_import_noinst_HEADERS
 
 add_library(gncmod-customer-import ${customer_import_SOURCES} ${customer_import_noinst_HEADERS})
 
-target_link_libraries(gncmod-customer-import gnc-gnome gncmod-gnome-utils gncmod-app-utils
+target_link_libraries(gncmod-customer-import gnc-gnome gncmod-gnome-utils gnc-app-utils
      gnc-engine gnc-core-utils gnc-module ${GLIB2_LDFLAGS})
 
 target_include_directories(gncmod-customer-import
diff --git a/gnucash/import-export/customer-import/gncmod-customer-import.c b/gnucash/import-export/customer-import/gncmod-customer-import.c
index 945d8e08f..93cb9e433 100644
--- a/gnucash/import-export/customer-import/gncmod-customer-import.c
+++ b/gnucash/import-export/customer-import/gncmod-customer-import.c
@@ -65,10 +65,6 @@ libgncmod_customer_import_gnc_module_description (void)
 int
 libgncmod_customer_import_gnc_module_init (int refcount)
 {
-    if (!gnc_module_load ("gnucash/app-utils", 0))
-    {
-        return FALSE;
-    }
     if (!gnc_module_load ("gnucash/gnome-utils", 0))
     {
         return FALSE;
diff --git a/gnucash/import-export/gncmod-generic-import.c b/gnucash/import-export/gncmod-generic-import.c
index 7a68554ad..f1f1cd5dd 100644
--- a/gnucash/import-export/gncmod-generic-import.c
+++ b/gnucash/import-export/gncmod-generic-import.c
@@ -58,10 +58,6 @@ libgncmod_generic_import_gnc_module_description(void)
 int
 libgncmod_generic_import_gnc_module_init(int refcount)
 {
-    if (!gnc_module_load("gnucash/app-utils", 0))
-    {
-        return FALSE;
-    }
     if (!gnc_module_load("gnucash/gnome-utils", 0))
     {
         return FALSE;
diff --git a/gnucash/import-export/log-replay/CMakeLists.txt b/gnucash/import-export/log-replay/CMakeLists.txt
index 8e6d71a1a..25573c142 100644
--- a/gnucash/import-export/log-replay/CMakeLists.txt
+++ b/gnucash/import-export/log-replay/CMakeLists.txt
@@ -15,7 +15,7 @@ set(log_replay_noinst_HEADERS
 
 add_library(gncmod-log-replay ${log_replay_SOURCES} ${log_replay_noinst_HEADERS})
 
-target_link_libraries(gncmod-log-replay gncmod-gnome-utils gncmod-app-utils gnc-engine
+target_link_libraries(gncmod-log-replay gncmod-gnome-utils gnc-app-utils gnc-engine
      gnc-core-utils gnc-module PkgConfig::GTK3)
 
 target_compile_definitions(gncmod-log-replay PRIVATE -DG_LOG_DOMAIN=\"gnc.import.log-replay\")
diff --git a/gnucash/import-export/log-replay/gncmod-log-replay.c b/gnucash/import-export/log-replay/gncmod-log-replay.c
index a27729d17..777a41ece 100644
--- a/gnucash/import-export/log-replay/gncmod-log-replay.c
+++ b/gnucash/import-export/log-replay/gncmod-log-replay.c
@@ -61,10 +61,6 @@ libgncmod_log_replay_gnc_module_description(void)
 int
 libgncmod_log_replay_gnc_module_init(int refcount)
 {
-    if (!gnc_module_load("gnucash/app-utils", 0))
-    {
-        return FALSE;
-    }
     if (!gnc_module_load("gnucash/gnome-utils", 0))
     {
         return FALSE;
diff --git a/gnucash/import-export/ofx/CMakeLists.txt b/gnucash/import-export/ofx/CMakeLists.txt
index c850b1293..862190983 100644
--- a/gnucash/import-export/ofx/CMakeLists.txt
+++ b/gnucash/import-export/ofx/CMakeLists.txt
@@ -20,7 +20,7 @@ set(ofx_UI gnc-plugin-ofx-ui.xml)
 if (WITH_OFX)
   add_library(gncmod-ofx ${ofx_SOURCES} ${ofx_noinst_HEADERS})
 
-  target_link_libraries(gncmod-ofx gncmod-generic-import gnc-engine gncmod-app-utils gnc-core-utils
+  target_link_libraries(gncmod-ofx gncmod-generic-import gnc-engine gnc-app-utils gnc-core-utils
                     gncmod-gnome-utils ${LIBOFX_LDFLAGS})
 
   target_compile_definitions(gncmod-ofx PRIVATE -DG_LOG_DOMAIN=\"gnc.import.ofx\")
diff --git a/gnucash/import-export/ofx/gncmod-ofx-import.c b/gnucash/import-export/ofx/gncmod-ofx-import.c
index 897b30bc6..9796cd87c 100644
--- a/gnucash/import-export/ofx/gncmod-ofx-import.c
+++ b/gnucash/import-export/ofx/gncmod-ofx-import.c
@@ -61,10 +61,6 @@ libgncmod_ofx_gnc_module_description(void)
 int
 libgncmod_ofx_gnc_module_init(int refcount)
 {
-    if (!gnc_module_load("gnucash/app-utils", 0))
-    {
-        return FALSE;
-    }
     if (!gnc_module_load("gnucash/gnome-utils", 0))
     {
         return FALSE;
diff --git a/gnucash/import-export/qif-imp/CMakeLists.txt b/gnucash/import-export/qif-imp/CMakeLists.txt
index 417369d59..e3bf7a078 100644
--- a/gnucash/import-export/qif-imp/CMakeLists.txt
+++ b/gnucash/import-export/qif-imp/CMakeLists.txt
@@ -21,7 +21,7 @@ set (qif_import_noinst_HEADERS
 add_library	(gncmod-qif-import ${qif_import_SOURCES} ${qif_import_noinst_HEADERS})
 
 target_link_libraries(gncmod-qif-import
-    gncmod-app-utils
+    gnc-app-utils
     gncmod-gnome-utils
     gnc-gnome
     gnucash-guile)
diff --git a/gnucash/import-export/qif-imp/gncmod-qif-import.c b/gnucash/import-export/qif-imp/gncmod-qif-import.c
index 188a0ed97..2bcb9e606 100644
--- a/gnucash/import-export/qif-imp/gncmod-qif-import.c
+++ b/gnucash/import-export/qif-imp/gncmod-qif-import.c
@@ -62,11 +62,6 @@ libgncmod_qif_import_gnc_module_description(void)
 int
 libgncmod_qif_import_gnc_module_init(int refcount)
 {
-    if (!gnc_module_load("gnucash/app-utils", 0))
-    {
-        return FALSE;
-    }
-
     if (!gnc_module_load("gnucash/gnome-utils", 0))
     {
         return FALSE;
diff --git a/gnucash/python/CMakeLists.txt b/gnucash/python/CMakeLists.txt
index a6690ddf8..566f40639 100644
--- a/gnucash/python/CMakeLists.txt
+++ b/gnucash/python/CMakeLists.txt
@@ -13,7 +13,7 @@ set(pycons_DATA
 if (WITH_PYTHON)
 
   add_library(gncmod-python ${gncmod_python_SOURCES})
-  # target_link_libraries(gncmod-python gnc-module gnc-core-utils-python gncmod-app-utils-python
+  # target_link_libraries(gncmod-python gnc-module gnc-core-utils-python gnc-app-utils-python
   target_link_libraries(gncmod-python gnc-module gnc-core-utils
    ${PYTHON_LIBRARIES} ${GLIB_LIBS})   # ${PYTHON_EXTRA_LIBS}
   target_include_directories(gncmod-python
diff --git a/gnucash/register/ledger-core/gncmod-ledger-core.c b/gnucash/register/ledger-core/gncmod-ledger-core.c
index c08575918..64bb9e8e9 100644
--- a/gnucash/register/ledger-core/gncmod-ledger-core.c
+++ b/gnucash/register/ledger-core/gncmod-ledger-core.c
@@ -61,10 +61,5 @@ libgncmod_ledger_core_gnc_module_init(int refcount)
         return FALSE;
     }
 
-    if (!gnc_module_load("gnucash/app-utils", 0))
-    {
-        return FALSE;
-    }
-
     return TRUE;
 }
diff --git a/gnucash/register/register-core/CMakeLists.txt b/gnucash/register/register-core/CMakeLists.txt
index 381e0de7c..007de3849 100644
--- a/gnucash/register/register-core/CMakeLists.txt
+++ b/gnucash/register/register-core/CMakeLists.txt
@@ -45,7 +45,7 @@ set_source_files_properties (${register_core_SOURCES} PROPERTIES OBJECT_DEPENDS
 
 add_library (gncmod-register-core ${register_core_SOURCES} ${register_core_HEADERS})
 
-target_link_libraries(gncmod-register-core gncmod-gnome-utils gncmod-app-utils ${GMODULE_LDFLAGS})
+target_link_libraries(gncmod-register-core gncmod-gnome-utils gnc-app-utils ${GMODULE_LDFLAGS})
 
 target_compile_definitions (gncmod-register-core PRIVATE -DG_LOG_DOMAIN=\"gnc.register.core\")
 
diff --git a/gnucash/report/CMakeLists.txt b/gnucash/report/CMakeLists.txt
index 8eda96b25..aea5aa3ed 100644
--- a/gnucash/report/CMakeLists.txt
+++ b/gnucash/report/CMakeLists.txt
@@ -29,7 +29,7 @@ target_compile_definitions(gncmod-report PRIVATE -DG_LOG_DOMAIN=\"gnc.report.cor
 
 target_link_libraries(gncmod-report
     gnc-module
-    gncmod-app-utils
+    gnc-app-utils
     gnucash-guile
     PkgConfig::GTK3
     ${GUILE_LDFLAGS})
diff --git a/gnucash/report/gncmod-report.c b/gnucash/report/gncmod-report.c
index c6cf26f72..8f2fe4656 100644
--- a/gnucash/report/gncmod-report.c
+++ b/gnucash/report/gncmod-report.c
@@ -60,10 +60,6 @@ extern SCM scm_init_sw_report_module(void);
 int
 libgncmod_report_gnc_module_init(int refcount)
 {
-    if (!gnc_module_load("gnucash/app-utils", 0))
-    {
-        return FALSE;
-    }
     scm_init_sw_report_module();
 
     scm_c_eval_string("(use-modules (gnucash report))");
diff --git a/libgnucash/app-utils/CMakeLists.txt b/libgnucash/app-utils/CMakeLists.txt
index 438b6e92a..81562e4f7 100644
--- a/libgnucash/app-utils/CMakeLists.txt
+++ b/libgnucash/app-utils/CMakeLists.txt
@@ -65,7 +65,6 @@ set (app_utils_SOURCES
   gnc-state.c
   gnc-ui-util.c
   gnc-ui-balances.c
-  gncmod-app-utils.c
   option-util.c
 )
 
@@ -94,22 +93,22 @@ if (WIN32)
 endif()
 
 
-add_library (gncmod-app-utils ${app_utils_ALL_SOURCES} ${SWIG_APP_UTILS_GUILE_C})
-target_link_libraries(gncmod-app-utils ${app_utils_ALL_LIBRARIES})
+add_library (gnc-app-utils ${app_utils_ALL_SOURCES} ${SWIG_APP_UTILS_GUILE_C})
+target_link_libraries(gnc-app-utils ${app_utils_ALL_LIBRARIES})
 
-target_include_directories (gncmod-app-utils
+target_include_directories (gnc-app-utils
     PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
     PRIVATE ${app_utils_ALL_INCLUDES}
 )
-target_compile_definitions (gncmod-app-utils PRIVATE -DG_LOG_DOMAIN=\"gnc.app-utils\")
+target_compile_definitions (gnc-app-utils PRIVATE -DG_LOG_DOMAIN=\"gnc.app-utils\")
 
 if (APPLE)
-  set_target_properties (gncmod-app-utils PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/gnucash")
+  set_target_properties (gnc-app-utils PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/gnucash")
 endif()
 
-install(TARGETS gncmod-app-utils
-  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/gnucash
-  ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/gnucash
+install(TARGETS gnc-app-utils
+  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+  ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
   RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
 )
 
@@ -117,7 +116,7 @@ if (WITH_PYTHON)
   set(PYEXEC_FILES sw_app_utils.py)
   add_library (sw_app_utils MODULE ${SWIG_APP_UTILS_PYTHON_C})
 
-  target_link_libraries(sw_app_utils gncmod-app-utils ${app_utils_ALL_LIBRARIES} ${PYTHON_LIBRARIES})
+  target_link_libraries(sw_app_utils gnc-app-utils ${app_utils_ALL_LIBRARIES} ${PYTHON_LIBRARIES})
   set_target_properties(sw_app_utils PROPERTIES PREFIX "_")
   if (HAVE_STRINGOP_TRUNCATION)
     target_compile_options(sw_app_utils PRIVATE -Wno-error=stringop-truncation)
@@ -130,7 +129,7 @@ if (WITH_PYTHON)
   target_compile_definitions (sw_app_utils PRIVATE -DG_LOG_DOMAIN=\"gnc.app-utils\")
 
   if (APPLE)
-    set_target_properties (sw_app_utils PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/gnucash")
+    set_target_properties (sw_app_utils PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}")
   endif()
 
   install(TARGETS sw_app_utils
@@ -168,7 +167,7 @@ set (app_utils_SCHEME_2
 )
 
 set(GUILE_DEPENDS
-  gncmod-app-utils
+  gnc-app-utils
   scm-core-utils
   scm-engine
   scm-gnc-module
@@ -197,5 +196,5 @@ add_custom_target(scm-app-utils ALL DEPENDS scm-app-utils-2 scm-app-utils-1)
 
 set_local_dist(app_utils_DIST_local
         ${app_utils_ALL_SOURCES} ${app_utils_SCHEME_1} ${app_utils_SCHEME_2} ${app_utils_SCHEME_3}
-        app-utils.i CMakeLists.txt gnc-help-utils.c README)
+        app-utils.i CMakeLists.txt gnc-help-utils.c)
 set(app_utils_DIST ${app_utils_DIST_local} ${test_app_utils_DIST} PARENT_SCOPE)
diff --git a/libgnucash/app-utils/README b/libgnucash/app-utils/README
deleted file mode 100644
index c955f15e8..000000000
--- a/libgnucash/app-utils/README
+++ /dev/null
@@ -1,10 +0,0 @@
-
-After loading this module, you must also call
-
-  (gnc:setup-gettext)
-  (setlocale LC_ALL "")
-
-at some point to finish initializing the app.  This is not done
-automatically from gncmod-app-utils.c via app-utils.scm because you
-may need to handle setlocale yourself (or you may already have other
-code that does).
diff --git a/libgnucash/app-utils/app-utils.scm b/libgnucash/app-utils/app-utils.scm
index 26aac63be..b6d7f63f4 100644
--- a/libgnucash/app-utils/app-utils.scm
+++ b/libgnucash/app-utils/app-utils.scm
@@ -18,7 +18,7 @@
 (define-module (gnucash app-utils))
 (eval-when
       (compile load eval expand)
-      (load-extension "libgncmod-app-utils" "scm_init_sw_app_utils_module"))
+      (load-extension "libgnc-app-utils" "scm_init_sw_app_utils_module"))
 (use-modules (sw_app_utils))
 
 ; Export the swig-wrapped symbols in the public interface of this module
diff --git a/libgnucash/app-utils/gncmod-app-utils.c b/libgnucash/app-utils/gncmod-app-utils.c
deleted file mode 100644
index 24ab94d93..000000000
--- a/libgnucash/app-utils/gncmod-app-utils.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/*********************************************************************
- * gncmod-app-utils.c
- * module definition/initialization for the report infrastructure
- *
- * Copyright (c) 2001 Linux Developers Group, Inc.
- *********************************************************************/
-/********************************************************************\
- * This program is free software; you can redistribute it and/or    *
- * modify it under the terms of the GNU General Public License as   *
- * published by the Free Software Foundation; either version 2 of   *
- * the License, or (at your option) any later version.              *
- *                                                                  *
- * This program is distributed in the hope that it will be useful,  *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
- * GNU General Public License for more details.                     *
- *                                                                  *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact:                        *
- *                                                                  *
- * Free Software Foundation           Voice:  +1-617-542-5942       *
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
- * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
- *                                                                  *
-\********************************************************************/
-
-
-#include <config.h>
-#include <gmodule.h>
-#include <libguile.h>
-
-#include "gnc-module.h"
-#include "gnc-module-api.h"
-
-#include "gnc-hooks.h"
-#include "gnc-exp-parser.h"
-
-GNC_MODULE_API_DECL(libgncmod_app_utils)
-
-/* version of the gnc module system interface we require */
-int libgncmod_app_utils_gnc_module_system_interface = 0;
-
-/* module versioning uses libtool semantics. */
-int libgncmod_app_utils_gnc_module_current  = 0;
-int libgncmod_app_utils_gnc_module_revision = 0;
-int libgncmod_app_utils_gnc_module_age      = 0;
-
-
-char *
-libgncmod_app_utils_gnc_module_path(void)
-{
-    return g_strdup("gnucash/app-utils");
-}
-
-char *
-libgncmod_app_utils_gnc_module_description(void)
-{
-    return g_strdup("Utilities for building gnc applications");
-}
-
-static void
-lmod(char * mn)
-{
-    char * form = g_strdup_printf("(use-modules %s)\n", mn);
-    scm_c_eval_string(form);
-    g_free(form);
-}
-
-
-extern SCM scm_init_sw_app_utils_module(void);
-
-int
-libgncmod_app_utils_gnc_module_init(int refcount)
-{
-    scm_init_sw_app_utils_module();
-    /* publish swig bindings */
-    /* load the scheme code */
-    lmod("(sw_app_utils)");
-    lmod("(gnucash app-utils)");
-
-    return TRUE;
-}
-
-int
-libgncmod_app_utils_gnc_module_end(int refcount)
-{
-    return TRUE;
-}
diff --git a/libgnucash/app-utils/test/CMakeLists.txt b/libgnucash/app-utils/test/CMakeLists.txt
index dedc266de..2316b9e10 100644
--- a/libgnucash/app-utils/test/CMakeLists.txt
+++ b/libgnucash/app-utils/test/CMakeLists.txt
@@ -9,7 +9,7 @@ set(APP_UTILS_TEST_INCLUDE_DIRS
   ${GUILE_INCLUDE_DIRS}
 )
 
-set(APP_UTILS_TEST_LIBS gncmod-app-utils gncmod-test-engine test-core ${GIO_LDFLAGS} ${GUILE_LDFLAGS})
+set(APP_UTILS_TEST_LIBS gnc-app-utils gncmod-test-engine test-core ${GIO_LDFLAGS} ${GUILE_LDFLAGS})
 
 set(test_app_utils_SOURCES test-app-utils.c test-option-util.cpp test-gnc-ui-util.c)
 
@@ -20,7 +20,6 @@ endmacro()
 gnc_add_test_with_guile(test-exp-parser test-exp-parser.c
   APP_UTILS_TEST_INCLUDE_DIRS APP_UTILS_TEST_LIBS
  )
-gnc_add_test_with_guile(test-link-module-app-utils test-link-module APP_UTILS_TEST_INCLUDE_DIRS APP_UTILS_TEST_LIBS)
 add_app_utils_test(test-print-parse-amount test-print-parse-amount.cpp)
 # FIXME Why is this test not run ?
 #gnc_add_test_with_guile(test-print-queries test-print-queries.cpp APP_UTILS_TEST_INCLUDE_DIRS APP_UTILS_TEST_LIBS)
@@ -33,7 +32,6 @@ set(GUILE_DEPENDS
   scm-test-engine
   scm-app-utils
   scm-core-utils
-  scm-gnc-module
   scm-engine
   scm-core-utils
   gncmod-backend-xml
@@ -83,7 +81,6 @@ set_dist_list(test_app_utils_DIST
   CMakeLists.txt
   
   test-exp-parser.c
-  test-link-module.c
   test-print-parse-amount.cpp
   test-print-queries.cpp
   test-scm-query-string.cpp
diff --git a/libgnucash/app-utils/test/test-app-utils.c b/libgnucash/app-utils/test/test-app-utils.c
index 5daca604f..17289e77f 100644
--- a/libgnucash/app-utils/test/test-app-utils.c
+++ b/libgnucash/app-utils/test/test-app-utils.c
@@ -24,7 +24,6 @@
 #include <glib.h>
 #include <qof.h>
 #include <libguile.h>
-#include <gnc-module.h>
 
 extern void test_suite_option_util (void);
 extern void test_suite_gnc_ui_util (void);
@@ -32,10 +31,8 @@ extern void test_suite_gnc_ui_util (void);
 static void
 guile_main (void *closure, int argc, char **argv)
 {
-    GNCModule mod;
     int retval;
-    gnc_module_system_init ();
-    mod = gnc_module_load ("gnucash/app-utils", 0);
+    scm_c_use_module("gnucash app-utils");
 
     test_suite_option_util ();
     test_suite_gnc_ui_util ();
diff --git a/libgnucash/app-utils/test/test-link-module.c b/libgnucash/app-utils/test/test-link-module.c
deleted file mode 100644
index a51a18bcb..000000000
--- a/libgnucash/app-utils/test/test-link-module.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/********************************************************************\
- * This program is free software; you can redistribute it and/or    *
- * modify it under the terms of the GNU General Public License as   *
- * published by the Free Software Foundation; either version 2 of   *
- * the License, or (at your option) any later version.              *
- *                                                                  *
- * This program is distributed in the hope that it will be useful,  *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
- * GNU General Public License for more details.                     *
- *                                                                  *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact:                        *
- *                                                                  *
- * Free Software Foundation           Voice:  +1-617-542-5942       *
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
- * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
- *                                                                  *
-\********************************************************************/
-
-#include <stdlib.h>
-#include <libguile.h>
-#include <gnc-module.h>
-
-static void
-guile_main(void *closure, int argc, char ** argv)
-{
-    GNCModule mod;
-    gnc_module_system_init();
-    mod = gnc_module_load("gnucash/app-utils", 0);
-
-    exit(mod == NULL);
-}
-
-int
-main(int argc, char ** argv)
-{
-    g_setenv ("GNC_UNINSTALLED", "1", TRUE);
-    scm_boot_guile(argc, argv, guile_main, NULL);
-    return 0;
-}
diff --git a/libgnucash/app-utils/test/test-load-app-utils-module.scm b/libgnucash/app-utils/test/test-load-app-utils-module.scm
index 2524bbb80..094d19005 100755
--- a/libgnucash/app-utils/test/test-load-app-utils-module.scm
+++ b/libgnucash/app-utils/test/test-load-app-utils-module.scm
@@ -1,25 +1,20 @@
 (define exit-code 0)
 (setenv "GNC_UNINSTALLED" "1")
-(use-modules (gnucash gnc-module))
-(gnc:module-system-init)
 
-(gnc:module-begin-syntax (define loaded-module (gnc:module-load "gnucash/app-utils" 0)))
-(if loaded-module
-    (display "Module gnucash/app-utils loaded successfully\n")
-    (begin
-      (display "Failed - module gnucash/app-utils not loaded successfully\n")
-      (set! exit-code -1)))
+(use-modules (gnucash app-utils))
 
-(if (procedure? gnc:apply-with-error-handling)
-    (display "Procedure gnc:apply-with-error-handling found\n")
-    (begin
-      (display "Failed - procedure gnc:apply-with-error-handling not found\n")
-      (set! exit-code -1)))
+(cond
+    ((defined? 'gnc:apply-with-error-handling)
+        (display "Procedure gnc:apply-with-error-handling found\n"))
+    (else
+        (display "Failed - procedure gnc:apply-with-error-handling not found\n")
+        (set! exit-code -1)))
 
-(if (procedure? gnc-default-currency)
-    (display "Procedure gnc-default-currency found\n")
-    (begin
-      (display "Failed - procedure gnc-default-currency not found\n")
-      (set! exit-code -1)))
+(cond
+    ((defined? 'gnc-default-currency)
+        (display "Procedure gnc-default-currency found\n"))
+    (else
+        (display "Failed - procedure gnc-default-currency not found\n")
+        (set! exit-code -1)))
 
 (exit exit-code)
diff --git a/libgnucash/app-utils/test/test-print-queries.cpp b/libgnucash/app-utils/test/test-print-queries.cpp
index 783a2a540..9d6fa5a04 100644
--- a/libgnucash/app-utils/test/test-print-queries.cpp
+++ b/libgnucash/app-utils/test/test-print-queries.cpp
@@ -27,7 +27,6 @@ extern "C"
 #include "guile-mappings.h"
 
 #include "gnc-engine-guile.h"
-#include "gnc-module.h"
 #include "test-engine-stuff.h"
 #include "test-stuff.h"
 #include "Query.h"
@@ -77,7 +76,7 @@ main_helper (void *closure, int argc, char **argv)
 {
     int count = 50;
 
-    gnc_module_load("gnucash/app-utils", 0);
+    scm_c_use_module("gnucash app-utils");
 
     if (argc > 1)
         count = atoi (argv[1]);
diff --git a/libgnucash/app-utils/test/test-scm-query-string.cpp b/libgnucash/app-utils/test/test-scm-query-string.cpp
index 9b685c8c7..13e9ad35e 100644
--- a/libgnucash/app-utils/test/test-scm-query-string.cpp
+++ b/libgnucash/app-utils/test/test-scm-query-string.cpp
@@ -27,7 +27,6 @@ extern "C"
 #include "guile-mappings.h"
 
 #include "gnc-engine-guile.h"
-#include "gnc-module.h"
 #include "gnc-guile-utils.h"
 #include "test-engine-stuff.h"
 #include "test-stuff.h"
@@ -112,8 +111,7 @@ run_tests (void)
 static void
 main_helper (void *closure, int argc, char **argv)
 {
-    gnc_module_system_init ();
-    gnc_module_load("gnucash/app-utils", 0);
+    scm_c_use_module("gnucash app-utils");
 
     xaccLogDisable ();
 
diff --git a/libgnucash/tax/de_DE/tax.scm b/libgnucash/tax/de_DE/tax.scm
index 8f2129b75..77f6eede5 100644
--- a/libgnucash/tax/de_DE/tax.scm
+++ b/libgnucash/tax/de_DE/tax.scm
@@ -19,11 +19,7 @@
 
 (define-module (gnucash locale de_DE tax))
 
-(eval-when
-      (compile load eval expand)
-      (load-extension "libgncmod-app-utils" "scm_init_sw_app_utils_module"))
 (use-modules (gnucash engine))
-(use-modules (sw_app_utils))
 (use-modules (gnucash app-utils))
 
 (export gnc:txf-get-payer-name-source)
diff --git a/libgnucash/tax/gncmod-locale-tax.c b/libgnucash/tax/gnc-locale-tax.c
similarity index 100%
rename from libgnucash/tax/gncmod-locale-tax.c
rename to libgnucash/tax/gnc-locale-tax.c
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 1c3e7c43a..c54d4bbf6 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -535,7 +535,6 @@ libgnucash/app-utils/gnc-exp-parser.c
 libgnucash/app-utils/gnc-gsettings.c
 libgnucash/app-utils/gnc-helpers.c
 libgnucash/app-utils/gnc-help-utils.c
-libgnucash/app-utils/gncmod-app-utils.c
 libgnucash/app-utils/gnc-prefs-utils.c
 libgnucash/app-utils/gnc-state.c
 libgnucash/app-utils/gnc-sx-instance-model.c

commit 90aa53990853b54b04c43387634f81f1d8931125
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Nov 26 17:03:12 2019 +0100

    app-utils - make gnc-expression-parser responsible for its own cleanup
    
    It already ensured it would initialize on first use.
    It can as well register the hooks it needs for its
    cleanup directly itself instead of depending on the
    module loading system to do so.

diff --git a/libgnucash/app-utils/gnc-exp-parser.c b/libgnucash/app-utils/gnc-exp-parser.c
index 35179f33a..fdfab3aa1 100644
--- a/libgnucash/app-utils/gnc-exp-parser.c
+++ b/libgnucash/app-utils/gnc-exp-parser.c
@@ -32,6 +32,7 @@
 #include "fin_spl_protos.h"
 #include "gnc-filepath-utils.h"
 #include "gnc-gkeyfile-utils.h"
+#include "gnc-hooks.h"
 #include "gnc-exp-parser.h"
 #include "gnc-ui-util.h"
 #include "gnc-locale-utils.h"
@@ -107,6 +108,8 @@ gnc_exp_parser_real_init ( gboolean addPredefined )
         }
         g_free(filename);
     }
+
+    gnc_hook_add_dangler(HOOK_SHUTDOWN, (GFunc)gnc_exp_parser_shutdown, NULL, NULL);
 }
 
 static gboolean
@@ -157,6 +160,8 @@ gnc_exp_parser_shutdown (void)
     last_gncp_error = NO_ERR;
 
     parser_inited = FALSE;
+
+    gnc_hook_run(HOOK_SAVE_OPTIONS, NULL);
 }
 
 void
diff --git a/libgnucash/app-utils/gncmod-app-utils.c b/libgnucash/app-utils/gncmod-app-utils.c
index 3f242d243..24ab94d93 100644
--- a/libgnucash/app-utils/gncmod-app-utils.c
+++ b/libgnucash/app-utils/gncmod-app-utils.c
@@ -66,13 +66,6 @@ lmod(char * mn)
     g_free(form);
 }
 
-static void
-app_utils_shutdown(void)
-{
-    gnc_exp_parser_shutdown();
-    gnc_hook_run(HOOK_SAVE_OPTIONS, NULL);
-}
-
 
 extern SCM scm_init_sw_app_utils_module(void);
 
@@ -85,12 +78,6 @@ libgncmod_app_utils_gnc_module_init(int refcount)
     lmod("(sw_app_utils)");
     lmod("(gnucash app-utils)");
 
-    if (refcount == 0)
-    {
-        gnc_hook_add_dangler(HOOK_STARTUP, (GFunc)gnc_exp_parser_init, NULL, NULL);
-        gnc_hook_add_dangler(HOOK_SHUTDOWN, (GFunc)app_utils_shutdown, NULL, NULL);
-    }
-
     return TRUE;
 }
 

commit 43647c7a54cbb37fc0de97e40d436b8f71c3b82d
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Nov 26 16:39:21 2019 +0100

    app-utils - move component manager to gnome-utils
    
    It's primary purpose is to track gui objects' lifetimes. There's no
    need for libgnucash (a non-gui library) to deal with that.
    This required two book options related gui-only call backs
    to be moved to gnome-utils as well.

diff --git a/gnucash/gnome-utils/CMakeLists.txt b/gnucash/gnome-utils/CMakeLists.txt
index 7ceb5c93c..31846fc79 100644
--- a/gnucash/gnome-utils/CMakeLists.txt
+++ b/gnucash/gnome-utils/CMakeLists.txt
@@ -53,6 +53,7 @@ set (gnome_utils_SOURCES
   gnc-cell-renderer-text-flag.c
   gnc-combott.c
   gnc-commodity-edit.c
+  gnc-component-manager.c
   gnc-currency-edit.c
   gnc-date-delta.c
   gnc-date-edit.c
@@ -141,6 +142,7 @@ set (gnome_utils_HEADERS
   gnc-cell-renderer-text-flag.h
   gnc-combott.h
   gnc-commodity-edit.h
+  gnc-component-manager.h
   gnc-currency-edit.h
   gnc-date-delta.h
   gnc-date-edit.h
diff --git a/libgnucash/app-utils/gnc-component-manager.c b/gnucash/gnome-utils/gnc-component-manager.c
similarity index 100%
rename from libgnucash/app-utils/gnc-component-manager.c
rename to gnucash/gnome-utils/gnc-component-manager.c
diff --git a/libgnucash/app-utils/gnc-component-manager.h b/gnucash/gnome-utils/gnc-component-manager.h
similarity index 100%
rename from libgnucash/app-utils/gnc-component-manager.h
rename to gnucash/gnome-utils/gnc-component-manager.h
diff --git a/gnucash/gnome-utils/gnc-main-window.c b/gnucash/gnome-utils/gnc-main-window.c
index 935c4dd7d..479685e70 100644
--- a/gnucash/gnome-utils/gnc-main-window.c
+++ b/gnucash/gnome-utils/gnc-main-window.c
@@ -48,9 +48,11 @@
 #include "dialog-reset-warnings.h"
 #include "dialog-transfer.h"
 #include "dialog-utils.h"
+#include "engine-helpers.h"
 #include "file-utils.h"
 #include "gnc-component-manager.h"
 #include "gnc-engine.h"
+#include "gnc-features.h"
 #include "gnc-file.h"
 #include "gnc-filepath-utils.h"
 #include "gnc-gkeyfile-utils.h"
@@ -4111,6 +4113,44 @@ gnc_book_options_dialog_close_cb(GNCOptionWin * optionwin,
     gnc_option_db_destroy(options);
 }
 
+/** Calls gnc_book_option_num_field_source_change to initiate registered
+ * callbacks when num_field_source book option changes so that
+ * registers/reports can update themselves; sets feature flag */
+void
+gnc_book_option_num_field_source_change_cb (gboolean num_action)
+{
+    gnc_suspend_gui_refresh ();
+    if (num_action)
+    {
+        /* Set a feature flag in the book for use of the split action field as number.
+         * This will prevent older GnuCash versions that don't support this feature
+         * from opening this file. */
+        gnc_features_set_used (gnc_get_current_book(),
+                               GNC_FEATURE_NUM_FIELD_SOURCE);
+    }
+    gnc_book_option_num_field_source_change (num_action);
+    gnc_resume_gui_refresh ();
+}
+
+/** Calls gnc_book_option_book_currency_selected to initiate registered
+ * callbacks when currency accounting book option changes to book-currency so
+ * that registers/reports can update themselves; sets feature flag */
+void
+gnc_book_option_book_currency_selected_cb (gboolean use_book_currency)
+{
+    gnc_suspend_gui_refresh ();
+    if (use_book_currency)
+    {
+        /* Set a feature flag in the book for use of book currency. This will
+         * prevent older GnuCash versions that don't support this feature from
+         * opening this file. */
+        gnc_features_set_used (gnc_get_current_book(),
+                               GNC_FEATURE_BOOK_CURRENCY);
+    }
+    gnc_book_option_book_currency_selected (use_book_currency);
+    gnc_resume_gui_refresh ();
+}
+
 static gboolean
 show_handler (const char *class_name, gint component_id,
               gpointer user_data, gpointer iter_data)
diff --git a/gnucash/gnome-utils/gncmod-gnome-utils.c b/gnucash/gnome-utils/gncmod-gnome-utils.c
index a063b0dc0..0d901bd85 100644
--- a/gnucash/gnome-utils/gncmod-gnome-utils.c
+++ b/gnucash/gnome-utils/gncmod-gnome-utils.c
@@ -33,6 +33,7 @@
 #include "gnc-module.h"
 #include "gnc-module-api.h"
 
+#include "gnc-component-manager.h"
 #include "dialog-options.h"
 #include "qof.h"
 #include "gnc-gui-query.h"
@@ -85,6 +86,7 @@ libgncmod_gnome_utils_gnc_module_init(int refcount)
     /* Initialize the options-ui database */
     if (refcount == 0)
     {
+        gnc_component_manager_init ();
         gnc_options_ui_initialize ();
     }
 
@@ -94,5 +96,8 @@ libgncmod_gnome_utils_gnc_module_init(int refcount)
 int
 libgncmod_gnome_utils_gnc_module_end(int refcount)
 {
+    if (refcount == 0)
+        gnc_component_manager_shutdown ();
+
     return TRUE;
 }
diff --git a/libgnucash/app-utils/CMakeLists.txt b/libgnucash/app-utils/CMakeLists.txt
index 7f1cc09ad..438b6e92a 100644
--- a/libgnucash/app-utils/CMakeLists.txt
+++ b/libgnucash/app-utils/CMakeLists.txt
@@ -18,7 +18,6 @@ set (app_utils_HEADERS
   gnc-account-merge.h
   gnc-accounting-period.h
   gnc-addr-quickfill.h
-  gnc-component-manager.h
   gnc-entry-quickfill.h
   gnc-euro.h
   gnc-exp-parser.h
@@ -56,7 +55,6 @@ set (app_utils_SOURCES
   gnc-account-merge.c
   gnc-accounting-period.c
   gnc-addr-quickfill.c
-  gnc-component-manager.c
   gnc-entry-quickfill.c
   gnc-euro.c
   gnc-exp-parser.c
diff --git a/libgnucash/app-utils/app-utils.i b/libgnucash/app-utils/app-utils.i
index 9b24346c0..392c964e1 100644
--- a/libgnucash/app-utils/app-utils.i
+++ b/libgnucash/app-utils/app-utils.i
@@ -30,7 +30,6 @@
 #include <gnc-helpers.h>
 #include <gnc-accounting-period.h>
 #include <gnc-session.h>
-#include <gnc-component-manager.h>
 #include <gnc-sx-instance-model.h>
 
 #include "gnc-engine-guile.h"
diff --git a/libgnucash/app-utils/gnc-ui-util.c b/libgnucash/app-utils/gnc-ui-util.c
index 30531cb36..924119bf8 100644
--- a/libgnucash/app-utils/gnc-ui-util.c
+++ b/libgnucash/app-utils/gnc-ui-util.c
@@ -56,8 +56,6 @@
 #include "gnc-session.h"
 #include "engine-helpers.h"
 #include "gnc-locale-utils.h"
-#include "gnc-component-manager.h"
-#include "gnc-features.h"
 #include "gnc-guile-utils.h"
 
 #define GNC_PREF_CURRENCY_CHOICE_LOCALE "currency-choice-locale"
@@ -414,44 +412,6 @@ gnc_get_current_book_tax_type (void)
     }
 }
 
-/** Calls gnc_book_option_num_field_source_change to initiate registered
-  * callbacks when num_field_source book option changes so that
-  * registers/reports can update themselves; sets feature flag */
-void
-gnc_book_option_num_field_source_change_cb (gboolean num_action)
-{
-    gnc_suspend_gui_refresh ();
-    if (num_action)
-    {
-    /* Set a feature flag in the book for use of the split action field as number.
-     * This will prevent older GnuCash versions that don't support this feature
-     * from opening this file. */
-        gnc_features_set_used (gnc_get_current_book(),
-                                                GNC_FEATURE_NUM_FIELD_SOURCE);
-    }
-    gnc_book_option_num_field_source_change (num_action);
-    gnc_resume_gui_refresh ();
-}
-
-/** Calls gnc_book_option_book_currency_selected to initiate registered
-  * callbacks when currency accounting book option changes to book-currency so
-  * that registers/reports can update themselves; sets feature flag */
-void
-gnc_book_option_book_currency_selected_cb (gboolean use_book_currency)
-{
-    gnc_suspend_gui_refresh ();
-    if (use_book_currency)
-    {
-    /* Set a feature flag in the book for use of book currency. This will
-     * prevent older GnuCash versions that don't support this feature from
-     * opening this file. */
-        gnc_features_set_used (gnc_get_current_book(),
-                                GNC_FEATURE_BOOK_CURRENCY);
-    }
-    gnc_book_option_book_currency_selected (use_book_currency);
-    gnc_resume_gui_refresh ();
-}
-
 /** Returns TRUE if both book-currency and default gain/loss policy KVPs exist
   * and are valid and trading accounts are not used. */
 gboolean
diff --git a/libgnucash/app-utils/gncmod-app-utils.c b/libgnucash/app-utils/gncmod-app-utils.c
index 012516f39..3f242d243 100644
--- a/libgnucash/app-utils/gncmod-app-utils.c
+++ b/libgnucash/app-utils/gncmod-app-utils.c
@@ -32,7 +32,6 @@
 #include "gnc-module.h"
 #include "gnc-module-api.h"
 
-#include "gnc-component-manager.h"
 #include "gnc-hooks.h"
 #include "gnc-exp-parser.h"
 
@@ -88,7 +87,6 @@ libgncmod_app_utils_gnc_module_init(int refcount)
 
     if (refcount == 0)
     {
-        gnc_component_manager_init ();
         gnc_hook_add_dangler(HOOK_STARTUP, (GFunc)gnc_exp_parser_init, NULL, NULL);
         gnc_hook_add_dangler(HOOK_SHUTDOWN, (GFunc)app_utils_shutdown, NULL, NULL);
     }
@@ -99,8 +97,5 @@ libgncmod_app_utils_gnc_module_init(int refcount)
 int
 libgncmod_app_utils_gnc_module_end(int refcount)
 {
-    if (refcount == 0)
-        gnc_component_manager_shutdown ();
-
     return TRUE;
 }
diff --git a/po/POTFILES.in b/po/POTFILES.in
index cf4dae017..1c3e7c43a 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -157,6 +157,7 @@ gnucash/gnome-utils/gnc-cell-renderer-popup-entry.c
 gnucash/gnome-utils/gnc-cell-renderer-text-flag.c
 gnucash/gnome-utils/gnc-combott.c
 gnucash/gnome-utils/gnc-commodity-edit.c
+gnucash/gnome-utils/gnc-component-manager.c
 gnucash/gnome-utils/gnc-currency-edit.c
 gnucash/gnome-utils/gnc-date-delta.c
 gnucash/gnome-utils/gnc-date-edit.c
@@ -528,7 +529,6 @@ libgnucash/app-utils/gfec.c
 libgnucash/app-utils/gnc-accounting-period.c
 libgnucash/app-utils/gnc-account-merge.c
 libgnucash/app-utils/gnc-addr-quickfill.c
-libgnucash/app-utils/gnc-component-manager.c
 libgnucash/app-utils/gnc-entry-quickfill.c
 libgnucash/app-utils/gnc-euro.c
 libgnucash/app-utils/gnc-exp-parser.c

commit 0de3dc6bf17ce2a924560d61b9fda58b0f47b5f3
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Nov 26 16:19:17 2019 +0100

    guile/bindings cleanup - only load module gnome-modules when really in use

diff --git a/bindings/guile/price-quotes.scm b/bindings/guile/price-quotes.scm
index 678c0abbf..d905d9739 100644
--- a/bindings/guile/price-quotes.scm
+++ b/bindings/guile/price-quotes.scm
@@ -28,6 +28,7 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash core-utils))
+(use-modules (gnucash app-utils))
 (use-modules (gnucash gnome-utils))
 (use-modules (srfi srfi-11)
              (srfi srfi-1))
diff --git a/gnucash/report/reports/aging.scm b/gnucash/report/reports/aging.scm
index 6619104fa..25df77d90 100644
--- a/gnucash/report/reports/aging.scm
+++ b/gnucash/report/reports/aging.scm
@@ -30,7 +30,6 @@
 (use-modules (gnucash utilities))
 (use-modules (gnucash core-utils))
 (use-modules (gnucash app-utils))
-(use-modules (gnucash gnome-utils))
 (use-modules (gnucash report))
 
 (define optname-to-date (N_ "To"))
diff --git a/gnucash/report/reports/example/sample-graphs.scm b/gnucash/report/reports/example/sample-graphs.scm
index ed1fe9c2e..53fda5051 100644
--- a/gnucash/report/reports/example/sample-graphs.scm
+++ b/gnucash/report/reports/example/sample-graphs.scm
@@ -28,7 +28,7 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash app-utils))
-(use-modules (gnucash gnome-utils)) ;for gnc-build-url
+(use-modules (gnucash html))
 (use-modules (gnucash report))
 
 ;; Add this module to enable translatable strings
diff --git a/gnucash/report/reports/standard/budget-flow.scm b/gnucash/report/reports/standard/budget-flow.scm
index 0a31c5edf..17de16e9e 100644
--- a/gnucash/report/reports/standard/budget-flow.scm
+++ b/gnucash/report/reports/standard/budget-flow.scm
@@ -30,7 +30,6 @@
 (use-modules (gnucash utilities))
 (use-modules (gnucash core-utils))
 (use-modules (gnucash app-utils))
-(use-modules (gnucash gnome-utils)) ;for gnc-build-url
 (use-modules (gnucash report))
 
 (define reportname
diff --git a/gnucash/report/reports/standard/budget.scm b/gnucash/report/reports/standard/budget.scm
index b866e0f9c..fa5f8df1b 100644
--- a/gnucash/report/reports/standard/budget.scm
+++ b/gnucash/report/reports/standard/budget.scm
@@ -31,7 +31,6 @@
 (use-modules (gnucash utilities))
 (use-modules (gnucash core-utils))
 (use-modules (gnucash app-utils))
-(use-modules (gnucash gnome-utils)) ;for gnc-build-url
 (use-modules (gnucash report))
 
 (use-modules (srfi srfi-1))
diff --git a/gnucash/report/reports/standard/cash-flow.scm b/gnucash/report/reports/standard/cash-flow.scm
index 9f23e9231..b9a86b71d 100644
--- a/gnucash/report/reports/standard/cash-flow.scm
+++ b/gnucash/report/reports/standard/cash-flow.scm
@@ -32,7 +32,6 @@
 (use-modules (gnucash utilities))
 (use-modules (gnucash core-utils))
 (use-modules (gnucash app-utils))
-(use-modules (gnucash gnome-utils)) ;for gnc-build-url
 (use-modules (gnucash report))
 
 (export cash-flow-calc-money-in-out)

commit 4c77f7670efbac4dcddfaf95b13764727e5f8c75
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sun Nov 24 18:30:33 2019 +0100

    engine - remove gncmod boilerplate
    
    engine is now an ordinary shared library
    
    This requires a few more places to run gnc_engine_init as
    this is no longer done as part of module loading.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 54e72a9bc..5b3544bac 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -868,7 +868,7 @@ configure_file(
 add_custom_target(uninstall
         COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
 
-set(_MODULES gnc-core-utils gnc-module gnc-backend-xml-utils gnucash-guile)
+set(_MODULES gnc-core-utils gnc-engine gnc-module gnc-backend-xml-utils gnucash-guile)
 
 if (WITH_SQL)
   list(APPEND _MODULES gnc-backend-sql)
diff --git a/bindings/guile/CMakeLists.txt b/bindings/guile/CMakeLists.txt
index a4ece1546..ced12f94d 100644
--- a/bindings/guile/CMakeLists.txt
+++ b/bindings/guile/CMakeLists.txt
@@ -10,7 +10,7 @@ gnc_add_swig_guile_command (swig-core-utils-guile-c
 )
 
 # Command to generate the swig-engine.c wrapper file
-gnc_swig_extract_header_files (gncmod-engine ENGINE_HEADERS)
+gnc_swig_extract_header_files (gnc-engine ENGINE_HEADERS)
 gnc_add_swig_guile_command (swig-engine-c
     SWIG_ENGINE_C swig-engine.c
     ${CMAKE_SOURCE_DIR}/bindings/engine.i
@@ -66,7 +66,7 @@ target_link_libraries(gnucash-guile
         ${GUILE_LDFLAGS}
     PRIVATE
         gnc-core-utils
-        gncmod-engine
+        gnc-engine
         gnc-module
         ${GLIB2_LDFLAGS})
 
@@ -111,7 +111,7 @@ endif(WITH_SQL)
 
 set(GUILE_DEPENDS
   ${BACKEND_DEPENDS}
-  gncmod-engine
+  gnc-engine
   gnucash-guile)
 
 
diff --git a/bindings/guile/test/CMakeLists.txt b/bindings/guile/test/CMakeLists.txt
index 5467de122..17be2b82c 100644
--- a/bindings/guile/test/CMakeLists.txt
+++ b/bindings/guile/test/CMakeLists.txt
@@ -15,7 +15,7 @@ set(ENGINE_TEST_INCLUDE_DIRS
 )
 
 set(ENGINE_TEST_LIBS
-    gncmod-engine
+    gnc-engine
     gncmod-test-engine
     test-core
     gnucash-guile
@@ -80,7 +80,7 @@ if (HAVE_SRFI64)
     gnc_add_scheme_test_targets (scm-test-with-srfi64
         "${scm_tests_with_srfi64_SOURCES}"
         "tests"
-        "${GUILE_DEPENDS};scm-test-engine-extras;scm-srfi64-extras;gncmod-engine"
+        "${GUILE_DEPENDS};scm-test-engine-extras;scm-srfi64-extras;gnc-engine"
         FALSE
     )
 
diff --git a/bindings/guile/test/test-scm-query.cpp b/bindings/guile/test/test-scm-query.cpp
index 90f092623..d4b3bc8cf 100644
--- a/bindings/guile/test/test-scm-query.cpp
+++ b/bindings/guile/test/test-scm-query.cpp
@@ -84,8 +84,7 @@ run_tests (void)
 static void
 main_helper (void *closure, int argc, char **argv)
 {
-    gnc_module_system_init ();
-    gnc_module_load("gnucash/engine", 0);
+    gnc_engine_init (0, NULL);
 
     xaccLogDisable ();
 
diff --git a/bindings/python/CMakeLists.txt b/bindings/python/CMakeLists.txt
index 3a6646725..79775f28e 100644
--- a/bindings/python/CMakeLists.txt
+++ b/bindings/python/CMakeLists.txt
@@ -76,7 +76,7 @@ if(WITH_PYTHON)
   add_library(gnucash_core_c MODULE ${SWIG_GNUCASH_CORE_C})
   target_include_directories(gnucash_core_c PRIVATE ${gnucash_core_c_INCLUDE_DIRS})
 
-  target_link_libraries(gnucash_core_c gncmod-app-utils gncmod-engine gnc-module ${GLIB_LIBS} ${PYTHON_LIBRARIES})
+  target_link_libraries(gnucash_core_c gncmod-app-utils gnc-engine gnc-module ${GLIB_LIBS} ${PYTHON_LIBRARIES})
   set_target_properties(gnucash_core_c PROPERTIES PREFIX "_")
   target_compile_options(gnucash_core_c PRIVATE -Wno-implicit -Wno-missing-prototypes -Wno-declaration-after-statement -Wno-missing-declarations)
   if (HAVE_STRINGOP_TRUNCATION)
@@ -84,7 +84,7 @@ if(WITH_PYTHON)
   endif()
 
   add_executable(sqlite3test EXCLUDE_FROM_ALL sqlite3test.c ${SWIG_GNUCASH_CORE_C})
-  target_link_libraries(sqlite3test gncmod-app-utils gncmod-engine gnc-module ${GLIB_LIBS} ${PYTHON_LIBRARIES})
+  target_link_libraries(sqlite3test gncmod-app-utils gnc-engine gnc-module ${GLIB_LIBS} ${PYTHON_LIBRARIES})
   target_include_directories(sqlite3test PRIVATE ${gnucash_core_c_INCLUDE_DIRS})
   target_compile_options(sqlite3test PRIVATE -Wno-implicit -Wno-missing-prototypes -Wno-declaration-after-statement -Wno-missing-declarations)
   if (HAVE_STRINGOP_TRUNCATION)
diff --git a/common/test-core/CMakeLists.txt b/common/test-core/CMakeLists.txt
index 34fde1e7e..dc05fb7d2 100644
--- a/common/test-core/CMakeLists.txt
+++ b/common/test-core/CMakeLists.txt
@@ -22,7 +22,7 @@ set_dist_list(test_core_DIST ${test_core_SOURCES} ${test_core_noinst_HEADERS} CM
         unittest-support.i unittest-support.scm)
 
 add_library(test-core STATIC ${test_core_SOURCES} ${test_core_noinst_HEADERS})
-target_link_libraries(test-core gncmod-engine ${GLIB2_LDFLAGS})
+target_link_libraries(test-core gnc-engine ${GLIB2_LDFLAGS})
 if (UNIX)
   target_compile_options(test-core PRIVATE -fPIC)
 endif()
diff --git a/gnucash/CMakeLists.txt b/gnucash/CMakeLists.txt
index 875f89dad..3d70de63d 100644
--- a/gnucash/CMakeLists.txt
+++ b/gnucash/CMakeLists.txt
@@ -52,7 +52,7 @@ endif (BUILDING_FROM_VCS)
 
 target_link_libraries (gnucash
    gncmod-ledger-core gnc-gnome gncmod-gnome-utils gncmod-app-utils
-   gncmod-engine gnc-module gnc-core-utils gncmod-report gnucash-guile
+   gnc-engine gnc-module gnc-core-utils gncmod-report gnucash-guile
    PkgConfig::GTK3 ${GUILE_LDFLAGS} ${GLIB2_LDFLAGS} ${GTK_MAC_LDFLAGS}
 )
 
diff --git a/gnucash/gnome-search/gncmod-gnome-search.c b/gnucash/gnome-search/gncmod-gnome-search.c
index afdf4d48b..ad5829fc7 100644
--- a/gnucash/gnome-search/gncmod-gnome-search.c
+++ b/gnucash/gnome-search/gncmod-gnome-search.c
@@ -60,12 +60,6 @@ libgncmod_gnome_search_gnc_module_description(void)
 int
 libgncmod_gnome_search_gnc_module_init(int refcount)
 {
-    /* load the engine (we depend on it) */
-    if (!gnc_module_load("gnucash/engine", 0))
-    {
-        return FALSE;
-    }
-
     if (!gnc_module_load("gnucash/gnome-utils", 0))
     {
         return FALSE;
diff --git a/gnucash/gnome-utils/CMakeLists.txt b/gnucash/gnome-utils/CMakeLists.txt
index b5d97e14c..7ceb5c93c 100644
--- a/gnucash/gnome-utils/CMakeLists.txt
+++ b/gnucash/gnome-utils/CMakeLists.txt
@@ -206,7 +206,7 @@ add_library (gncmod-gnome-utils
 
 target_link_libraries(gncmod-gnome-utils
     gncmod-app-utils
-    gncmod-engine
+    gnc-engine
     gnc-backend-xml-utils
     gnucash-guile
     PkgConfig::GTK3
diff --git a/gnucash/gnome-utils/gncmod-gnome-utils.c b/gnucash/gnome-utils/gncmod-gnome-utils.c
index ced36ae49..a063b0dc0 100644
--- a/gnucash/gnome-utils/gncmod-gnome-utils.c
+++ b/gnucash/gnome-utils/gncmod-gnome-utils.c
@@ -73,12 +73,6 @@ extern SCM scm_init_sw_gnome_utils_module(void);
 int
 libgncmod_gnome_utils_gnc_module_init(int refcount)
 {
-    /* load the engine (we depend on it) */
-    if (!gnc_module_load("gnucash/engine", 0))
-    {
-        return FALSE;
-    }
-
     if (!gnc_module_load("gnucash/app-utils", 0))
     {
         return FALSE;
diff --git a/gnucash/gnome-utils/test/CMakeLists.txt b/gnucash/gnome-utils/test/CMakeLists.txt
index 385a07ecf..509777b33 100644
--- a/gnucash/gnome-utils/test/CMakeLists.txt
+++ b/gnucash/gnome-utils/test/CMakeLists.txt
@@ -33,7 +33,7 @@ set(GUILE_DEPENDS
   gncmod-test-engine
   gncmod-app-utils
   gnc-core-utils
-  gncmod-engine
+  gnc-engine
 )
 
 gnc_add_scheme_test_targets(scm-test-load-gnome-utils-module
diff --git a/gnucash/gnome/CMakeLists.txt b/gnucash/gnome/CMakeLists.txt
index e6a62c9a7..c8e319e45 100644
--- a/gnucash/gnome/CMakeLists.txt
+++ b/gnucash/gnome/CMakeLists.txt
@@ -144,7 +144,7 @@ target_link_libraries(gnc-gnome
     gncmod-register-gnome
     gncmod-register-core
     gncmod-gnome-utils
-    gncmod-engine
+    gnc-engine
     gnucash-guile
     ${Boost_LIBRARIES}
     PkgConfig::GTK3
diff --git a/gnucash/gnucash-bin.c b/gnucash/gnucash-bin.c
index f9b0614a3..b77bf3514 100644
--- a/gnucash/gnucash-bin.c
+++ b/gnucash/gnucash-bin.c
@@ -487,7 +487,6 @@ load_gnucash_modules()
         gboolean optional;
     } modules[] =
     {
-        { "gnucash/engine", 0, FALSE },
         { "gnucash/app-utils", 0, FALSE },
         { "gnucash/gnome-utils", 0, FALSE },
         { "gnucash/gnome-search", 0, FALSE },
@@ -518,15 +517,6 @@ load_gnucash_modules()
             gnc_module_load(modules[i].name, modules[i].version);
         DEBUG("Loading module %s finished", modules[i].name);
     }
-    if (!gnc_engine_is_initialized())
-    {
-        /* On Windows this check used to fail anyway, see
-         * https://lists.gnucash.org/pipermail/gnucash-devel/2006-September/018529.html
-         * but more recently it seems to work as expected
-         * again. 2006-12-20, cstim. */
-        g_warning("GnuCash engine failed to initialize.  Exiting.\n");
-        exit(1);
-    }
 }
 
 static void
@@ -900,6 +890,7 @@ main(int argc, char ** argv)
         g_print("\n\n%s\n", userdata_migration_msg);
 
     gnc_log_init();
+    gnc_engine_init (0, NULL);
 
     /* Write some locale details to the log to simplify debugging */
     PINFO ("System locale returned %s", sys_locale ? sys_locale : "(null)");
diff --git a/gnucash/html/CMakeLists.txt b/gnucash/html/CMakeLists.txt
index 13e4a7c5d..885357eaa 100644
--- a/gnucash/html/CMakeLists.txt
+++ b/gnucash/html/CMakeLists.txt
@@ -54,7 +54,7 @@ add_library (gncmod-html
   ${html_HEADERS}
 )
 
-target_link_libraries(gncmod-html gncmod-engine gnc-module gncmod-gnome-utils
+target_link_libraries(gncmod-html gnc-engine gnc-module gncmod-gnome-utils
   PkgConfig::GTK3 PkgConfig::WEBKIT ${GUILE_LDFLAGS})
 
 target_compile_definitions(gncmod-html PRIVATE -DG_LOG_DOMAIN=\"gnc.html\")
diff --git a/gnucash/html/gncmod-html.c b/gnucash/html/gncmod-html.c
index afd01486b..8a4d08277 100644
--- a/gnucash/html/gncmod-html.c
+++ b/gnucash/html/gncmod-html.c
@@ -73,12 +73,6 @@ extern SCM scm_init_sw_gnc_html_module( void );
 int
 libgncmod_html_gnc_module_init( int refcount )
 {
-    /* load the engine (we depend on it) */
-    if ( !gnc_module_load( "gnucash/engine", 0 ) )
-    {
-        return FALSE;
-    }
-
     if ( !gnc_module_load( "gnucash/app-utils", 0 ) )
     {
         return FALSE;
diff --git a/gnucash/import-export/CMakeLists.txt b/gnucash/import-export/CMakeLists.txt
index 413889878..cddad2994 100644
--- a/gnucash/import-export/CMakeLists.txt
+++ b/gnucash/import-export/CMakeLists.txt
@@ -51,7 +51,7 @@ add_library (gncmod-generic-import
   ${generic_import_noinst_HEADERS}
 )
 
-target_link_libraries(gncmod-generic-import gncmod-gnome-utils gncmod-engine PkgConfig::GTK3 ${GLIB2_LDFLAGS})
+target_link_libraries(gncmod-generic-import gncmod-gnome-utils gnc-engine PkgConfig::GTK3 ${GLIB2_LDFLAGS})
 
 target_compile_definitions (gncmod-generic-import PRIVATE -DG_LOG_DOMAIN=\"gnc.import\")
 
diff --git a/gnucash/import-export/aqb/CMakeLists.txt b/gnucash/import-export/aqb/CMakeLists.txt
index 74cc2d327..81c71cab4 100644
--- a/gnucash/import-export/aqb/CMakeLists.txt
+++ b/gnucash/import-export/aqb/CMakeLists.txt
@@ -56,7 +56,7 @@ if(WITH_AQBANKING)
 
   target_link_libraries(gncmod-aqbanking gnc-gnome gncmod-gnome-utils
          gncmod-generic-import gncmod-register-core
-         gncmod-register-gnome gncmod-ledger-core gncmod-engine gwengui-gtk3
+         gncmod-register-gnome gncmod-ledger-core gnc-engine gwengui-gtk3
          ${AQB_EXPORT_SYMBOLS} ${AQBANKING_LDFLAGS}
          ${GWENHYWFAR_LDFLAGS} 
          ${GNOME_LDFLAGS} ${AQB_LIBSTDCXX})
diff --git a/gnucash/import-export/aqb/gncmod-aqbanking.c b/gnucash/import-export/aqb/gncmod-aqbanking.c
index 7901eddca..4f678891f 100644
--- a/gnucash/import-export/aqb/gncmod-aqbanking.c
+++ b/gnucash/import-export/aqb/gncmod-aqbanking.c
@@ -62,8 +62,7 @@ gint
 libgncmod_aqbanking_gnc_module_init(gint refcount)
 {
     /* Load modules we depend on */
-    if (!gnc_module_load("gnucash/engine", 0)
-            || !gnc_module_load("gnucash/app-utils", 0)
+    if (!gnc_module_load("gnucash/app-utils", 0)
             || !gnc_module_load("gnucash/gnome-utils", 0)
             || !gnc_module_load("gnucash/import-export", 0))
     {
diff --git a/gnucash/import-export/aqb/test/CMakeLists.txt b/gnucash/import-export/aqb/test/CMakeLists.txt
index 651eb1170..30ad13014 100644
--- a/gnucash/import-export/aqb/test/CMakeLists.txt
+++ b/gnucash/import-export/aqb/test/CMakeLists.txt
@@ -22,7 +22,7 @@ set(test_aqb_INCLUDE_DIRS
 set(test_aqb_LIBS
   gncmod-aqbanking gncmod-generic-import gnc-gnome gncmod-gnome-utils
   gncmod-ledger-core gncmod-app-utils
-  gncmod-backend-xml-utils gncmod-engine gnc-core-utils gnc-module
+  gncmod-backend-xml-utils gnc-engine gnc-core-utils gnc-module
   ${GLIB2_LDFLAGS}
 )
 
diff --git a/gnucash/import-export/bi-import/CMakeLists.txt b/gnucash/import-export/bi-import/CMakeLists.txt
index 071f70ee3..1ec36809a 100644
--- a/gnucash/import-export/bi-import/CMakeLists.txt
+++ b/gnucash/import-export/bi-import/CMakeLists.txt
@@ -22,7 +22,7 @@ target_link_libraries(gncmod-bi-import
   gncmod-gnome-utils
   gncmod-gnome-search
   gncmod-app-utils
-  gncmod-engine
+  gnc-engine
   gnc-core-utils
   gnc-module
   gnc-gnome
diff --git a/gnucash/import-export/bi-import/gncmod-bi-import.c b/gnucash/import-export/bi-import/gncmod-bi-import.c
index aaa5cbdac..1aa763207 100644
--- a/gnucash/import-export/bi-import/gncmod-bi-import.c
+++ b/gnucash/import-export/bi-import/gncmod-bi-import.c
@@ -73,10 +73,6 @@ libgncmod_bi_import_gnc_module_init (int refcount)
     {
         return FALSE;
     }
-    if (!gnc_module_load ("gnucash/engine", 0))
-    {
-        return FALSE;
-    }
 
     if (refcount == 0)
     {
diff --git a/gnucash/import-export/csv-exp/CMakeLists.txt b/gnucash/import-export/csv-exp/CMakeLists.txt
index 4f47338f7..8351e7a24 100644
--- a/gnucash/import-export/csv-exp/CMakeLists.txt
+++ b/gnucash/import-export/csv-exp/CMakeLists.txt
@@ -18,7 +18,7 @@ set(csv_export_noinst_HEADERS
 
 add_library(gncmod-csv-export ${csv_export_noinst_HEADERS} ${csv_export_SOURCES})
 
-target_link_libraries(gncmod-csv-export gncmod-register-gnome gncmod-register-core gncmod-ledger-core gncmod-engine
+target_link_libraries(gncmod-csv-export gncmod-register-gnome gncmod-register-core gncmod-ledger-core gnc-engine
                          gnc-module gncmod-gnome-utils gnc-gnome gncmod-app-utils gnc-core-utils)
 
 target_compile_definitions(gncmod-csv-export PRIVATE -DG_LOG_DOMAIN=\"gnc.export.csv\")
diff --git a/gnucash/import-export/csv-exp/gncmod-csv-export.c b/gnucash/import-export/csv-exp/gncmod-csv-export.c
index 99292d853..7a2dca980 100644
--- a/gnucash/import-export/csv-exp/gncmod-csv-export.c
+++ b/gnucash/import-export/csv-exp/gncmod-csv-export.c
@@ -59,10 +59,6 @@ libgncmod_csv_export_gnc_module_description(void)
 int
 libgncmod_csv_export_gnc_module_init(int refcount)
 {
-    if (!gnc_module_load("gnucash/engine", 0))
-    {
-        return FALSE;
-    }
     if (!gnc_module_load("gnucash/app-utils", 0))
     {
         return FALSE;
diff --git a/gnucash/import-export/csv-imp/CMakeLists.txt b/gnucash/import-export/csv-imp/CMakeLists.txt
index c31aa80f8..e600912ed 100644
--- a/gnucash/import-export/csv-imp/CMakeLists.txt
+++ b/gnucash/import-export/csv-imp/CMakeLists.txt
@@ -69,7 +69,7 @@ target_link_libraries(
   gncmod-generic-import
   gncmod-gnome-utils
   gncmod-app-utils
-  gncmod-engine
+  gnc-engine
   gnc-core-utils
   gnc-module)
 
diff --git a/gnucash/import-export/csv-imp/gncmod-csv-import.c b/gnucash/import-export/csv-imp/gncmod-csv-import.c
index 4fc1eea1b..52be6ea52 100644
--- a/gnucash/import-export/csv-imp/gncmod-csv-import.c
+++ b/gnucash/import-export/csv-imp/gncmod-csv-import.c
@@ -59,10 +59,6 @@ libgncmod_csv_import_gnc_module_description(void)
 int
 libgncmod_csv_import_gnc_module_init(int refcount)
 {
-    if (!gnc_module_load("gnucash/engine", 0))
-    {
-        return FALSE;
-    }
     if (!gnc_module_load("gnucash/app-utils", 0))
     {
         return FALSE;
diff --git a/gnucash/import-export/csv-imp/test/CMakeLists.txt b/gnucash/import-export/csv-imp/test/CMakeLists.txt
index 52b11cbcb..113fb6e58 100644
--- a/gnucash/import-export/csv-imp/test/CMakeLists.txt
+++ b/gnucash/import-export/csv-imp/test/CMakeLists.txt
@@ -7,7 +7,7 @@ set(CSV_IMP_TEST_INCLUDE_DIRS
   ${CMAKE_SOURCE_DIR}/lib
   ${GLIB2_INCLUDE_DIRS}
 )
-set(CSV_IMP_TEST_LIBS gncmod-csv-import gncmod-engine test-core)
+set(CSV_IMP_TEST_LIBS gncmod-csv-import gnc-engine test-core)
 
 # This test does not run in Win32
 if (NOT WIN32)
diff --git a/gnucash/import-export/customer-import/CMakeLists.txt b/gnucash/import-export/customer-import/CMakeLists.txt
index 197ffc544..3380d4ddf 100644
--- a/gnucash/import-export/customer-import/CMakeLists.txt
+++ b/gnucash/import-export/customer-import/CMakeLists.txt
@@ -18,7 +18,7 @@ set(customer_import_noinst_HEADERS
 add_library(gncmod-customer-import ${customer_import_SOURCES} ${customer_import_noinst_HEADERS})
 
 target_link_libraries(gncmod-customer-import gnc-gnome gncmod-gnome-utils gncmod-app-utils
-     gncmod-engine gnc-core-utils gnc-module ${GLIB2_LDFLAGS})
+     gnc-engine gnc-core-utils gnc-module ${GLIB2_LDFLAGS})
 
 target_include_directories(gncmod-customer-import
   PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
diff --git a/gnucash/import-export/customer-import/gncmod-customer-import.c b/gnucash/import-export/customer-import/gncmod-customer-import.c
index c127c1b8f..945d8e08f 100644
--- a/gnucash/import-export/customer-import/gncmod-customer-import.c
+++ b/gnucash/import-export/customer-import/gncmod-customer-import.c
@@ -73,13 +73,6 @@ libgncmod_customer_import_gnc_module_init (int refcount)
     {
         return FALSE;
     }
-    //if (!gnc_module_load ("gnucash/business-core", 0)) {
-    //    return FALSE;
-    //}
-    if (!gnc_module_load ("gnucash/engine", 0))
-    {
-        return FALSE;
-    }
 
     if (refcount == 0)
     {
diff --git a/gnucash/import-export/gncmod-generic-import.c b/gnucash/import-export/gncmod-generic-import.c
index a34765920..7a68554ad 100644
--- a/gnucash/import-export/gncmod-generic-import.c
+++ b/gnucash/import-export/gncmod-generic-import.c
@@ -58,10 +58,6 @@ libgncmod_generic_import_gnc_module_description(void)
 int
 libgncmod_generic_import_gnc_module_init(int refcount)
 {
-    if (!gnc_module_load("gnucash/engine", 0))
-    {
-        return FALSE;
-    }
     if (!gnc_module_load("gnucash/app-utils", 0))
     {
         return FALSE;
diff --git a/gnucash/import-export/log-replay/CMakeLists.txt b/gnucash/import-export/log-replay/CMakeLists.txt
index b7bb5d7a6..8e6d71a1a 100644
--- a/gnucash/import-export/log-replay/CMakeLists.txt
+++ b/gnucash/import-export/log-replay/CMakeLists.txt
@@ -15,7 +15,7 @@ set(log_replay_noinst_HEADERS
 
 add_library(gncmod-log-replay ${log_replay_SOURCES} ${log_replay_noinst_HEADERS})
 
-target_link_libraries(gncmod-log-replay gncmod-gnome-utils gncmod-app-utils gncmod-engine
+target_link_libraries(gncmod-log-replay gncmod-gnome-utils gncmod-app-utils gnc-engine
      gnc-core-utils gnc-module PkgConfig::GTK3)
 
 target_compile_definitions(gncmod-log-replay PRIVATE -DG_LOG_DOMAIN=\"gnc.import.log-replay\")
diff --git a/gnucash/import-export/log-replay/gncmod-log-replay.c b/gnucash/import-export/log-replay/gncmod-log-replay.c
index 4ace77655..a27729d17 100644
--- a/gnucash/import-export/log-replay/gncmod-log-replay.c
+++ b/gnucash/import-export/log-replay/gncmod-log-replay.c
@@ -61,10 +61,6 @@ libgncmod_log_replay_gnc_module_description(void)
 int
 libgncmod_log_replay_gnc_module_init(int refcount)
 {
-    if (!gnc_module_load("gnucash/engine", 0))
-    {
-        return FALSE;
-    }
     if (!gnc_module_load("gnucash/app-utils", 0))
     {
         return FALSE;
diff --git a/gnucash/import-export/ofx/CMakeLists.txt b/gnucash/import-export/ofx/CMakeLists.txt
index 2d968e735..c850b1293 100644
--- a/gnucash/import-export/ofx/CMakeLists.txt
+++ b/gnucash/import-export/ofx/CMakeLists.txt
@@ -20,7 +20,7 @@ set(ofx_UI gnc-plugin-ofx-ui.xml)
 if (WITH_OFX)
   add_library(gncmod-ofx ${ofx_SOURCES} ${ofx_noinst_HEADERS})
 
-  target_link_libraries(gncmod-ofx gncmod-generic-import gncmod-engine gncmod-app-utils gnc-core-utils
+  target_link_libraries(gncmod-ofx gncmod-generic-import gnc-engine gncmod-app-utils gnc-core-utils
                     gncmod-gnome-utils ${LIBOFX_LDFLAGS})
 
   target_compile_definitions(gncmod-ofx PRIVATE -DG_LOG_DOMAIN=\"gnc.import.ofx\")
diff --git a/gnucash/import-export/ofx/gncmod-ofx-import.c b/gnucash/import-export/ofx/gncmod-ofx-import.c
index 4a758c36b..897b30bc6 100644
--- a/gnucash/import-export/ofx/gncmod-ofx-import.c
+++ b/gnucash/import-export/ofx/gncmod-ofx-import.c
@@ -61,10 +61,6 @@ libgncmod_ofx_gnc_module_description(void)
 int
 libgncmod_ofx_gnc_module_init(int refcount)
 {
-    if (!gnc_module_load("gnucash/engine", 0))
-    {
-        return FALSE;
-    }
     if (!gnc_module_load("gnucash/app-utils", 0))
     {
         return FALSE;
diff --git a/gnucash/import-export/qif-imp/gncmod-qif-import.c b/gnucash/import-export/qif-imp/gncmod-qif-import.c
index 8b0b414bd..188a0ed97 100644
--- a/gnucash/import-export/qif-imp/gncmod-qif-import.c
+++ b/gnucash/import-export/qif-imp/gncmod-qif-import.c
@@ -62,11 +62,6 @@ libgncmod_qif_import_gnc_module_description(void)
 int
 libgncmod_qif_import_gnc_module_init(int refcount)
 {
-    if (!gnc_module_load("gnucash/engine", 0))
-    {
-        return FALSE;
-    }
-
     if (!gnc_module_load("gnucash/app-utils", 0))
     {
         return FALSE;
diff --git a/gnucash/register/ledger-core/CMakeLists.txt b/gnucash/register/ledger-core/CMakeLists.txt
index 0b671cee2..057ec60c0 100644
--- a/gnucash/register/ledger-core/CMakeLists.txt
+++ b/gnucash/register/ledger-core/CMakeLists.txt
@@ -45,7 +45,7 @@ set_source_files_properties (${ledger_core_SOURCES} PROPERTIES OBJECT_DEPENDS ${
 add_library (gncmod-ledger-core ${ledger_core_SOURCES} ${ledger_core_HEADERS})
 
 target_link_libraries(gncmod-ledger-core gncmod-register-gnome gncmod-register-core gncmod-gnome-utils
-        gncmod-engine gnc-core-utils PkgConfig::GTK3)
+        gnc-engine gnc-core-utils PkgConfig::GTK3)
 
 target_compile_definitions (gncmod-ledger-core PRIVATE -DG_LOG_DOMAIN=\"gnc.register.ledger\")
 
diff --git a/gnucash/register/ledger-core/gncmod-ledger-core.c b/gnucash/register/ledger-core/gncmod-ledger-core.c
index 543e7edc8..c08575918 100644
--- a/gnucash/register/ledger-core/gncmod-ledger-core.c
+++ b/gnucash/register/ledger-core/gncmod-ledger-core.c
@@ -56,11 +56,6 @@ libgncmod_ledger_core_gnc_module_description(void)
 int
 libgncmod_ledger_core_gnc_module_init(int refcount)
 {
-    if (!gnc_module_load("gnucash/engine", 0))
-    {
-        return FALSE;
-    }
-
     if (!gnc_module_load("gnucash/register/register-core", 0))
     {
         return FALSE;
diff --git a/gnucash/register/register-core/gncmod-register-core.c b/gnucash/register/register-core/gncmod-register-core.c
index 10ec59dc0..08f4fcd36 100644
--- a/gnucash/register/register-core/gncmod-register-core.c
+++ b/gnucash/register/register-core/gncmod-register-core.c
@@ -57,11 +57,6 @@ libgncmod_register_core_gnc_module_description(void)
 int
 libgncmod_register_core_gnc_module_init(int refcount)
 {
-    if (!gnc_module_load("gnucash/engine", 0))
-    {
-        return FALSE;
-    }
-
     /* FIXME. We need this for the wide-character functions.
      * When fixing, get rid of gnome-utils includes, too. */
     if (!gnc_module_load("gnucash/gnome-utils", 0))
diff --git a/gnucash/report/gncmod-report.c b/gnucash/report/gncmod-report.c
index b4830cdbf..c6cf26f72 100644
--- a/gnucash/report/gncmod-report.c
+++ b/gnucash/report/gncmod-report.c
@@ -60,12 +60,6 @@ extern SCM scm_init_sw_report_module(void);
 int
 libgncmod_report_gnc_module_init(int refcount)
 {
-    /* load the engine (we depend on it) */
-    if (!gnc_module_load("gnucash/engine", 0))
-    {
-        return FALSE;
-    }
-
     if (!gnc_module_load("gnucash/app-utils", 0))
     {
         return FALSE;
diff --git a/libgnucash/app-utils/CMakeLists.txt b/libgnucash/app-utils/CMakeLists.txt
index 9e47e3a10..7f1cc09ad 100644
--- a/libgnucash/app-utils/CMakeLists.txt
+++ b/libgnucash/app-utils/CMakeLists.txt
@@ -75,7 +75,7 @@ set_source_files_properties (${app_utils_SOURCES} PROPERTIES OBJECT_DEPENDS ${CO
 
 set(app_utils_ALL_SOURCES ${app_utils_SOURCES} ${app_utils_HEADERS} ${app_utils_noinst_HEADERS})
 set(app_utils_ALL_LIBRARIES
-    gncmod-engine
+    gnc-engine
     gnc-module
     gnucash-guile
     ${GIO_LDFLAGS}
diff --git a/libgnucash/app-utils/gncmod-app-utils.c b/libgnucash/app-utils/gncmod-app-utils.c
index 12dcc6896..012516f39 100644
--- a/libgnucash/app-utils/gncmod-app-utils.c
+++ b/libgnucash/app-utils/gncmod-app-utils.c
@@ -80,12 +80,6 @@ extern SCM scm_init_sw_app_utils_module(void);
 int
 libgncmod_app_utils_gnc_module_init(int refcount)
 {
-    /* load the engine (we depend on it) */
-    if (!gnc_module_load("gnucash/engine", 0))
-    {
-        return FALSE;
-    }
-
     scm_init_sw_app_utils_module();
     /* publish swig bindings */
     /* load the scheme code */
diff --git a/libgnucash/app-utils/test/test-print-queries.cpp b/libgnucash/app-utils/test/test-print-queries.cpp
index b541deb17..783a2a540 100644
--- a/libgnucash/app-utils/test/test-print-queries.cpp
+++ b/libgnucash/app-utils/test/test-print-queries.cpp
@@ -77,7 +77,6 @@ main_helper (void *closure, int argc, char **argv)
 {
     int count = 50;
 
-    gnc_module_load("gnucash/engine", 0);
     gnc_module_load("gnucash/app-utils", 0);
 
     if (argc > 1)
diff --git a/libgnucash/app-utils/test/test-scm-query-string.cpp b/libgnucash/app-utils/test/test-scm-query-string.cpp
index 7772875bb..9b685c8c7 100644
--- a/libgnucash/app-utils/test/test-scm-query-string.cpp
+++ b/libgnucash/app-utils/test/test-scm-query-string.cpp
@@ -113,7 +113,6 @@ static void
 main_helper (void *closure, int argc, char **argv)
 {
     gnc_module_system_init ();
-    gnc_module_load("gnucash/engine", 0);
     gnc_module_load("gnucash/app-utils", 0);
 
     xaccLogDisable ();
diff --git a/libgnucash/backend/dbi/CMakeLists.txt b/libgnucash/backend/dbi/CMakeLists.txt
index ff7d760c7..c50a05e5c 100644
--- a/libgnucash/backend/dbi/CMakeLists.txt
+++ b/libgnucash/backend/dbi/CMakeLists.txt
@@ -33,7 +33,7 @@ if (WITH_SQL)
   if(MINGW64)
     set(WINSOCK_LIB "-lws2_32")
   endif(MINGW64)
-  target_link_libraries(gncmod-backend-dbi gnc-backend-sql gncmod-engine ${GTK2_LDFLAGS} ${Boost_REGEX_LIBRARY} ${LIBDBI_LIBRARY} ${WINSOCK_LIB})
+  target_link_libraries(gncmod-backend-dbi gnc-backend-sql gnc-engine ${GTK2_LDFLAGS} ${Boost_REGEX_LIBRARY} ${LIBDBI_LIBRARY} ${WINSOCK_LIB})
 
   target_compile_definitions(gncmod-backend-dbi PRIVATE -DG_LOG_DOMAIN=\"gnc.backend.dbi\")
 
diff --git a/libgnucash/backend/dbi/test/CMakeLists.txt b/libgnucash/backend/dbi/test/CMakeLists.txt
index 1df34f05a..f6c0b96ac 100644
--- a/libgnucash/backend/dbi/test/CMakeLists.txt
+++ b/libgnucash/backend/dbi/test/CMakeLists.txt
@@ -10,7 +10,7 @@ set(BACKEND_DBI_TEST_INCLUDE_DIRS
   ${LIBDBI_INCLUDE_PATH}
   ${GLIB2_INCLUDE_DIRS}
 )
-set(BACKEND_DBI_TEST_LIBS gnc-backend-sql gncmod-engine gncmod-test-engine test-core ${Boost_REGEX_LIBRARY} ${LIBDBI_LIBRARY})
+set(BACKEND_DBI_TEST_LIBS gnc-backend-sql gnc-engine gncmod-test-engine test-core ${Boost_REGEX_LIBRARY} ${LIBDBI_LIBRARY})
 
 set(test_dbi_backend_SOURCES
   test-backend-dbi.cpp
diff --git a/libgnucash/backend/sql/CMakeLists.txt b/libgnucash/backend/sql/CMakeLists.txt
index ebd2a8324..af4f4ace2 100644
--- a/libgnucash/backend/sql/CMakeLists.txt
+++ b/libgnucash/backend/sql/CMakeLists.txt
@@ -69,7 +69,7 @@ if(WITH_SQL)
     ${backend_sql_noinst_HEADERS}
     )
 
-  target_link_libraries(gnc-backend-sql gncmod-engine)
+  target_link_libraries(gnc-backend-sql gnc-engine)
 
   target_compile_definitions (gnc-backend-sql PRIVATE -DG_LOG_DOMAIN=\"gnc.backend.sql\")
 
diff --git a/libgnucash/backend/sql/test/CMakeLists.txt b/libgnucash/backend/sql/test/CMakeLists.txt
index d0c06ccfc..465bbdc0b 100644
--- a/libgnucash/backend/sql/test/CMakeLists.txt
+++ b/libgnucash/backend/sql/test/CMakeLists.txt
@@ -9,7 +9,7 @@ set(BACKEND_SQL_TEST_INCLUDE_DIRS
 
 set(test_backend_sql_SOURCES test-sqlbe.cpp utest-gnc-backend-sql.cpp)
 
-set(BACKEND_SQL_TEST_LIBS gnc-backend-sql gncmod-engine test-core)
+set(BACKEND_SQL_TEST_LIBS gnc-backend-sql gnc-engine test-core)
 
 set_dist_list(test_backend_sql_DIST ${test_backend_sql_SOURCES} CMakeLists.txt
   test-column-types.cpp)
diff --git a/libgnucash/backend/xml/CMakeLists.txt b/libgnucash/backend/xml/CMakeLists.txt
index 3c5c96dd3..04e75e6ef 100644
--- a/libgnucash/backend/xml/CMakeLists.txt
+++ b/libgnucash/backend/xml/CMakeLists.txt
@@ -82,7 +82,7 @@ add_library	(gnc-backend-xml-utils
   ${backend_xml_utils_noinst_HEADERS}
 )
 
-target_link_libraries(gnc-backend-xml-utils gncmod-engine ${LIBXML2_LDFLAGS} ${ZLIB_LDFLAGS})
+target_link_libraries(gnc-backend-xml-utils gnc-engine ${LIBXML2_LDFLAGS} ${ZLIB_LDFLAGS})
 
 target_include_directories (gnc-backend-xml-utils
   PUBLIC  ${LIBXML2_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}
@@ -104,7 +104,7 @@ set(libgncmod_backend_xml_SOURCES gnc-backend-xml.cpp)
 set_source_files_properties (${libgncmod_backend_xml_SOURCES} PROPERTIES OBJECT_DEPENDS ${CONFIG_H})
 
 add_library(gncmod-backend-xml MODULE ${libgncmod_backend_xml_SOURCES})
-target_link_libraries(gncmod-backend-xml gnc-backend-xml-utils gncmod-engine
+target_link_libraries(gncmod-backend-xml gnc-backend-xml-utils gnc-engine
                         gnc-core-utils ${LIBXML2_LDFLAGS} ${GLIB2_LDFLAGS} ${ZLIB_LIBRARY})
 
 target_compile_definitions (gncmod-backend-xml PRIVATE -DG_LOG_DOMAIN=\"gnc.backend.xml\" -DU_SHOW_CPLUSPLUS_API=0)
@@ -128,6 +128,6 @@ install(TARGETS gncmod-backend-xml
 
 # Special normal (non-MODULE) library for cutecash only
 add_library(gncmod-backend-xml-utils ${libgncmod_backend_xml_SOURCES})
-target_link_libraries(gncmod-backend-xml-utils gnc-backend-xml-utils gncmod-engine
+target_link_libraries(gncmod-backend-xml-utils gnc-backend-xml-utils gnc-engine
                         gnc-core-utils ${LIBXML2_LDFLAGS} ${GLIB2_LDFLAGS} ${ZLIB_LIBRARY})
 target_compile_definitions (gncmod-backend-xml-utils PRIVATE -DG_LOG_DOMAIN=\"gnc.backend.xml\" -DU_SHOW_CPLUSPLUS_API=0)
diff --git a/libgnucash/backend/xml/gncmod-backend-xml.cpp b/libgnucash/backend/xml/gncmod-backend-xml.cpp
index ddf6d1e21..5743fa31d 100644
--- a/libgnucash/backend/xml/gncmod-backend-xml.cpp
+++ b/libgnucash/backend/xml/gncmod-backend-xml.cpp
@@ -62,9 +62,6 @@ extern "C"
     int
     libgncmod_backend_file_gnc_module_init (int refcount)
     {
-        engine = gnc_module_load ("gnucash/engine", 0);
-        if (!engine) return FALSE;
-
         return TRUE;
     }
 
diff --git a/libgnucash/backend/xml/test/CMakeLists.txt b/libgnucash/backend/xml/test/CMakeLists.txt
index 17cadb33f..264a19d79 100644
--- a/libgnucash/backend/xml/test/CMakeLists.txt
+++ b/libgnucash/backend/xml/test/CMakeLists.txt
@@ -14,7 +14,7 @@ set(XML_TEST_INCLUDE_DIRS
 )
 
 
-set(XML_TEST_LIBS gncmod-engine gncmod-test-engine test-core ${LIBXML2_LDFLAGS} -lz)
+set(XML_TEST_LIBS gnc-engine gncmod-test-engine test-core ${LIBXML2_LDFLAGS} -lz)
 
 function(add_xml_test _TARGET _SOURCE_FILES)
   gnc_add_test(${_TARGET} "${_SOURCE_FILES}" XML_TEST_INCLUDE_DIRS XML_TEST_LIBS ${ARGN})
diff --git a/libgnucash/backend/xml/test/test-load-example-account.cpp b/libgnucash/backend/xml/test/test-load-example-account.cpp
index 16d356ae4..352b79084 100644
--- a/libgnucash/backend/xml/test/test-load-example-account.cpp
+++ b/libgnucash/backend/xml/test/test-load-example-account.cpp
@@ -78,8 +78,7 @@ main (int argc, char** argv)
         location = "../../../../data/accounts/C";
     }
 
-    gnc_module_system_init ();
-    gnc_module_load ("gnucash/engine", 0);
+    gnc_engine_init (0, NULL);
 
     if ((ea_dir = g_dir_open (location, 0, NULL)) == NULL)
     {
diff --git a/libgnucash/engine/CMakeLists.txt b/libgnucash/engine/CMakeLists.txt
index 1208f0193..923d7db6c 100644
--- a/libgnucash/engine/CMakeLists.txt
+++ b/libgnucash/engine/CMakeLists.txt
@@ -155,7 +155,6 @@ set (engine_SOURCES
   gnc-session.c
   gnc-timezone.cpp
   gnc-uri-utils.c
-  gncmod-engine.c
   engine-helpers.c
   guid.cpp
   policy.c
@@ -200,22 +199,22 @@ set_source_files_properties (${engine_SOURCES} PROPERTIES OBJECT_DEPENDS ${CONFI
 # Add dependency on iso-4217-currencies.c
 set_source_files_properties (gnc-commodity.c PROPERTIES OBJECT_DEPENDS "${ISO_4217_C};${CONFIG_H}")
 
-add_library (gncmod-engine
+add_library (gnc-engine
   ${engine_SOURCES}
   ${engine_HEADERS}
   ${engine_noinst_HEADERS}
 )
 
-target_sources(gncmod-engine
+target_sources(gnc-engine
     PRIVATE
         $<$<BOOL:${WIN32}>:qof-win32.cpp>
         $<$<BOOL:${WIN32}>:${CMAKE_SOURCE_DIR}/borrowed/libc/strptime.c>
 )
 
 # Add dependency on iso-4217-currencies.c
-add_dependencies (gncmod-engine iso-4217-c)
+add_dependencies (gnc-engine iso-4217-c)
 
-target_link_libraries(gncmod-engine
+target_link_libraries(gnc-engine
     gnc-core-utils
     gnc-module
     ${Boost_DATE_TIME_LIBRARIES}
@@ -227,9 +226,9 @@ target_link_libraries(gncmod-engine
     ${GOBJECT_LDFLAGS}
     $<$<BOOL:${WIN32}>:bcrypt.lib>)
 
-target_compile_definitions (gncmod-engine PRIVATE -DG_LOG_DOMAIN=\"gnc.engine\")
+target_compile_definitions (gnc-engine PRIVATE -DG_LOG_DOMAIN=\"gnc.engine\")
 
-target_include_directories (gncmod-engine
+target_include_directories (gnc-engine
     PRIVATE
         ${CMAKE_CURRENT_BINARY_DIR} # for iso-4217-currencies.c
     PUBLIC
@@ -243,12 +242,12 @@ target_include_directories (gncmod-engine
 )
 
 if (APPLE)
-  set_target_properties (gncmod-engine PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/gnucash")
+  set_target_properties (gnc-engine PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}")
 endif()
 
-install(TARGETS gncmod-engine
-  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/gnucash
-  ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/gnucash
+install(TARGETS gnc-engine
+  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+  ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
   RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
 
 install(FILES ${engine_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gnucash)
diff --git a/libgnucash/engine/gncmod-engine.c b/libgnucash/engine/gncmod-engine.c
deleted file mode 100644
index d7edaacb3..000000000
--- a/libgnucash/engine/gncmod-engine.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/*********************************************************************
- * gnc-mod-engine.c
- * module definition/initialization for the Engine module
- *
- * Copyright (c) 2001 Linux Developers Group, Inc.
- *********************************************************************/
-/********************************************************************\
- * This program is free software; you can redistribute it and/or    *
- * modify it under the terms of the GNU General Public License as   *
- * published by the Free Software Foundation; either version 2 of   *
- * the License, or (at your option) any later version.              *
- *                                                                  *
- * This program is distributed in the hope that it will be useful,  *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
- * GNU General Public License for more details.                     *
- *                                                                  *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact:                        *
- *                                                                  *
- * Free Software Foundation           Voice:  +1-617-542-5942       *
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
- * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
- *                                                                  *
-\********************************************************************/
-
-
-#include <config.h>
-#include <gmodule.h>
-
-#include "gnc-engine.h"
-#include "gnc-module-api.h"
-
-GNC_MODULE_API_DECL(libgncmod_engine)
-
-/* version of the gnc module system interface we require */
-int libgncmod_engine_gnc_module_system_interface = 0;
-
-/* module versioning uses libtool semantics. */
-int libgncmod_engine_gnc_module_current  = 0;
-int libgncmod_engine_gnc_module_revision = 0;
-int libgncmod_engine_gnc_module_age      = 0;
-
-
-char *
-libgncmod_engine_gnc_module_path(void)
-{
-    return g_strdup("gnucash/engine");
-}
-
-char *
-libgncmod_engine_gnc_module_description(void)
-{
-    return g_strdup("The GnuCash accounting engine");
-}
-
-int
-libgncmod_engine_gnc_module_init(int refcount)
-{
-    if (refcount == 0)
-    {
-        /* initialize the engine on the first load */
-        gnc_engine_init(0, NULL);
-    }
-
-    return TRUE;
-}
-
-int
-libgncmod_engine_gnc_module_end(int refcount)
-{
-    return TRUE;
-}
diff --git a/libgnucash/engine/test/CMakeLists.txt b/libgnucash/engine/test/CMakeLists.txt
index 2aa68d317..0b5cc7c25 100644
--- a/libgnucash/engine/test/CMakeLists.txt
+++ b/libgnucash/engine/test/CMakeLists.txt
@@ -9,7 +9,7 @@ set(ENGINE_TEST_INCLUDE_DIRS
   ${GLIB2_INCLUDE_DIRS}
 )
 
-set(ENGINE_TEST_LIBS gncmod-engine gncmod-test-engine test-core ${LIBXML2_LDFLAGS} -lm)
+set(ENGINE_TEST_LIBS gnc-engine gncmod-test-engine test-core ${LIBXML2_LDFLAGS} -lm)
 
 macro(add_engine_test _TARGET _SOURCE_FILES)
   gnc_add_test(${_TARGET} "${_SOURCE_FILES}" ENGINE_TEST_INCLUDE_DIRS ENGINE_TEST_LIBS)
@@ -89,7 +89,7 @@ add_engine_test(test-numeric "${test_numeric_SOURCES}")
 
 set(MODULEPATH ${CMAKE_SOURCE_DIR}/libgnucash/engine)
 set(gtest_old_engine_LIBS
-  gncmod-engine
+  gnc-engine
   ${GLIB2_LDFLAGS}
   ${Boost_LIBRARIES}
   gtest)
diff --git a/libgnucash/gnc-module/example/gncmod-example.c b/libgnucash/gnc-module/example/gncmod-example.c
index 7d1e55599..38513d1c8 100644
--- a/libgnucash/gnc-module/example/gncmod-example.c
+++ b/libgnucash/gnc-module/example/gncmod-example.c
@@ -65,10 +65,6 @@ libgncmod_example_gnc_module_description (void)
 int
 libgncmod_example_gnc_module_init (int refcount)
 {
-    if (!gnc_module_load ("gnucash/engine", 0)) {
-        return FALSE;
-    }
-
     if (refcount == 0) {
         /* this is the first time the module is loaded */
 
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 015b1288c..cf4dae017 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -644,7 +644,6 @@ libgnucash/engine/gnc-int128.cpp
 libgnucash/engine/gncInvoice.c
 libgnucash/engine/gncJob.c
 libgnucash/engine/gnc-lot.c
-libgnucash/engine/gncmod-engine.c
 libgnucash/engine/gnc-numeric.cpp
 libgnucash/engine/gncOrder.c
 libgnucash/engine/gncOwner.c

commit 95b81844ada636b2f289551cb5a2ac06a1d7b10b
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sun Nov 24 15:32:23 2019 +0100

    Update documentation referring to the deprecated gnc:module wrapper

diff --git a/doc/examples/README_invoice b/doc/examples/README_invoice
index 1ecb99f06..8678dfbd8 100644
--- a/doc/examples/README_invoice
+++ b/doc/examples/README_invoice
@@ -1,6 +1,4 @@
-The Bill Invoice importer is an optional module and needs to enabled by editing the file $HOME/.gnucash/config.user, adding the line:
-
-(gnc:module-load "gnucash/plugins/bi_import" 0)
+Some notes on the bill and invoice importer:
 
 The example csv file must have the 22 elements for it to work.
 
diff --git a/libgnucash/gnc-module/doc/design.txt b/libgnucash/gnc-module/doc/design.txt
index 77dcef5c1..484e63851 100644
--- a/libgnucash/gnc-module/doc/design.txt
+++ b/libgnucash/gnc-module/doc/design.txt
@@ -68,27 +68,24 @@ gnc_module_description should return a newly-allocated 1-line
 description of what the module does.  This can be displayed by GUI
 elements to allow users to select modules to load.
 
+While the module system used to have wrappers for scheme access
+this functionality is now deprecated. Scheme code should no longer
+try to use any gnc-module functionality. All C code that is potentially
+useful for scheme has been or can be wrapped using swig. That wrapped
+code can be made available to scheme code using guile's load-extension
+functionality. For convenience, most of this wrapped code is
+accompanied by a scheme module that handles the load-extension part for you.
+So in most cases simply calling (use-module (gnucash <module-name>)) will
+do the trick.
 
 Initializing the module system
 ------------------------------
 
 Somewhere at program startup time, you need to call
-gnc_module_system_init from C (see below from Scheme).  This scans the
+gnc_module_system_init from C.  This scans the
 directories in the GNC_MODULE_PATH and builds a database of the
 available modules.
 
-In Scheme, you need to (use-modules (gnucash gnc-module)) and call
-(gnc:module-system-init) if it was not called from C.  You will need
-to use-modules this module is you intend to use any module system 
-functions from Scheme.  
-
-On the Scheme side, gnc:module-system-init is not a g-wrapped
-function.  It uses Guile's dynamic-link to open the libgncmodule.la
-library directly and call gnc_module_system_init.  dynamic-link uses
-lt_dlopen() under the hood, so you need to make sure that the
-libgncmodule.la install directory is in your LD_LIBRARY_PATH or
-LTDL_LIBRARY_PATH.  The Gnucash app will set up this path by default.
-
 You can rebuild the module database at any time (say, if you know a
 new module has been installed or the user has changed the module path
 via some in-program mechanism) by calling gnc_module_system_refresh.
@@ -96,10 +93,9 @@ via some in-program mechanism) by calling gnc_module_system_refresh.
 Loading modules
 ---------------
 
-From C call gnc_module_load(path, interface), or gnc:module-load from
-Scheme.  This returns a GNCModule (<gnc:module>) if a qualifying
-module was successfully loaded, #f / FALSE otherside.  GNCModule is an
-opaque type.
+From C call gnc_module_load(path, interface).  This returns a GNCModule
+if a qualifying module was successfully loaded, FALSE otherwise.
+GNCModule is an opaque type.
 
 A qualifying module is any module whose gnc_module_path matches the
 path specification and for whom "interface" falls between

commit b96dc6ff8933f60e62928e97b5e5737511ea4885
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat Nov 23 21:21:10 2019 +0100

    html - expose wrapped api directly from a newly created html.scm
    
    With that in place we no longer need to (gnc:module-load "gnucash/html" 0)
    the html gncmodule. An ordinary (use-modules (gnucash html)) suffices
    
    html.scm is newly created. It serves two purposes:
    1. expose the swigified html api to scheme
    2. ensure gnc_html_initialize is run before first use (in scheme) of the api

diff --git a/gnucash/html/CMakeLists.txt b/gnucash/html/CMakeLists.txt
index 466949572..13e4a7c5d 100644
--- a/gnucash/html/CMakeLists.txt
+++ b/gnucash/html/CMakeLists.txt
@@ -32,7 +32,21 @@ else ()
   set(html_EXTRA_DIST gnc-html-webkit1.h gnc-html-webkit1.c)
 endif ()
 
-set_dist_list(html_DIST CMakeLists.txt ${html_HEADERS} ${html_SOURCES} gnc-html.i ${html_EXTRA_DIST})
+
+
+set (gnc_html_SCHEME html.scm)
+
+set(GUILE_OUTPUT_DIR   gnucash)
+set(GUILE_DEPENDS      gncmod-html gnucash-guile)
+
+gnc_add_scheme_targets(scm-gnc-html
+    "${gnc_html_SCHEME}"
+    ${GUILE_OUTPUT_DIR}
+    "${GUILE_DEPENDS}"
+    FALSE
+)
+
+set_dist_list(html_DIST CMakeLists.txt ${html_HEADERS} ${html_SOURCES} gnc-html.i ${html_EXTRA_DIST} html.scm)
 
 add_library (gncmod-html
   ${html_SOURCES}
diff --git a/gnucash/html/gnc-html.i b/gnucash/html/gnc-html.i
index f30e1fad3..573cf81cf 100644
--- a/gnucash/html/gnc-html.i
+++ b/gnucash/html/gnc-html.i
@@ -48,6 +48,7 @@ SCM scm_init_sw_gnc_html_module(void);
 
 %include "gnc-html-extras.h"
 
+void gnc_html_initialize(void);
 
 %init {
   {
diff --git a/gnucash/html/html.scm b/gnucash/html/html.scm
new file mode 100644
index 000000000..6e39da28d
--- /dev/null
+++ b/gnucash/html/html.scm
@@ -0,0 +1,39 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;  gnc-html.scm
+;;;  Guile module for gnc-html
+;;;
+;;;  Copyright 2019 Geert Janssens <geert at kobaltwit.be>
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation; either version 2 of
+;; the License, or (at your option) any later version.
+;;
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with this program; if not, contact:
+;;
+;; Free Software Foundation           Voice:  +1-617-542-5942
+;; 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652
+;; Boston, MA  02110-1301,  USA       gnu at gnu.org
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+(define-module (gnucash html))
+
+;; Guile 2 needs to find the symbols from the extension at compile time already
+(eval-when
+      (compile load eval expand)
+      (load-extension "libgncmod-html" "scm_init_sw_gnc_html_module"))
+(use-modules (sw_gnc_html))
+
+; Export the swig-wrapped symbols in the public interface of this module
+(let ((i (module-public-interface (current-module))))
+     (module-use! i (resolve-interface '(sw_gnc_html))))
+
+(gnc-html-initialize)
diff --git a/gnucash/report/CMakeLists.txt b/gnucash/report/CMakeLists.txt
index 00ea814a9..8eda96b25 100644
--- a/gnucash/report/CMakeLists.txt
+++ b/gnucash/report/CMakeLists.txt
@@ -89,7 +89,7 @@ set (report_eguile_SCHEME
 )
 
 set(GUILE_DEPENDS
-  gncmod-html
+  scm-gnc-html
   scm-gnome-utils
   gncmod-report
   scm-app-utils
diff --git a/gnucash/report/html-document.scm b/gnucash/report/html-document.scm
index 782c41f93..b1322387e 100644
--- a/gnucash/report/html-document.scm
+++ b/gnucash/report/html-document.scm
@@ -21,7 +21,7 @@
 ;; Boston, MA  02110-1301,  USA       gnu at gnu.org
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-(gnc:module-load "gnucash/html" 0)
+(use-modules (gnucash html))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;  <html-document> class
diff --git a/gnucash/report/report.scm b/gnucash/report/report.scm
index 2107fd03d..77c5fe3d8 100644
--- a/gnucash/report/report.scm
+++ b/gnucash/report/report.scm
@@ -33,9 +33,7 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash app-utils))
 (use-modules (gnucash gnome-utils))
-
-(use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/html" 0)
+(use-modules (gnucash html))
 
 ;; commodity-utilities.scm
 (export gnc:get-match-commodity-splits)
diff --git a/gnucash/report/reports/CMakeLists.txt b/gnucash/report/reports/CMakeLists.txt
index aba85f16d..1484e94ac 100644
--- a/gnucash/report/reports/CMakeLists.txt
+++ b/gnucash/report/reports/CMakeLists.txt
@@ -72,19 +72,17 @@ set (reports_SCHEME
 )
 
 set(scm_rpts_GUILE_DEPENDS
-  gncmod-html
+  scm-gnc-html
   scm-core-utils
   scm-engine
-  scm-core-utils
   scm-gnome-utils
   scm-report
   )
 
 set(scm_rpt_example_GUILE_DEPENDS
-  gncmod-html
+  scm-gnc-html
   scm-app-utils
   scm-core-utils
-  scm-core-utils
   scm-gnc-module
   scm-engine
   scm-reports-example-links
@@ -93,8 +91,7 @@ set(scm_rpt_example_GUILE_DEPENDS
   )
 
 set(scm_rpt_locale_specific_GUILE_DEPENDS
-  gncmod-html
-  scm-core-utils
+  scm-gnc-html
   scm-core-utils
   scm-gnc-module
   scm-engine
diff --git a/gnucash/report/reports/example/hello-world.scm b/gnucash/report/reports/example/hello-world.scm
index 74ea30630..cde5540c5 100644
--- a/gnucash/report/reports/example/hello-world.scm
+++ b/gnucash/report/reports/example/hello-world.scm
@@ -30,12 +30,10 @@
 (use-modules (gnucash core-utils))
 (use-modules (gnucash app-utils))
 (use-modules (gnucash report))
+(use-modules (gnucash html))
 
 (debug-enable 'backtrace)
 
-(use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/html" 0) ;for gnc-build-url
-
 ;; This function will generate a set of options that GnuCash
 ;; will use to display a dialog where the user can select
 ;; values for your report's parameters.
diff --git a/gnucash/report/reports/locale-specific/us/taxtxf.scm b/gnucash/report/reports/locale-specific/us/taxtxf.scm
index b443c5c1d..40e6cfbe1 100644
--- a/gnucash/report/reports/locale-specific/us/taxtxf.scm
+++ b/gnucash/report/reports/locale-specific/us/taxtxf.scm
@@ -107,9 +107,7 @@
 (use-modules (gnucash gnome-utils))
 (use-modules (gnucash report))
 (use-modules (srfi srfi-1))
-
-(use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/html" 0)
+(use-modules (gnucash html))
 
 (define reportname (N_ "Tax Schedule Report/TXF Export"))
 
diff --git a/gnucash/report/reports/standard/balsheet-eg.scm b/gnucash/report/reports/standard/balsheet-eg.scm
index ce6929446..ebf34b154 100644
--- a/gnucash/report/reports/standard/balsheet-eg.scm
+++ b/gnucash/report/reports/standard/balsheet-eg.scm
@@ -38,13 +38,11 @@
 (use-modules (gnucash app-utils))
 (use-modules (gnucash eguile))
 (use-modules (gnucash report))
+(use-modules (gnucash html))
 
 (use-modules (ice-9 local-eval))  ; for the-environment
 (use-modules (srfi srfi-13)) ; for extra string functions
 
-(use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/html" 0)
-
 (define debugging? #f)
 
 (define (debug . args)
diff --git a/gnucash/report/reports/standard/receipt.scm b/gnucash/report/reports/standard/receipt.scm
index cbfa5a395..eb7f12d5e 100644
--- a/gnucash/report/reports/standard/receipt.scm
+++ b/gnucash/report/reports/standard/receipt.scm
@@ -22,9 +22,7 @@
 (use-modules (gnucash core-utils))
 (use-modules (gnucash app-utils))
 (use-modules (gnucash report))
-
-(use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/html" 0)
+(use-modules (gnucash html))
 
 (use-modules (gnucash eguile))
 
diff --git a/gnucash/report/reports/standard/taxinvoice.scm b/gnucash/report/reports/standard/taxinvoice.scm
index 65e9acdbe..1e7e39858 100644
--- a/gnucash/report/reports/standard/taxinvoice.scm
+++ b/gnucash/report/reports/standard/taxinvoice.scm
@@ -30,9 +30,7 @@
 (use-modules (gnucash core-utils))
 (use-modules (gnucash app-utils))
 (use-modules (gnucash report))
-
-(use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/html" 0)
+(use-modules (gnucash html))
 
 (use-modules (gnucash eguile))
 
diff --git a/gnucash/report/reports/standard/view-column.scm b/gnucash/report/reports/standard/view-column.scm
index 24b960092..d73e13178 100644
--- a/gnucash/report/reports/standard/view-column.scm
+++ b/gnucash/report/reports/standard/view-column.scm
@@ -32,9 +32,7 @@
 (use-modules (gnucash core-utils))
 (use-modules (gnucash app-utils))
 (use-modules (gnucash report))
-
-(use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/html" 0) ;for gnc-build-url
+(use-modules (gnucash html))
 
 (define (make-options)
   (let* ((options (gnc:new-options))
diff --git a/gnucash/report/stylesheets/footer.scm b/gnucash/report/stylesheets/footer.scm
index 7b2acfae8..5e1d0b6c8 100644
--- a/gnucash/report/stylesheets/footer.scm
+++ b/gnucash/report/stylesheets/footer.scm
@@ -39,10 +39,9 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash core-utils))
+(use-modules (gnucash app-utils))
 (use-modules (gnucash report))
-
-(use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/html" 0)
+(use-modules (gnucash html))
 
 (define (easy-fancy-footer-options)
   (let* ((options (gnc:new-options))
diff --git a/gnucash/report/stylesheets/head-or-tail.scm b/gnucash/report/stylesheets/head-or-tail.scm
index 0443181a4..655402655 100644
--- a/gnucash/report/stylesheets/head-or-tail.scm
+++ b/gnucash/report/stylesheets/head-or-tail.scm
@@ -38,10 +38,9 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash core-utils)) ; for gnc:version and (_ ...)
+(use-modules (gnucash app-utils))
 (use-modules (gnucash report))
-
-(use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/html" 0)
+(use-modules (gnucash html))
 
 (define (head-or-tail-options)
   (let* ((options (gnc:new-options))
diff --git a/gnucash/report/stylesheets/plain.scm b/gnucash/report/stylesheets/plain.scm
index 8b1cb999d..c5b502109 100644
--- a/gnucash/report/stylesheets/plain.scm
+++ b/gnucash/report/stylesheets/plain.scm
@@ -27,12 +27,11 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash core-utils))
+(use-modules (gnucash app-utils))
 (use-modules (gnucash report))
 (use-modules (srfi srfi-13))
 (use-modules (srfi srfi-14))
-
-(use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/html" 0)
+(use-modules (gnucash html))
 
 ;; plain style sheet
 ;; this should generally be the default style sheet for most reports.
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 2ff5214c3..015b1288c 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -300,6 +300,7 @@ gnucash/html/gnc-html-history.c
 gnucash/html/gnc-html-webkit1.c
 gnucash/html/gnc-html-webkit2.c
 gnucash/html/gncmod-html.c
+gnucash/html/html.scm
 gnucash/import-export/aqb/assistant-ab-initial.c
 gnucash/import-export/aqb/assistant-ab-initial.glade
 gnucash/import-export/aqb/dialog-ab-daterange.c

commit bd311d5dfbc4e6d85e6e94e96a422cdd71e319a3
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat Nov 23 19:03:59 2019 +0100

    report - expose wrapped api directly from report-core.scm
    
    With that in place we no longer need to (gnc:module-load "gnucash/report" 0)
    the report gncmodule. An ordinary (use-modules (gnucash report)) suffices
    
    Note: as gncmod-report did additional initialization, most reports
    needed additional tweaks like using app-utils.
    And in app-utils the initialization of the relative date terms
    has been tweaked as well to run whenever the app-utils module
    gets loaded first time, rather than having this initialized by
    gncmod-report.

diff --git a/gnucash/gnome/report-menus.scm b/gnucash/gnome/report-menus.scm
index c2670d7f3..7ebbe000e 100644
--- a/gnucash/gnome/report-menus.scm
+++ b/gnucash/gnome/report-menus.scm
@@ -29,15 +29,13 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnome-utils))
+(use-modules (gnucash report))
 (use-modules (gnucash reports standard dashboard))
 
 (eval-when (compile load eval expand)
   (load-extension "libgnc-gnome" "scm_init_sw_gnome_module"))
 (use-modules (sw_gnome))
 
-(use-modules (gnucash gnc-module))
-(gnc:module-begin-syntax (gnc:module-load "gnucash/report" 0))
-
 (export gnc:report-menu-setup)
 (export gnc:add-report-template-menu-items)
 
diff --git a/gnucash/report/eguile-html-utilities.scm b/gnucash/report/eguile-html-utilities.scm
index 2b9a29f73..cc2ede35b 100644
--- a/gnucash/report/eguile-html-utilities.scm
+++ b/gnucash/report/eguile-html-utilities.scm
@@ -26,9 +26,8 @@
 ; not sure which are really required
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash app-utils))
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash report))
 
 (use-modules (ice-9 regex))  ; for regular expressions
 (use-modules (srfi srfi-13)) ; for extra string functions
diff --git a/gnucash/report/eguile-utilities.scm b/gnucash/report/eguile-utilities.scm
index 3ac817ad4..79a40f51d 100644
--- a/gnucash/report/eguile-utilities.scm
+++ b/gnucash/report/eguile-utilities.scm
@@ -26,10 +26,9 @@
 ; not sure which are really required
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash app-utils))
 (use-modules (gnucash core-utils))
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash report))
 
 (define-public (fmtnumber n)
   ;; Format a number (integer or real) into something printable
diff --git a/gnucash/report/gncmod-report.c b/gnucash/report/gncmod-report.c
index 907703253..b4830cdbf 100644
--- a/gnucash/report/gncmod-report.c
+++ b/gnucash/report/gncmod-report.c
@@ -78,7 +78,6 @@ libgncmod_report_gnc_module_init(int refcount)
      * the relative date system */
     if (refcount == 0)
     {
-        scm_c_eval_string("(gnc:reldate-initialize)");
         scm_c_eval_string("(report-module-loader (list '(gnucash report stylesheets)))");
     }
 
diff --git a/gnucash/report/report-core.scm b/gnucash/report/report-core.scm
index 0ac575012..858b8c5a9 100644
--- a/gnucash/report/report-core.scm
+++ b/gnucash/report/report-core.scm
@@ -28,6 +28,10 @@
   (load-extension "libgncmod-report" "scm_init_sw_report_module"))
 (use-modules (sw_report))
 
+; Export the swig-wrapped symbols in the public interface of this module
+(let ((i (module-public-interface (current-module))))
+     (module-use! i (resolve-interface '(sw_report))))
+
 ;; Terminology in this file:
 ;; report-template: a report definition of some form. This can be a report
 ;;      included in gnucash by default, or a new report definition added by
diff --git a/gnucash/report/reports/aging.scm b/gnucash/report/reports/aging.scm
index 7c05468df..6619104fa 100644
--- a/gnucash/report/reports/aging.scm
+++ b/gnucash/report/reports/aging.scm
@@ -28,11 +28,10 @@
 
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils))
+(use-modules (gnucash app-utils))
 (use-modules (gnucash gnome-utils))
-
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash report))
 
 (define optname-to-date (N_ "To"))
 (define optname-sort-by (N_ "Sort By"))
diff --git a/gnucash/report/reports/example/average-balance.scm b/gnucash/report/reports/example/average-balance.scm
index c7b6f9a01..a34776760 100644
--- a/gnucash/report/reports/example/average-balance.scm
+++ b/gnucash/report/reports/example/average-balance.scm
@@ -27,12 +27,13 @@
 
 
 (define-module (gnucash reports example average-balance))
-(use-modules (srfi srfi-1))
+
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils))
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
+(use-modules (srfi srfi-1))
 
 (define reportname (N_ "Average Balance"))
 
diff --git a/gnucash/report/reports/example/daily-reports.scm b/gnucash/report/reports/example/daily-reports.scm
index affbc4261..f82e99ad9 100644
--- a/gnucash/report/reports/example/daily-reports.scm
+++ b/gnucash/report/reports/example/daily-reports.scm
@@ -29,11 +29,10 @@
 
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
-(use-modules (srfi srfi-1))
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils))
-
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
+(use-modules (srfi srfi-1))
 
 (define menuname-income (N_ "Income vs. Day of Week"))
 (define menuname-expense (N_ "Expenses vs. Day of Week"))
diff --git a/gnucash/report/reports/example/hello-world.scm b/gnucash/report/reports/example/hello-world.scm
index 54be41636..74ea30630 100644
--- a/gnucash/report/reports/example/hello-world.scm
+++ b/gnucash/report/reports/example/hello-world.scm
@@ -24,14 +24,16 @@
 ;; new reports for GnuCash.
 
 (define-module (gnucash reports example hello-world))
+
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils))
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 
 (debug-enable 'backtrace)
 
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash gnc-module))
 (gnc:module-load "gnucash/html" 0) ;for gnc-build-url
 
 ;; This function will generate a set of options that GnuCash
diff --git a/gnucash/report/reports/example/sample-graphs.scm b/gnucash/report/reports/example/sample-graphs.scm
index c3e754cff..ed1fe9c2e 100644
--- a/gnucash/report/reports/example/sample-graphs.scm
+++ b/gnucash/report/reports/example/sample-graphs.scm
@@ -24,18 +24,18 @@
 ;; new reports for GnuCash.
 
 (define-module (gnucash reports example sample-graphs))
+
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
+(use-modules (gnucash app-utils))
 (use-modules (gnucash gnome-utils)) ;for gnc-build-url
+(use-modules (gnucash report))
 
 ;; Add this module to enable translatable strings
 ;; Use (N_ string) to mark string for translation (it won't be translated on the spot)
 ;; Use (_ string) to use a translation of this string if it exists.
 (use-modules (gnucash core-utils))
 
-(use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/report" 0)
-
 ;; It's common to define frequently used strings once
 ;; This also helps getting more consistent messages which simplifies
 ;; the life of translators later on.
diff --git a/gnucash/report/reports/example/welcome-to-gnucash.scm b/gnucash/report/reports/example/welcome-to-gnucash.scm
index 7181ff865..4c8c0abe5 100644
--- a/gnucash/report/reports/example/welcome-to-gnucash.scm
+++ b/gnucash/report/reports/example/welcome-to-gnucash.scm
@@ -26,13 +26,8 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash core-utils)) ; for gnc:version and (_ ...)
-(use-modules (gnucash gnc-module))
-(eval-when
-      (compile load eval expand)
-      (load-extension "libgncmod-report" "scm_init_sw_report_module"))
-(use-modules (sw_report))
-
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 
 (define (options)
   (gnc:new-options))
diff --git a/gnucash/report/reports/locale-specific/de_DE/taxtxf.scm b/gnucash/report/reports/locale-specific/de_DE/taxtxf.scm
index 88ac95a33..444456772 100644
--- a/gnucash/report/reports/locale-specific/de_DE/taxtxf.scm
+++ b/gnucash/report/reports/locale-specific/de_DE/taxtxf.scm
@@ -69,12 +69,11 @@
 (define-module (gnucash reports locale-specific de_DE taxtxf))
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
-(use-modules (srfi srfi-1))
 (use-modules (gnucash core-utils)) ; for gnc:version and (_ ...)
+(use-modules (gnucash app-utils))
 (use-modules (gnucash locale de_DE tax))
-
-(use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash report))
+(use-modules (srfi srfi-1))
 
 (define reportname (N_ "Tax Report / TXF Export"))
 
diff --git a/gnucash/report/reports/locale-specific/us/taxtxf.scm b/gnucash/report/reports/locale-specific/us/taxtxf.scm
index 0b2459f31..b443c5c1d 100644
--- a/gnucash/report/reports/locale-specific/us/taxtxf.scm
+++ b/gnucash/report/reports/locale-specific/us/taxtxf.scm
@@ -101,15 +101,15 @@
 (define-module (gnucash reports locale-specific us taxtxf))
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
-(use-modules (srfi srfi-1))
 (use-modules (gnucash core-utils)) ; for gnc:version and (_ ...)
+(use-modules (gnucash app-utils))
 (use-modules (gnucash locale us tax))
 (use-modules (gnucash gnome-utils))
-
+(use-modules (gnucash report))
+(use-modules (srfi srfi-1))
 
 (use-modules (gnucash gnc-module))
 (gnc:module-load "gnucash/html" 0)
-(gnc:module-load "gnucash/report" 0)
 
 (define reportname (N_ "Tax Schedule Report/TXF Export"))
 
diff --git a/gnucash/report/reports/standard/account-piecharts.scm b/gnucash/report/reports/standard/account-piecharts.scm
index 4677911dd..c65fac183 100644
--- a/gnucash/report/reports/standard/account-piecharts.scm
+++ b/gnucash/report/reports/standard/account-piecharts.scm
@@ -27,11 +27,10 @@
 
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
-(use-modules (srfi srfi-1))
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils))
-
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
+(use-modules (srfi srfi-1))
 
 (define menuname-income (N_ "Income Piechart"))
 (define menuname-expense (N_ "Expense Piechart"))
diff --git a/gnucash/report/reports/standard/account-summary.scm b/gnucash/report/reports/standard/account-summary.scm
index 22bb746ce..3c07e75f6 100644
--- a/gnucash/report/reports/standard/account-summary.scm
+++ b/gnucash/report/reports/standard/account-summary.scm
@@ -58,10 +58,9 @@
 (use-modules (srfi srfi-1))
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils))
-
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 
 ;; account summary report prints a table of account information,
 ;; optionally with clickable links to open the corresponding register
diff --git a/gnucash/report/reports/standard/advanced-portfolio.scm b/gnucash/report/reports/standard/advanced-portfolio.scm
index 3e10fb070..5568b2bb4 100644
--- a/gnucash/report/reports/standard/advanced-portfolio.scm
+++ b/gnucash/report/reports/standard/advanced-portfolio.scm
@@ -29,11 +29,10 @@
 
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
-(use-modules (srfi srfi-1))
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils))
-
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
+(use-modules (srfi srfi-1))
 
 (define reportname (N_ "Advanced Portfolio"))
 
diff --git a/gnucash/report/reports/standard/balance-forecast.scm b/gnucash/report/reports/standard/balance-forecast.scm
index 6f9a61e26..09bd47cd1 100644
--- a/gnucash/report/reports/standard/balance-forecast.scm
+++ b/gnucash/report/reports/standard/balance-forecast.scm
@@ -26,12 +26,11 @@
 (define-module (gnucash reports standard balance-forecast))
 
 (use-modules (gnucash engine))
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils))
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 (use-modules (srfi srfi-1))
 
-(gnc:module-load "gnucash/report" 0)
-
 ; Name definitions
 (define reportname           (N_ "Balance Forecast"))
 
diff --git a/gnucash/report/reports/standard/balance-sheet.scm b/gnucash/report/reports/standard/balance-sheet.scm
index bd75d6c46..beb78e97b 100644
--- a/gnucash/report/reports/standard/balance-sheet.scm
+++ b/gnucash/report/reports/standard/balance-sheet.scm
@@ -65,10 +65,9 @@
 (define-module (gnucash reports standard balance-sheet))
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils))
-
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 
 (define reportname (N_ "Balance Sheet"))
 
diff --git a/gnucash/report/reports/standard/balsheet-eg.scm b/gnucash/report/reports/standard/balsheet-eg.scm
index 8ac94edcb..ce6929446 100644
--- a/gnucash/report/reports/standard/balsheet-eg.scm
+++ b/gnucash/report/reports/standard/balsheet-eg.scm
@@ -34,14 +34,15 @@
 (define-module (gnucash reports standard balsheet-eg))
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils))
+(use-modules (gnucash app-utils))
 (use-modules (gnucash eguile))
+(use-modules (gnucash report))
 
 (use-modules (ice-9 local-eval))  ; for the-environment
 (use-modules (srfi srfi-13)) ; for extra string functions
 
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash gnc-module))
 (gnc:module-load "gnucash/html" 0)
 
 (define debugging? #f)
diff --git a/gnucash/report/reports/standard/balsheet-pnl.scm b/gnucash/report/reports/standard/balsheet-pnl.scm
index 106057997..7e95d1357 100644
--- a/gnucash/report/reports/standard/balsheet-pnl.scm
+++ b/gnucash/report/reports/standard/balsheet-pnl.scm
@@ -28,14 +28,13 @@
 (define-module (gnucash reports standard balsheet-pnl))
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils))
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 (use-modules (srfi srfi-1))
 (use-modules (srfi srfi-2))
 (use-modules (srfi srfi-9))
 
-(gnc:module-load "gnucash/report" 0)
-
 ;; the column-data record. the gnc:account-accumulate-at-dates will
 ;; create a record for each report-date with split-data as follows:
 (define-record-type :col-datum
diff --git a/gnucash/report/reports/standard/budget-balance-sheet.scm b/gnucash/report/reports/standard/budget-balance-sheet.scm
index a15ac0930..72da8e297 100644
--- a/gnucash/report/reports/standard/budget-balance-sheet.scm
+++ b/gnucash/report/reports/standard/budget-balance-sheet.scm
@@ -30,11 +30,10 @@
 
 (define-module (gnucash reports standard budget-balance-sheet))
 (use-modules (gnucash engine))
-(use-modules (gnucash utilities)) 
-(use-modules (gnucash gnc-module))
+(use-modules (gnucash utilities))
 (use-modules (gnucash core-utils))
-
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 
 (define reportname (N_ "Budget Balance Sheet"))
 
diff --git a/gnucash/report/reports/standard/budget-barchart.scm b/gnucash/report/reports/standard/budget-barchart.scm
index 3737e486b..9f5f1ac05 100644
--- a/gnucash/report/reports/standard/budget-barchart.scm
+++ b/gnucash/report/reports/standard/budget-barchart.scm
@@ -28,11 +28,10 @@
 
 (use-modules (srfi srfi-1))
 (use-modules (gnucash engine))
-(use-modules (gnucash utilities)) 
-(use-modules (gnucash gnc-module))
+(use-modules (gnucash utilities))
 (use-modules (gnucash core-utils))
-
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 
 (define reportname
   (N_ "Budget Chart"))
diff --git a/gnucash/report/reports/standard/budget-flow.scm b/gnucash/report/reports/standard/budget-flow.scm
index fd4712569..0a31c5edf 100644
--- a/gnucash/report/reports/standard/budget-flow.scm
+++ b/gnucash/report/reports/standard/budget-flow.scm
@@ -29,10 +29,9 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash core-utils))
+(use-modules (gnucash app-utils))
 (use-modules (gnucash gnome-utils)) ;for gnc-build-url
-
-(use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash report))
 
 (define reportname
   (N_ "Budget Flow"))
diff --git a/gnucash/report/reports/standard/budget-income-statement.scm b/gnucash/report/reports/standard/budget-income-statement.scm
index 9292b2819..2b0067ace 100644
--- a/gnucash/report/reports/standard/budget-income-statement.scm
+++ b/gnucash/report/reports/standard/budget-income-statement.scm
@@ -42,11 +42,10 @@
 
 (define-module (gnucash reports standard budget-income-statement))
 (use-modules (gnucash engine))
-(use-modules (gnucash utilities)) 
-(use-modules (gnucash gnc-module))
+(use-modules (gnucash utilities))
 (use-modules (gnucash core-utils))
-
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 
 ;; define all option's names and help text so that they are properly
 ;; defined in *one* place.
diff --git a/gnucash/report/reports/standard/budget.scm b/gnucash/report/reports/standard/budget.scm
index 80d9ec56a..b866e0f9c 100644
--- a/gnucash/report/reports/standard/budget.scm
+++ b/gnucash/report/reports/standard/budget.scm
@@ -30,14 +30,13 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash core-utils))
+(use-modules (gnucash app-utils))
 (use-modules (gnucash gnome-utils)) ;for gnc-build-url
+(use-modules (gnucash report))
 
 (use-modules (srfi srfi-1))
 (use-modules (ice-9 match))
 
-(use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/report" 0)
-
 (define reportname (N_ "Budget Report"))
 
 ;; define all option's names so that they are properly defined
diff --git a/gnucash/report/reports/standard/cash-flow.scm b/gnucash/report/reports/standard/cash-flow.scm
index 59d947cce..9f23e9231 100644
--- a/gnucash/report/reports/standard/cash-flow.scm
+++ b/gnucash/report/reports/standard/cash-flow.scm
@@ -31,10 +31,9 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash core-utils))
+(use-modules (gnucash app-utils))
 (use-modules (gnucash gnome-utils)) ;for gnc-build-url
-
-(use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash report))
 
 (export cash-flow-calc-money-in-out)
 
diff --git a/gnucash/report/reports/standard/cashflow-barchart.scm b/gnucash/report/reports/standard/cashflow-barchart.scm
index af048c31f..4034af9c8 100644
--- a/gnucash/report/reports/standard/cashflow-barchart.scm
+++ b/gnucash/report/reports/standard/cashflow-barchart.scm
@@ -30,12 +30,11 @@
 (define-module (gnucash reports standard cashflow-barchart))
 
 (use-modules (gnucash engine))
-(use-modules (gnucash utilities)) 
-(use-modules (gnucash gnc-module))
+(use-modules (gnucash utilities))
 (use-modules (gnucash core-utils))
+(use-modules (gnucash app-utils))
 (use-modules (gnucash reports standard cash-flow))
-
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash report))
 
 (define reportname (N_ "Cash Flow Barchart"))
 
diff --git a/gnucash/report/reports/standard/category-barchart.scm b/gnucash/report/reports/standard/category-barchart.scm
index e2923ca1b..b6279c4c9 100644
--- a/gnucash/report/reports/standard/category-barchart.scm
+++ b/gnucash/report/reports/standard/category-barchart.scm
@@ -28,10 +28,9 @@
 (use-modules (srfi srfi-9))
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils))
-
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 
 ;; The option names are defined here to 1. save typing and 2. avoid
 ;; spelling errors. The *reportnames* are defined here (and not only
diff --git a/gnucash/report/reports/standard/customer-summary.scm b/gnucash/report/reports/standard/customer-summary.scm
index 4377c7e8e..7c6ef8758 100644
--- a/gnucash/report/reports/standard/customer-summary.scm
+++ b/gnucash/report/reports/standard/customer-summary.scm
@@ -29,14 +29,13 @@
 (define-module (gnucash reports standard customer-summary))
 
 (use-modules (srfi srfi-1))
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))                ; for gnc:debug
 (use-modules (gnucash core-utils))
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 (use-modules (gnucash reports))
 
-(gnc:module-load "gnucash/report" 0)
-
 ;; Option names
 (define optname-from-date (N_ "From"))
 (define optname-to-date (N_ "To"))
diff --git a/gnucash/report/reports/standard/dashboard.scm b/gnucash/report/reports/standard/dashboard.scm
index f58b489fa..8c1b84ff6 100644
--- a/gnucash/report/reports/standard/dashboard.scm
+++ b/gnucash/report/reports/standard/dashboard.scm
@@ -28,13 +28,8 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash core-utils)) ; for gnc:version and (_ ...)
-(use-modules (gnucash gnc-module))
-(eval-when
-      (compile load eval expand)
-      (load-extension "libgncmod-report" "scm_init_sw_report_module"))
-(use-modules (sw_report))
-
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 
 (define multicolumn-guid "d8ba4a2e89e8479ca9f6eccdeb164588")
 (define acct-summary-guid "3298541c236b494998b236dfad6ad752")
diff --git a/gnucash/report/reports/standard/equity-statement.scm b/gnucash/report/reports/standard/equity-statement.scm
index ef232454f..bed545681 100644
--- a/gnucash/report/reports/standard/equity-statement.scm
+++ b/gnucash/report/reports/standard/equity-statement.scm
@@ -47,11 +47,10 @@
 
 (define-module (gnucash reports standard equity-statement))
 (use-modules (gnucash engine))
-(use-modules (gnucash utilities)) 
-(use-modules (gnucash gnc-module))
+(use-modules (gnucash utilities))
 (use-modules (gnucash core-utils))
-
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 
 (define reportname (N_ "Equity Statement"))
 
diff --git a/gnucash/report/reports/standard/general-journal.scm b/gnucash/report/reports/standard/general-journal.scm
index afc86a366..9068adb1c 100644
--- a/gnucash/report/reports/standard/general-journal.scm
+++ b/gnucash/report/reports/standard/general-journal.scm
@@ -28,11 +28,10 @@
 
 (define-module (gnucash reports standard general-journal))
 (use-modules (gnucash engine))
-(use-modules (gnucash utilities)) 
-(use-modules (gnucash gnc-module))
+(use-modules (gnucash utilities))
 (use-modules (gnucash core-utils))
-
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 
 (define reportname (N_ "General Journal"))
 (define regrptname (N_ "Register"))
diff --git a/gnucash/report/reports/standard/general-ledger.scm b/gnucash/report/reports/standard/general-ledger.scm
index 5d1226062..ee8a357c4 100644
--- a/gnucash/report/reports/standard/general-ledger.scm
+++ b/gnucash/report/reports/standard/general-ledger.scm
@@ -31,11 +31,10 @@
 
 (define-module (gnucash reports standard general-ledger))
 (use-modules (gnucash engine))
-(use-modules (gnucash utilities)) 
-(use-modules (gnucash gnc-module))
+(use-modules (gnucash utilities))
 (use-modules (gnucash core-utils))
-
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 
 (define reportname (N_ "General Ledger"))
 (define xactrptguid "2fe3b9833af044abb929a88d5a59620f")
diff --git a/gnucash/report/reports/standard/income-gst-statement.scm b/gnucash/report/reports/standard/income-gst-statement.scm
index b48f8790d..dd0cd30d9 100644
--- a/gnucash/report/reports/standard/income-gst-statement.scm
+++ b/gnucash/report/reports/standard/income-gst-statement.scm
@@ -28,11 +28,11 @@
 (define-module (gnucash reports standard income-gst-statement))
 
 (use-modules (gnucash engine))
-(use-modules (gnucash utilities)) 
-(use-modules (srfi srfi-1))
-(use-modules (gnucash gnc-module))
+(use-modules (gnucash utilities))
 (use-modules (gnucash core-utils))
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
+(use-modules (srfi srfi-1))
 
 ;; Define the strings here to avoid typos and make changes easier.
 (define reportname (N_ "Income and GST Statement"))
diff --git a/gnucash/report/reports/standard/income-statement.scm b/gnucash/report/reports/standard/income-statement.scm
index 92e62326a..42c8a3cab 100644
--- a/gnucash/report/reports/standard/income-statement.scm
+++ b/gnucash/report/reports/standard/income-statement.scm
@@ -43,11 +43,10 @@
 
 (define-module (gnucash reports standard income-statement))
 (use-modules (gnucash engine))
-(use-modules (gnucash utilities)) 
-(use-modules (gnucash gnc-module))
+(use-modules (gnucash utilities))
 (use-modules (gnucash core-utils))
-
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 
 ;; define all option's names and help text so that they are properly
 ;; defined in *one* place.
diff --git a/gnucash/report/reports/standard/invoice.scm b/gnucash/report/reports/standard/invoice.scm
index 5e88cc193..6fccc0aae 100644
--- a/gnucash/report/reports/standard/invoice.scm
+++ b/gnucash/report/reports/standard/invoice.scm
@@ -25,12 +25,11 @@
 (define-module (gnucash reports standard invoice))
 
 (use-modules (gnucash engine))
-(use-modules (srfi srfi-1))
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils))
 (use-modules (gnucash utilities))
-
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
+(use-modules (srfi srfi-1))
 
 (define (addif pred . data) (if pred data '()))
 
diff --git a/gnucash/report/reports/standard/job-report.scm b/gnucash/report/reports/standard/job-report.scm
index 3a93abca1..9ca6f1668 100644
--- a/gnucash/report/reports/standard/job-report.scm
+++ b/gnucash/report/reports/standard/job-report.scm
@@ -26,13 +26,12 @@
 
 (define-module (gnucash reports standard job-report))
 
-(use-modules (srfi srfi-1))
 (use-modules (gnucash engine))
-(use-modules (gnucash gnc-module))
-(use-modules (gnucash utilities))		; for gnc:debug
+(use-modules (gnucash utilities))   ; for gnc:debug
 (use-modules (gnucash core-utils))
-
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
+(use-modules (srfi srfi-1))
 
 (define acct-string (N_ "Account"))
 (define owner-string (N_ "Job"))
diff --git a/gnucash/report/reports/standard/net-charts.scm b/gnucash/report/reports/standard/net-charts.scm
index 0ed8eb978..4a44e9cc9 100644
--- a/gnucash/report/reports/standard/net-charts.scm
+++ b/gnucash/report/reports/standard/net-charts.scm
@@ -28,14 +28,12 @@
 
 (define-module (gnucash reports standard net-charts))
 
-(use-modules (srfi srfi-1))
 (use-modules (gnucash engine))
-(use-modules (gnucash utilities)) 
-(use-modules (gnucash gnc-module))
+(use-modules (gnucash utilities))
 (use-modules (gnucash core-utils))
-
-(gnc:module-load "gnucash/report" 0)
-
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
+(use-modules (srfi srfi-1))
 
 (define optname-from-date (N_ "Start Date"))
 (define optname-to-date (N_ "End Date"))
diff --git a/gnucash/report/reports/standard/new-aging.scm b/gnucash/report/reports/standard/new-aging.scm
index eec78d9a6..441ceb77e 100644
--- a/gnucash/report/reports/standard/new-aging.scm
+++ b/gnucash/report/reports/standard/new-aging.scm
@@ -31,12 +31,9 @@
 (use-modules (srfi srfi-11))            ;let-values
 (use-modules (gnucash utilities))
 (use-modules (gnucash engine))
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils))
-
-(gnc:module-load "gnucash/report" 0)
-
-(use-modules (gnucash reports))
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 
 (define optname-to-date (N_ "To"))
 (define optname-sort-order (N_ "Sort Order"))
diff --git a/gnucash/report/reports/standard/new-owner-report.scm b/gnucash/report/reports/standard/new-owner-report.scm
index da8faa8ee..ff0a7b57d 100644
--- a/gnucash/report/reports/standard/new-owner-report.scm
+++ b/gnucash/report/reports/standard/new-owner-report.scm
@@ -31,13 +31,11 @@
 (use-modules (srfi srfi-1))
 (use-modules (srfi srfi-8))
 (use-modules (srfi srfi-11))             ;for let-values
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))        ; for gnc:debug
 (use-modules (gnucash core-utils))
-
-(gnc:module-load "gnucash/report" 0)
-(use-modules (gnucash reports))
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 
 ;; Option names
 (define optname-from-date (N_ "From"))
diff --git a/gnucash/report/reports/standard/owner-report.scm b/gnucash/report/reports/standard/owner-report.scm
index 7a5057cb1..1b0c88542 100644
--- a/gnucash/report/reports/standard/owner-report.scm
+++ b/gnucash/report/reports/standard/owner-report.scm
@@ -30,11 +30,10 @@
 (use-modules (srfi srfi-1))
 (use-modules (srfi srfi-8))
 (use-modules (gnucash engine))
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash utilities))        ; for gnc:debug
 (use-modules (gnucash core-utils))
-
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 
 ;; Option names
 (define optname-from-date (N_ "From"))
diff --git a/gnucash/report/reports/standard/payables.scm b/gnucash/report/reports/standard/payables.scm
index 9eaa36aa2..05b2ef8b9 100644
--- a/gnucash/report/reports/standard/payables.scm
+++ b/gnucash/report/reports/standard/payables.scm
@@ -27,11 +27,9 @@
 
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils))
-
-(gnc:module-load "gnucash/report" 0)
-
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 (use-modules (gnucash reports aging))
 
 (define acc-page gnc:pagename-general)
diff --git a/gnucash/report/reports/standard/portfolio.scm b/gnucash/report/reports/standard/portfolio.scm
index 939d178f2..5046518d5 100644
--- a/gnucash/report/reports/standard/portfolio.scm
+++ b/gnucash/report/reports/standard/portfolio.scm
@@ -24,12 +24,11 @@
 (define-module (gnucash reports standard portfolio))
 
 (use-modules (gnucash engine))
-(use-modules (gnucash utilities)) 
-(use-modules (srfi srfi-1))
-(use-modules (gnucash gnc-module))
+(use-modules (gnucash utilities))
 (use-modules (gnucash core-utils))
-
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
+(use-modules (srfi srfi-1))
 
 (define reportname (N_ "Investment Portfolio"))
 
diff --git a/gnucash/report/reports/standard/price-scatter.scm b/gnucash/report/reports/standard/price-scatter.scm
index 2f9cf33e3..49f7962bf 100644
--- a/gnucash/report/reports/standard/price-scatter.scm
+++ b/gnucash/report/reports/standard/price-scatter.scm
@@ -25,12 +25,11 @@
 (define-module (gnucash reports standard price-scatter))
 
 (use-modules (gnucash engine))
-(use-modules (gnucash utilities)) 
-(use-modules (srfi srfi-1))
-(use-modules (gnucash gnc-module))
+(use-modules (gnucash utilities))
 (use-modules (gnucash core-utils))
-
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
+(use-modules (srfi srfi-1))
 
 (define optname-from-date (N_ "Start Date"))
 (define optname-to-date (N_ "End Date"))
diff --git a/gnucash/report/reports/standard/receipt.scm b/gnucash/report/reports/standard/receipt.scm
index b3c5c66f4..cbfa5a395 100644
--- a/gnucash/report/reports/standard/receipt.scm
+++ b/gnucash/report/reports/standard/receipt.scm
@@ -20,9 +20,10 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash core-utils))
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 
 (use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/report" 0)
 (gnc:module-load "gnucash/html" 0)
 
 (use-modules (gnucash eguile))
diff --git a/gnucash/report/reports/standard/receivables.scm b/gnucash/report/reports/standard/receivables.scm
index 9c16201a4..39c1d47fe 100644
--- a/gnucash/report/reports/standard/receivables.scm
+++ b/gnucash/report/reports/standard/receivables.scm
@@ -27,11 +27,9 @@
 
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils))
-
-(gnc:module-load "gnucash/report" 0)
-
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 (use-modules (gnucash reports aging))
 
 (define acc-page gnc:pagename-general)
diff --git a/gnucash/report/reports/standard/reconcile-report.scm b/gnucash/report/reports/standard/reconcile-report.scm
index 456dae00d..822ecef1e 100644
--- a/gnucash/report/reports/standard/reconcile-report.scm
+++ b/gnucash/report/reports/standard/reconcile-report.scm
@@ -28,8 +28,8 @@
 
 (use-modules (gnucash engine))
 (use-modules (gnucash core-utils))
-(use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 
 (define (reconcile-report-options-generator)
   (let ((options (gnc:trep-options-generator)))
diff --git a/gnucash/report/reports/standard/register.scm b/gnucash/report/reports/standard/register.scm
index 2ce1dfdb0..534b4a996 100644
--- a/gnucash/report/reports/standard/register.scm
+++ b/gnucash/report/reports/standard/register.scm
@@ -24,11 +24,10 @@
 
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
-(use-modules (srfi srfi-1))
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils))
-
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
+(use-modules (srfi srfi-1))
 
 (define (date-col columns-used)
   (vector-ref columns-used 0))
diff --git a/gnucash/report/reports/standard/taxinvoice.scm b/gnucash/report/reports/standard/taxinvoice.scm
index d25efb9f7..65e9acdbe 100644
--- a/gnucash/report/reports/standard/taxinvoice.scm
+++ b/gnucash/report/reports/standard/taxinvoice.scm
@@ -28,9 +28,10 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash core-utils))
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 
 (use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/report" 0)
 (gnc:module-load "gnucash/html" 0)
 
 (use-modules (gnucash eguile))
diff --git a/gnucash/report/reports/standard/test/test-average-balance.scm b/gnucash/report/reports/standard/test/test-average-balance.scm
index d4c0312a2..7dbb6219c 100644
--- a/gnucash/report/reports/standard/test/test-average-balance.scm
+++ b/gnucash/report/reports/standard/test/test-average-balance.scm
@@ -1,5 +1,3 @@
-(use-modules (gnucash gnc-module))
-(gnc:module-begin-syntax (gnc:module-load "gnucash/report" 0))
 (use-modules (tests test-engine-extras))
 (use-modules (gnucash reports example average-balance))
 (use-modules (gnucash report))
@@ -11,6 +9,7 @@
 (use-modules (srfi srfi-64))
 (use-modules (gnucash engine))
 (use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 
 ;; Explicitly set locale to make the report output predictable
 (setlocale LC_ALL "C")
diff --git a/gnucash/report/reports/standard/test/test-budget.scm b/gnucash/report/reports/standard/test/test-budget.scm
index 9d09f9e23..fbd9fd36e 100644
--- a/gnucash/report/reports/standard/test/test-budget.scm
+++ b/gnucash/report/reports/standard/test/test-budget.scm
@@ -20,16 +20,12 @@
 (use-modules (srfi srfi-1))
 (use-modules (srfi srfi-14))
 (use-modules (srfi srfi-64))
-(use-modules (gnucash gnc-module))
 (use-modules (tests srfi64-extras))
 
-(gnc:module-begin-syntax (gnc:module-load "gnucash/report" 0))
-
 (use-modules (gnucash utilities))
 (use-modules (gnucash report))
 (use-modules (gnucash app-utils))
 (use-modules (gnucash engine))
-(use-modules (sw_engine))
 (use-modules (gnucash reports standard budget))
 (use-modules (gnucash reports standard budget-income-statement))
 (use-modules (gnucash reports standard budget-balance-sheet))
diff --git a/gnucash/report/reports/standard/test/test-cashflow-barchart.scm b/gnucash/report/reports/standard/test/test-cashflow-barchart.scm
index 13ccc6d77..e8e1ae80b 100644
--- a/gnucash/report/reports/standard/test/test-cashflow-barchart.scm
+++ b/gnucash/report/reports/standard/test/test-cashflow-barchart.scm
@@ -17,9 +17,6 @@
 ;; Boston, MA  02110-1301,  USA       gnu at gnu.org
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-(use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/report" 0)
-
 (use-modules (gnucash engine))
 (use-modules (gnucash app-utils))
 (use-modules (tests test-engine-extras))
diff --git a/gnucash/report/reports/standard/test/test-equity-statement.scm b/gnucash/report/reports/standard/test/test-equity-statement.scm
index ff107f41e..0bd52671d 100644
--- a/gnucash/report/reports/standard/test/test-equity-statement.scm
+++ b/gnucash/report/reports/standard/test/test-equity-statement.scm
@@ -20,20 +20,12 @@
 (use-modules (srfi srfi-1))
 (use-modules (srfi srfi-14))
 (use-modules (srfi srfi-64))
-(use-modules (gnucash gnc-module))
 (use-modules (tests srfi64-extras))
 
-;; Guile 2 needs to load external modules at compile time
-;; otherwise the N_ syntax-rule won't be found at compile time
-;; causing the test to fail
-;; That's what the wrapper below is meant for:
-
-(gnc:module-begin-syntax (gnc:module-load "gnucash/report" 0))
-
 (use-modules (gnucash utilities))
 (use-modules (gnucash app-utils))
 (use-modules (gnucash engine))
-(use-modules (sw_engine))
+(use-modules (gnucash report))
 (use-modules (gnucash reports standard equity-statement))
 (use-modules (gnucash report stylesheets plain))
 (use-modules (tests test-engine-extras))
diff --git a/gnucash/report/reports/standard/test/test-register.scm b/gnucash/report/reports/standard/test/test-register.scm
index 80c04e184..86d561e15 100644
--- a/gnucash/report/reports/standard/test/test-register.scm
+++ b/gnucash/report/reports/standard/test/test-register.scm
@@ -20,21 +20,12 @@
 (use-modules (srfi srfi-1))
 (use-modules (srfi srfi-14))
 (use-modules (srfi srfi-64))
-(use-modules (gnucash gnc-module))
 (use-modules (tests srfi64-extras))
 
-;; Guile 2 needs to load external modules at compile time
-;; otherwise the N_ syntax-rule won't be found at compile time
-;; causing the test to fail
-;; That's what the wrapper below is meant for:
-
-(gnc:module-begin-syntax (gnc:module-load "gnucash/report" 0))
-
 (use-modules (gnucash utilities))
 (use-modules (gnucash report))
 (use-modules (gnucash app-utils))
 (use-modules (gnucash engine))
-(use-modules (sw_engine))
 (use-modules (gnucash reports standard register))
 (use-modules (tests test-report-extras))
 (use-modules (gnucash report stylesheets plain)) ; For the default stylesheet, required for rendering
diff --git a/gnucash/report/reports/standard/test/test-standard-category-report.scm b/gnucash/report/reports/standard/test/test-standard-category-report.scm
index 13cdee755..f2e380d03 100644
--- a/gnucash/report/reports/standard/test/test-standard-category-report.scm
+++ b/gnucash/report/reports/standard/test/test-standard-category-report.scm
@@ -20,21 +20,12 @@
 (use-modules (srfi srfi-1))
 (use-modules (srfi srfi-14))
 (use-modules (srfi srfi-64))
-(use-modules (gnucash gnc-module))
 (use-modules (tests srfi64-extras))
 
-;; Guile 2 needs to load external modules at compile time
-;; otherwise the N_ syntax-rule won't be found at compile time
-;; causing the test to fail
-;; That's what the wrapper below is meant for:
-
-(gnc:module-begin-syntax (gnc:module-load "gnucash/report" 0))
-
 (use-modules (gnucash utilities)) 
 (use-modules (gnucash report))
 (use-modules (gnucash app-utils))
 (use-modules (gnucash engine))
-(use-modules (sw_engine))
 (use-modules (gnucash reports standard net-charts))
 (use-modules (tests test-report-extras))
 (use-modules (gnucash reports standard category-barchart))
diff --git a/gnucash/report/reports/standard/test/test-standard-net-barchart.scm b/gnucash/report/reports/standard/test/test-standard-net-barchart.scm
index bed5e7117..c47a49c7b 100644
--- a/gnucash/report/reports/standard/test/test-standard-net-barchart.scm
+++ b/gnucash/report/reports/standard/test/test-standard-net-barchart.scm
@@ -17,10 +17,9 @@
 ;; Boston, MA  02110-1301,  USA       gnu at gnu.org
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-(use-modules (gnucash gnc-module))
-(gnc:module-begin-syntax (gnc:module-load "gnucash/report" 0))
 (use-modules (gnucash engine))
-(use-modules (sw_engine))
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 (use-modules (srfi srfi-1))
 (use-modules (srfi srfi-64))
 (use-modules (gnucash report stylesheets plain)) ; For the default stylesheet, required for rendering
diff --git a/gnucash/report/reports/standard/test/test-standard-net-linechart.scm b/gnucash/report/reports/standard/test/test-standard-net-linechart.scm
index ca94e85d4..1f3a35c49 100644
--- a/gnucash/report/reports/standard/test/test-standard-net-linechart.scm
+++ b/gnucash/report/reports/standard/test/test-standard-net-linechart.scm
@@ -17,10 +17,9 @@
 ;; Boston, MA  02110-1301,  USA       gnu at gnu.org
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-(use-modules (gnucash gnc-module))
-(gnc:module-begin-syntax (gnc:module-load "gnucash/report" 0))
 (use-modules (gnucash engine))
-(use-modules (sw_engine))
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 (use-modules (srfi srfi-1))
 (use-modules (srfi srfi-64))
 (use-modules (gnucash report stylesheets plain)) ; For the default stylesheet, required for rendering
diff --git a/gnucash/report/reports/standard/test/test-trial-balance.scm b/gnucash/report/reports/standard/test/test-trial-balance.scm
index 647058d20..a6c0a2151 100644
--- a/gnucash/report/reports/standard/test/test-trial-balance.scm
+++ b/gnucash/report/reports/standard/test/test-trial-balance.scm
@@ -20,20 +20,12 @@
 (use-modules (srfi srfi-1))
 (use-modules (srfi srfi-14))
 (use-modules (srfi srfi-64))
-(use-modules (gnucash gnc-module))
 (use-modules (tests srfi64-extras))
 
-;; Guile 2 needs to load external modules at compile time
-;; otherwise the N_ syntax-rule won't be found at compile time
-;; causing the test to fail
-;; That's what the wrapper below is meant for:
-
-(gnc:module-begin-syntax (gnc:module-load "gnucash/report" 0))
-
 (use-modules (gnucash utilities))
 (use-modules (gnucash app-utils))
 (use-modules (gnucash engine))
-(use-modules (sw_engine))
+(use-modules (gnucash report))
 (use-modules (gnucash reports standard trial-balance))
 (use-modules (gnucash report stylesheets plain))
 (use-modules (tests test-engine-extras))
diff --git a/gnucash/report/reports/standard/transaction.scm b/gnucash/report/reports/standard/transaction.scm
index cf79e5e28..5f5fe4d03 100644
--- a/gnucash/report/reports/standard/transaction.scm
+++ b/gnucash/report/reports/standard/transaction.scm
@@ -24,9 +24,9 @@
 
 (define-module (gnucash reports standard transaction))
 
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils))
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 
 (gnc:define-report
  'version 1
diff --git a/gnucash/report/reports/standard/trial-balance.scm b/gnucash/report/reports/standard/trial-balance.scm
index 2368ba48c..ce800ab14 100644
--- a/gnucash/report/reports/standard/trial-balance.scm
+++ b/gnucash/report/reports/standard/trial-balance.scm
@@ -54,10 +54,9 @@
 (use-modules (srfi srfi-1))
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils))
-
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 
 (define reportname (N_ "Trial Balance"))
 
diff --git a/gnucash/report/reports/standard/view-column.scm b/gnucash/report/reports/standard/view-column.scm
index 17b0585a3..24b960092 100644
--- a/gnucash/report/reports/standard/view-column.scm
+++ b/gnucash/report/reports/standard/view-column.scm
@@ -29,15 +29,11 @@
 (define-module (gnucash reports standard view-column))
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
-(use-modules (gnucash app-utils))
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils))
-(eval-when
-      (compile load eval expand)
-      (load-extension "libgncmod-report" "scm_init_sw_report_module"))
-(use-modules (sw_report))
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 
-(gnc:module-load "gnucash/report" 0)
+(use-modules (gnucash gnc-module))
 (gnc:module-load "gnucash/html" 0) ;for gnc-build-url
 
 (define (make-options)
diff --git a/gnucash/report/stylesheets/footer.scm b/gnucash/report/stylesheets/footer.scm
index 1ebfd160a..7b2acfae8 100644
--- a/gnucash/report/stylesheets/footer.scm
+++ b/gnucash/report/stylesheets/footer.scm
@@ -38,11 +38,11 @@
 
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils))
+(use-modules (gnucash report))
 
+(use-modules (gnucash gnc-module))
 (gnc:module-load "gnucash/html" 0)
-(gnc:module-load "gnucash/report" 0)
 
 (define (easy-fancy-footer-options)
   (let* ((options (gnc:new-options))
diff --git a/gnucash/report/stylesheets/head-or-tail.scm b/gnucash/report/stylesheets/head-or-tail.scm
index 3e5acd507..0443181a4 100644
--- a/gnucash/report/stylesheets/head-or-tail.scm
+++ b/gnucash/report/stylesheets/head-or-tail.scm
@@ -37,11 +37,11 @@
 
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils)) ; for gnc:version and (_ ...)
+(use-modules (gnucash report))
 
+(use-modules (gnucash gnc-module))
 (gnc:module-load "gnucash/html" 0)
-(gnc:module-load "gnucash/report" 0)
 
 (define (head-or-tail-options)
   (let* ((options (gnc:new-options))
diff --git a/gnucash/report/stylesheets/plain.scm b/gnucash/report/stylesheets/plain.scm
index 5b9cec06c..8b1cb999d 100644
--- a/gnucash/report/stylesheets/plain.scm
+++ b/gnucash/report/stylesheets/plain.scm
@@ -26,13 +26,13 @@
 
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils))
+(use-modules (gnucash report))
 (use-modules (srfi srfi-13))
 (use-modules (srfi srfi-14))
 
+(use-modules (gnucash gnc-module))
 (gnc:module-load "gnucash/html" 0)
-(gnc:module-load "gnucash/report" 0)
 
 ;; plain style sheet
 ;; this should generally be the default style sheet for most reports.
diff --git a/gnucash/report/test/test-html-chart.scm b/gnucash/report/test/test-html-chart.scm
index 49839ce21..5c70cd0e9 100644
--- a/gnucash/report/test/test-html-chart.scm
+++ b/gnucash/report/test/test-html-chart.scm
@@ -1,6 +1,3 @@
-(use-modules (gnucash gnc-module))
-(gnc:module-begin-syntax (gnc:module-load "gnucash/report" 0))
-
 (use-modules (gnucash app-utils))
 (use-modules (gnucash report))
 (use-modules (srfi srfi-64))
diff --git a/gnucash/report/test/test-html-utilities-srfi64.scm b/gnucash/report/test/test-html-utilities-srfi64.scm
index a1788d34c..f724054df 100644
--- a/gnucash/report/test/test-html-utilities-srfi64.scm
+++ b/gnucash/report/test/test-html-utilities-srfi64.scm
@@ -1,6 +1,3 @@
-(use-modules (gnucash gnc-module))
-(gnc:module-begin-syntax (gnc:module-load "gnucash/report" 0))
-
 (use-modules (gnucash app-utils))
 (use-modules (gnucash report))
 (use-modules (tests test-engine-extras))
diff --git a/gnucash/report/test/test-report-utilities.scm b/gnucash/report/test/test-report-utilities.scm
index cc3ad294e..7b9afc0c6 100644
--- a/gnucash/report/test/test-report-utilities.scm
+++ b/gnucash/report/test/test-report-utilities.scm
@@ -1,6 +1,3 @@
-(use-modules (gnucash gnc-module))
-(gnc:module-begin-syntax (gnc:module-load "gnucash/report" 0))
-
 (use-modules (gnucash engine))
 (use-modules (gnucash app-utils))
 (use-modules (gnucash report))
diff --git a/libgnucash/app-utils/date-utilities.scm b/libgnucash/app-utils/date-utilities.scm
index e899c157d..e24c077d4 100644
--- a/libgnucash/app-utils/date-utilities.scm
+++ b/libgnucash/app-utils/date-utilities.scm
@@ -415,7 +415,7 @@
 
 ;; the globally available hash of reldates (hash-key = reldate
 ;; symbols, hash-value = a vector, reldate data).
-(define gnc:relative-date-hash (make-hash-table))
+(define gnc:relative-date-hash #f)
 
 (define (gnc:get-absolute-from-relative-date date-symbol)
   ;; used in options.scm
@@ -792,10 +792,9 @@ Defaulting to today."))
 ;;one-month-ago three-months-ago six-months-ago one-year-ago
 ;;start-cur-fin-year start-prev-fin-year end-prev-fin-year
 
-(define (gnc:reldate-initialize)
-  (define gnc:reldate-string-db (gnc:make-string-database))
-  (define gnc:relative-date-values #f)
-
+(define gnc:reldate-string-db (gnc:make-string-database))
+(define gnc:relative-date-values #f)
+(unless gnc:relative-date-hash
   (gnc:reldate-string-db 
    'store 'start-cal-year-string 
    (N_ "Start of this year"))
@@ -1120,6 +1119,7 @@ Defaulting to today."))
 		 gnc:get-one-year-ahead)))
 
   ;; initialise gnc:relative-date-hash
+  (set! gnc:relative-date-hash (make-hash-table))
   (for-each
    (lambda (reldate)
      (hash-set! gnc:relative-date-hash (gnc:reldate-get-symbol reldate) reldate))

commit 25cce83f296f22abc05d64ee26759c99838d2131
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat Nov 23 16:15:21 2019 +0100

    gnome-utils - expose wrapped api directly from gnome-utils.scm
    
    With that in place we no longer need to (gnc:module-load "gnucash/gnome-utils" 0)
    the gnome-utils gncmodule. An ordinary (use-modules (gnucash gnome-utils)) suffices

diff --git a/bindings/guile/CMakeLists.txt b/bindings/guile/CMakeLists.txt
index c4efb6e3a..a4ece1546 100644
--- a/bindings/guile/CMakeLists.txt
+++ b/bindings/guile/CMakeLists.txt
@@ -152,7 +152,7 @@ gnc_add_scheme_targets(scm-gnc-module
 gnc_add_scheme_targets(price-quotes
     price-quotes.scm
     gnucash
-    "scm-engine;scm-app-utils"
+    "scm-engine;scm-app-utils;scm-gnome-utils"
     FALSE)
 
 set_local_dist(guile_DIST_local
diff --git a/bindings/guile/price-quotes.scm b/bindings/guile/price-quotes.scm
index 37b7292bc..678c0abbf 100644
--- a/bindings/guile/price-quotes.scm
+++ b/bindings/guile/price-quotes.scm
@@ -26,14 +26,12 @@
 (export gnc:price-quotes-install-sources)
 
 (use-modules (gnucash engine))
-(use-modules (gnucash utilities)) 
-(use-modules (gnucash gnc-module))
+(use-modules (gnucash utilities))
 (use-modules (gnucash core-utils))
+(use-modules (gnucash gnome-utils))
 (use-modules (srfi srfi-11)
              (srfi srfi-1))
 
-(gnc:module-load "gnucash/gnome-utils" 0) ;; for gnucash-ui-is-running
-
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (define gnc:*finance-quote-check*
diff --git a/gnucash/gnome-utils/gnome-utils.scm b/gnucash/gnome-utils/gnome-utils.scm
index b8fbad381..25b945a71 100644
--- a/gnucash/gnome-utils/gnome-utils.scm
+++ b/gnucash/gnome-utils/gnome-utils.scm
@@ -27,6 +27,10 @@
   (load-extension "libgncmod-gnome-utils" "scm_init_sw_gnome_utils_module"))
 (use-modules (sw_gnome_utils))
 
+; Export the swig-wrapped symbols in the public interface of this module
+(let ((i (module-public-interface (current-module))))
+     (module-use! i (resolve-interface '(sw_gnome_utils))))
+
 ;; from gnc-menu-extensions.scm
 (export gnc:extension-type)
 (export gnc:extension-name)
diff --git a/gnucash/gnome/report-menus.scm b/gnucash/gnome/report-menus.scm
index 50f52aa2d..c2670d7f3 100644
--- a/gnucash/gnome/report-menus.scm
+++ b/gnucash/gnome/report-menus.scm
@@ -28,7 +28,6 @@
 (use-modules (gnucash core-utils))
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash gnome-utils))
 (use-modules (gnucash reports standard dashboard))
 
@@ -36,7 +35,7 @@
   (load-extension "libgnc-gnome" "scm_init_sw_gnome_module"))
 (use-modules (sw_gnome))
 
-(gnc:module-load "gnucash/gnome-utils" 0)
+(use-modules (gnucash gnc-module))
 (gnc:module-begin-syntax (gnc:module-load "gnucash/report" 0))
 
 (export gnc:report-menu-setup)
diff --git a/gnucash/import-export/qif-imp/qif-import.scm b/gnucash/import-export/qif-imp/qif-import.scm
index e70a4195d..e1f206a1d 100644
--- a/gnucash/import-export/qif-imp/qif-import.scm
+++ b/gnucash/import-export/qif-imp/qif-import.scm
@@ -28,6 +28,7 @@
 (use-modules (gnucash utilities))
 (use-modules (gnucash engine))
 (use-modules (gnucash app-utils))
+(use-modules (gnucash gnome-utils))
 
 ;; We do this initialization here because src/gnome isn't a real module.
 ;; Note: Guile 2 needs to find the symbols from the extension at compile time already
@@ -41,9 +42,6 @@
 
 (debug-enable 'backtrace)
 
-(use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/gnome-utils" 0)
-
 (load-from-path "gnucash/qif-import/qif-objects")      ;; class definitions
 (load-from-path "gnucash/qif-import/qif-parse")        ;; string-to-value
 (load-from-path "gnucash/qif-import/qif-utils")
diff --git a/gnucash/report/report.scm b/gnucash/report/report.scm
index 0d2641427..2107fd03d 100644
--- a/gnucash/report/report.scm
+++ b/gnucash/report/report.scm
@@ -32,10 +32,10 @@
 (use-modules (gnucash core-utils))
 (use-modules (gnucash engine))
 (use-modules (gnucash app-utils))
+(use-modules (gnucash gnome-utils))
 
 (use-modules (gnucash gnc-module))
 (gnc:module-load "gnucash/html" 0)
-(gnc:module-load "gnucash/gnome-utils" 0)
 
 ;; commodity-utilities.scm
 (export gnc:get-match-commodity-splits)
diff --git a/gnucash/report/reports/aging.scm b/gnucash/report/reports/aging.scm
index 1104312e2..7c05468df 100644
--- a/gnucash/report/reports/aging.scm
+++ b/gnucash/report/reports/aging.scm
@@ -30,9 +30,7 @@
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils))
-(eval-when (compile load eval expand)
-  (load-extension "libgncmod-gnome-utils" "scm_init_sw_gnome_utils_module"))
-(use-modules (sw_gnome_utils))
+(use-modules (gnucash gnome-utils))
 
 (gnc:module-load "gnucash/report" 0)
 
diff --git a/gnucash/report/reports/example/sample-graphs.scm b/gnucash/report/reports/example/sample-graphs.scm
index f168adcab..c3e754cff 100644
--- a/gnucash/report/reports/example/sample-graphs.scm
+++ b/gnucash/report/reports/example/sample-graphs.scm
@@ -25,16 +25,16 @@
 
 (define-module (gnucash reports example sample-graphs))
 (use-modules (gnucash engine))
-(use-modules (gnucash utilities)) 
-(use-modules (gnucash gnc-module))
+(use-modules (gnucash utilities))
+(use-modules (gnucash gnome-utils)) ;for gnc-build-url
 
 ;; Add this module to enable translatable strings
 ;; Use (N_ string) to mark string for translation (it won't be translated on the spot)
 ;; Use (_ string) to use a translation of this string if it exists.
 (use-modules (gnucash core-utils))
 
+(use-modules (gnucash gnc-module))
 (gnc:module-load "gnucash/report" 0)
-(gnc:module-load "gnucash/gnome-utils" 0) ;for gnc-build-url
 
 ;; It's common to define frequently used strings once
 ;; This also helps getting more consistent messages which simplifies
diff --git a/gnucash/report/reports/locale-specific/us/taxtxf.scm b/gnucash/report/reports/locale-specific/us/taxtxf.scm
index 682e0f27f..0b2459f31 100644
--- a/gnucash/report/reports/locale-specific/us/taxtxf.scm
+++ b/gnucash/report/reports/locale-specific/us/taxtxf.scm
@@ -102,16 +102,12 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (srfi srfi-1))
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils)) ; for gnc:version and (_ ...)
 (use-modules (gnucash locale us tax))
-
-(eval-when
-      (compile load eval expand)
-      (load-extension "libgncmod-gnome-utils" "scm_init_sw_gnome_utils_module"))
-(use-modules (sw_gnome_utils)) ;; to get to gnc-error-dialog
+(use-modules (gnucash gnome-utils))
 
 
+(use-modules (gnucash gnc-module))
 (gnc:module-load "gnucash/html" 0)
 (gnc:module-load "gnucash/report" 0)
 
diff --git a/gnucash/report/reports/standard/budget-flow.scm b/gnucash/report/reports/standard/budget-flow.scm
index 0e68ed35e..fd4712569 100644
--- a/gnucash/report/reports/standard/budget-flow.scm
+++ b/gnucash/report/reports/standard/budget-flow.scm
@@ -28,11 +28,11 @@
 (define-module (gnucash reports standard budget-flow))
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils))
+(use-modules (gnucash gnome-utils)) ;for gnc-build-url
 
+(use-modules (gnucash gnc-module))
 (gnc:module-load "gnucash/report" 0)
-(gnc:module-load "gnucash/gnome-utils" 0) ;for gnc-build-url
 
 (define reportname
   (N_ "Budget Flow"))
diff --git a/gnucash/report/reports/standard/budget.scm b/gnucash/report/reports/standard/budget.scm
index 1dac3a0be..80d9ec56a 100644
--- a/gnucash/report/reports/standard/budget.scm
+++ b/gnucash/report/reports/standard/budget.scm
@@ -29,14 +29,14 @@
 
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils))
+(use-modules (gnucash gnome-utils)) ;for gnc-build-url
 
 (use-modules (srfi srfi-1))
 (use-modules (ice-9 match))
 
+(use-modules (gnucash gnc-module))
 (gnc:module-load "gnucash/report" 0)
-(gnc:module-load "gnucash/gnome-utils" 0) ;for gnc-build-url
 
 (define reportname (N_ "Budget Report"))
 
diff --git a/gnucash/report/reports/standard/cash-flow.scm b/gnucash/report/reports/standard/cash-flow.scm
index d35c6ad75..59d947cce 100644
--- a/gnucash/report/reports/standard/cash-flow.scm
+++ b/gnucash/report/reports/standard/cash-flow.scm
@@ -30,11 +30,11 @@
 (define-module (gnucash reports standard cash-flow))
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils))
+(use-modules (gnucash gnome-utils)) ;for gnc-build-url
 
+(use-modules (gnucash gnc-module))
 (gnc:module-load "gnucash/report" 0)
-(gnc:module-load "gnucash/gnome-utils" 0) ;for gnc-build-url
 
 (export cash-flow-calc-money-in-out)
 

commit ee722b85c1337cb41aa79423e5db15a78bffb226
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat Nov 23 15:51:20 2019 +0100

    bindings/guile cleanup - fold engine-utilities.scm into engine.scm
    
    It was only exposed via engine.scm anyway and combining them
    in one file eliminates one explicit load_extension and sw_engine call.

diff --git a/bindings/guile/CMakeLists.txt b/bindings/guile/CMakeLists.txt
index ad73e4a76..c4efb6e3a 100644
--- a/bindings/guile/CMakeLists.txt
+++ b/bindings/guile/CMakeLists.txt
@@ -92,7 +92,6 @@ gnc_add_scheme_targets(scm-core-utils
 
 set (engine_SCHEME_0
     commodity-table.scm
-    engine-utilities.scm
     gnc-numeric.scm
     business-core.scm
 )
diff --git a/bindings/guile/engine-utilities.scm b/bindings/guile/engine-utilities.scm
deleted file mode 100644
index 77feacb30..000000000
--- a/bindings/guile/engine-utilities.scm
+++ /dev/null
@@ -1,50 +0,0 @@
-;; engine-utilities.scm
-;;
-;; Convenience routines, etc. related to the engine.
-;;
-;; This program is free software; you can redistribute it and/or    
-;; modify it under the terms of the GNU General Public License as   
-;; published by the Free Software Foundation; either version 2 of   
-;; the License, or (at your option) any later version.              
-;;                                                                  
-;; This program is distributed in the hope that it will be useful,  
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of   
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    
-;; GNU General Public License for more details.                     
-;;                                                                  
-;; You should have received a copy of the GNU General Public License
-;; along with this program; if not, contact:
-;;
-;; Free Software Foundation           Voice:  +1-617-542-5942
-;; 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652
-;; Boston, MA  02110-1301,  USA       gnu at gnu.org
-
-;; Copyright 2000 Rob Browning <rlb at cs.utexas.edu>
-(eval-when
-      (compile load eval expand)
-      (load-extension "libgnucash-guile" "gnc_guile_bindings_init"))
-(use-modules (sw_engine))
-
-(use-modules (srfi srfi-1)
-             (srfi srfi-13))
-
-(define (gnc:account-map-descendants thunk account)
-  (let ((descendants (or (gnc-account-get-descendants-sorted account) '())))
-    (map thunk descendants)))
-
-(define (gnc:account-map-children thunk account)
-  (let ((children (or (gnc-account-get-children-sorted account) '())))
-    (map thunk children)))
-
-;; account related functions
-;; helper for sorting of account list
-(define (account-full-name<? a b)
-  (string<? (gnc-account-get-full-name a) (gnc-account-get-full-name b)))
-
-;; return maximum depth over accounts and their children, if any
-(define (accounts-get-children-depth accounts)
-  (apply max
-	 (map (lambda (acct)
-		(let ((acct-depth (gnc-account-get-current-depth acct)))
-		  (+ acct-depth (- (gnc-account-get-tree-depth acct) 1))))
-	      accounts)))
diff --git a/bindings/guile/engine.scm b/bindings/guile/engine.scm
index 9cca0ab21..06f8d0af4 100644
--- a/bindings/guile/engine.scm
+++ b/bindings/guile/engine.scm
@@ -19,6 +19,9 @@
 
 (define-module (gnucash engine))
 
+(use-modules (srfi srfi-1)
+             (srfi srfi-13))
+
 (eval-when
       (compile load eval expand)
       (load-extension "libgnucash-guile" "gnc_guile_bindings_init"))
@@ -63,13 +66,6 @@
 (export GNC_COMMODITY_NS_EUREX)
 (export GNC_COMMODITY_NS_MUTUAL)
 
-;; engine-utilities.scm
-(export gnc:account-map-descendants)
-(export gnc:account-map-children)
-
-(export account-full-name<?)
-(export accounts-get-children-depth)
-
 ; business-core.scm
 (export gnc:owner-get-address)
 (export gnc:owner-get-name-dep)
@@ -80,5 +76,31 @@
 
 (load-from-path "gnucash/engine/gnc-numeric")
 (load-from-path "gnucash/engine/commodity-table")
-(load-from-path "gnucash/engine/engine-utilities")
 (load-from-path "gnucash/engine/business-core")
+
+;; A few account related utility functions which used to be in engine-utilities.scm
+(define (gnc:account-map-descendants thunk account)
+        (let ((descendants (or (gnc-account-get-descendants-sorted account) '())))
+             (map thunk descendants)))
+
+(define (gnc:account-map-children thunk account)
+        (let ((children (or (gnc-account-get-children-sorted account) '())))
+             (map thunk children)))
+
+;; account related functions
+;; helper for sorting of account list
+(define (account-full-name<? a b)
+        (string<? (gnc-account-get-full-name a) (gnc-account-get-full-name b)))
+
+;; return maximum depth over accounts and their children, if any
+(define (accounts-get-children-depth accounts)
+        (apply max
+            (map (lambda (acct)
+                         (let ((acct-depth (gnc-account-get-current-depth acct)))
+                              (+ acct-depth (- (gnc-account-get-tree-depth acct) 1))))
+                 accounts)))
+
+(export gnc:account-map-descendants)
+(export gnc:account-map-children)
+(export account-full-name<?)
+(export accounts-get-children-depth)
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 78524f0f0..2ff5214c3 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -4,7 +4,6 @@ bindings/guile/business-core.scm
 bindings/guile/commodity-table.scm
 bindings/guile/core-utils.scm
 bindings/guile/engine.scm
-bindings/guile/engine-utilities.scm
 bindings/guile/glib-guile.c
 bindings/guile/gnc-engine-guile.c
 bindings/guile/gnc-guile-bindings.c

commit c00bf6bcdbd0139d18368a843588d1f25d5187dd
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat Nov 23 15:37:18 2019 +0100

    app-utils - expose wrapped api directly from app-utils.scm
    
    With that in place we no longer need to (gnc:module-load "gnucash/app-utils" 0)
    the app-utils gncmodule. An ordinary (use-modules (gnucash app-utils)) suffices

diff --git a/bindings/guile/test/test-business-core.scm b/bindings/guile/test/test-business-core.scm
index 5baf5c6d7..9cd0731d1 100644
--- a/bindings/guile/test/test-business-core.scm
+++ b/bindings/guile/test/test-business-core.scm
@@ -1,7 +1,6 @@
 (use-modules (srfi srfi-1))
 (use-modules (srfi srfi-64))
-(use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/app-utils" 0)
+(use-modules (gnucash app-utils))
 (use-modules (tests srfi64-extras))
 (use-modules (tests test-engine-extras))
 (use-modules (gnucash utilities))
diff --git a/bindings/guile/test/test-scm-utilities.scm b/bindings/guile/test/test-scm-utilities.scm
index 269a82ae0..660767f2c 100644
--- a/bindings/guile/test/test-scm-utilities.scm
+++ b/bindings/guile/test/test-scm-utilities.scm
@@ -1,5 +1,4 @@
-(use-modules (gnucash gnc-module))
-(gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
+(use-modules (gnucash app-utils))
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (srfi srfi-64))
diff --git a/gnucash/gnome-utils/gnome-utils.scm b/gnucash/gnome-utils/gnome-utils.scm
index 2c331e4e6..b8fbad381 100644
--- a/gnucash/gnome-utils/gnome-utils.scm
+++ b/gnucash/gnome-utils/gnome-utils.scm
@@ -21,13 +21,11 @@
 
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
-(use-modules (gnucash gnc-module))
+(use-modules (gnucash app-utils))
 
 (eval-when (compile load eval expand)
   (load-extension "libgncmod-gnome-utils" "scm_init_sw_gnome_utils_module"))
-
 (use-modules (sw_gnome_utils))
-(gnc:module-load "gnucash/app-utils" 0)
 
 ;; from gnc-menu-extensions.scm
 (export gnc:extension-type)
diff --git a/gnucash/import-export/qif-imp/qif-import.scm b/gnucash/import-export/qif-imp/qif-import.scm
index b4252f4cc..e70a4195d 100644
--- a/gnucash/import-export/qif-imp/qif-import.scm
+++ b/gnucash/import-export/qif-imp/qif-import.scm
@@ -42,7 +42,6 @@
 (debug-enable 'backtrace)
 
 (use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/app-utils" 0)
 (gnc:module-load "gnucash/gnome-utils" 0)
 
 (load-from-path "gnucash/qif-import/qif-objects")      ;; class definitions
diff --git a/gnucash/import-export/qif-imp/test/test-qif-imp.scm b/gnucash/import-export/qif-imp/test/test-qif-imp.scm
index 0cd0524f7..37825022b 100644
--- a/gnucash/import-export/qif-imp/test/test-qif-imp.scm
+++ b/gnucash/import-export/qif-imp/test/test-qif-imp.scm
@@ -1,5 +1,4 @@
-(use-modules (gnucash gnc-module))
-(gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
+(use-modules (gnucash app-utils))
 (use-modules (srfi srfi-64))
 (use-modules (tests srfi64-extras))
 (use-modules (gnucash qif-import))
diff --git a/gnucash/import-export/qif-imp/test/test-qif-merge-groups.scm b/gnucash/import-export/qif-imp/test/test-qif-merge-groups.scm
index 63638d239..e1177aebb 100644
--- a/gnucash/import-export/qif-imp/test/test-qif-merge-groups.scm
+++ b/gnucash/import-export/qif-imp/test/test-qif-merge-groups.scm
@@ -1,6 +1,5 @@
 (use-modules (gnucash engine))
-(use-modules (gnucash gnc-module))
-(gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
+(use-modules (gnucash app-utils))
 (use-modules (srfi srfi-64))
 (use-modules (tests srfi64-extras))
 (use-modules (gnucash qif-import))
diff --git a/gnucash/import-export/qif-imp/test/test-qif-parse.scm b/gnucash/import-export/qif-imp/test/test-qif-parse.scm
index 586c3d20b..8e94ab308 100644
--- a/gnucash/import-export/qif-imp/test/test-qif-parse.scm
+++ b/gnucash/import-export/qif-imp/test/test-qif-parse.scm
@@ -1,5 +1,4 @@
-(use-modules (gnucash gnc-module))
-(gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
+(use-modules (gnucash app-utils))
 (use-modules (srfi srfi-64))
 (use-modules (tests srfi64-extras))
 (use-modules (gnucash qif-import))
diff --git a/gnucash/report/eguile-html-utilities.scm b/gnucash/report/eguile-html-utilities.scm
index 5519dccb8..2b9a29f73 100644
--- a/gnucash/report/eguile-html-utilities.scm
+++ b/gnucash/report/eguile-html-utilities.scm
@@ -29,7 +29,6 @@
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash app-utils))
 (gnc:module-load "gnucash/report" 0)
-(gnc:module-load "gnucash/app-utils" 0)
 
 (use-modules (ice-9 regex))  ; for regular expressions
 (use-modules (srfi srfi-13)) ; for extra string functions
diff --git a/gnucash/report/eguile-utilities.scm b/gnucash/report/eguile-utilities.scm
index 93a0da29e..3ac817ad4 100644
--- a/gnucash/report/eguile-utilities.scm
+++ b/gnucash/report/eguile-utilities.scm
@@ -30,7 +30,6 @@
 (use-modules (gnucash app-utils))
 (use-modules (gnucash core-utils))
 (gnc:module-load "gnucash/report" 0)
-(gnc:module-load "gnucash/app-utils" 0)
 
 (define-public (fmtnumber n)
   ;; Format a number (integer or real) into something printable
diff --git a/gnucash/report/report.scm b/gnucash/report/report.scm
index d986bb932..0d2641427 100644
--- a/gnucash/report/report.scm
+++ b/gnucash/report/report.scm
@@ -31,9 +31,9 @@
 (use-modules (srfi srfi-19))
 (use-modules (gnucash core-utils))
 (use-modules (gnucash engine))
+(use-modules (gnucash app-utils))
 
 (use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/app-utils" 0)
 (gnc:module-load "gnucash/html" 0)
 (gnc:module-load "gnucash/gnome-utils" 0)
 
diff --git a/gnucash/report/reports/standard/test/test-account-summary.scm b/gnucash/report/reports/standard/test/test-account-summary.scm
index 121624c30..9740fe40b 100644
--- a/gnucash/report/reports/standard/test/test-account-summary.scm
+++ b/gnucash/report/reports/standard/test/test-account-summary.scm
@@ -1,6 +1,5 @@
 (use-modules (gnucash engine))
-(use-modules (gnucash gnc-module))
-(gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
+(use-modules (gnucash app-utils))
 (use-modules (tests test-engine-extras))
 (use-modules (gnucash reports standard account-summary))
 (use-modules (gnucash report stylesheets plain))
diff --git a/gnucash/report/reports/standard/test/test-average-balance.scm b/gnucash/report/reports/standard/test/test-average-balance.scm
index bfab8be0b..d4c0312a2 100644
--- a/gnucash/report/reports/standard/test/test-average-balance.scm
+++ b/gnucash/report/reports/standard/test/test-average-balance.scm
@@ -1,5 +1,4 @@
 (use-modules (gnucash gnc-module))
-(gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
 (gnc:module-begin-syntax (gnc:module-load "gnucash/report" 0))
 (use-modules (tests test-engine-extras))
 (use-modules (gnucash reports example average-balance))
@@ -11,7 +10,7 @@
 (use-modules (srfi srfi-1))
 (use-modules (srfi srfi-64))
 (use-modules (gnucash engine))
-(use-modules (sw_engine))
+(use-modules (gnucash app-utils))
 
 ;; Explicitly set locale to make the report output predictable
 (setlocale LC_ALL "C")
diff --git a/gnucash/report/reports/standard/test/test-balsheet-pnl.scm b/gnucash/report/reports/standard/test/test-balsheet-pnl.scm
index c862d2ca3..8123831dc 100644
--- a/gnucash/report/reports/standard/test/test-balsheet-pnl.scm
+++ b/gnucash/report/reports/standard/test/test-balsheet-pnl.scm
@@ -1,6 +1,5 @@
 (use-modules (gnucash engine))
-(use-modules (gnucash gnc-module))
-(gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
+(use-modules (gnucash app-utils))
 (use-modules (tests test-engine-extras))
 (use-modules (gnucash reports standard balance-sheet))
 (use-modules (gnucash reports standard income-statement))
diff --git a/gnucash/report/reports/standard/test/test-cash-flow.scm b/gnucash/report/reports/standard/test/test-cash-flow.scm
index ef424add6..89b8398f8 100644
--- a/gnucash/report/reports/standard/test/test-cash-flow.scm
+++ b/gnucash/report/reports/standard/test/test-cash-flow.scm
@@ -1,8 +1,5 @@
 (use-modules (gnucash engine))
-(use-modules (gnucash gnc-module))
-
-(gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
-
+(use-modules (gnucash app-utils))
 (use-modules (tests test-engine-extras))
 (use-modules (gnucash reports standard cash-flow))
 (use-modules (gnucash report))
diff --git a/gnucash/report/reports/standard/test/test-cashflow-barchart.scm b/gnucash/report/reports/standard/test/test-cashflow-barchart.scm
index 26ad55235..13ccc6d77 100644
--- a/gnucash/report/reports/standard/test/test-cashflow-barchart.scm
+++ b/gnucash/report/reports/standard/test/test-cashflow-barchart.scm
@@ -18,12 +18,10 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (use-modules (gnucash gnc-module))
-
-(gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
 (gnc:module-load "gnucash/report" 0)
 
 (use-modules (gnucash engine))
-(use-modules (sw_engine))
+(use-modules (gnucash app-utils))
 (use-modules (tests test-engine-extras))
 (use-modules (tests srfi64-extras))
 (use-modules (gnucash report))
diff --git a/gnucash/report/reports/standard/test/test-charts.scm b/gnucash/report/reports/standard/test/test-charts.scm
index c82cda882..d4707a74b 100644
--- a/gnucash/report/reports/standard/test/test-charts.scm
+++ b/gnucash/report/reports/standard/test/test-charts.scm
@@ -1,6 +1,5 @@
 (use-modules (gnucash engine))
-(use-modules (gnucash gnc-module))
-(gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
+(use-modules (gnucash app-utils))
 (use-modules (tests test-engine-extras))
 (use-modules (gnucash reports standard category-barchart))
 (use-modules (gnucash reports standard net-charts))
diff --git a/gnucash/report/reports/standard/test/test-income-gst.scm b/gnucash/report/reports/standard/test/test-income-gst.scm
index 69b6a64c0..ff497dfc3 100644
--- a/gnucash/report/reports/standard/test/test-income-gst.scm
+++ b/gnucash/report/reports/standard/test/test-income-gst.scm
@@ -1,6 +1,5 @@
 (use-modules (gnucash engine))
-(use-modules (gnucash gnc-module))
-(gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
+(use-modules (gnucash app-utils))
 (use-modules (tests test-engine-extras))
 (use-modules (gnucash reports standard income-gst-statement))
 (use-modules (gnucash report stylesheets plain)) ; For the default stylesheet, required for rendering
diff --git a/gnucash/report/reports/standard/test/test-invoice.scm b/gnucash/report/reports/standard/test/test-invoice.scm
index 07e6e8d5c..b0c737c94 100644
--- a/gnucash/report/reports/standard/test/test-invoice.scm
+++ b/gnucash/report/reports/standard/test/test-invoice.scm
@@ -1,6 +1,5 @@
 (use-modules (gnucash engine))
-(use-modules (gnucash gnc-module))
-(gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
+(use-modules (gnucash app-utils))
 (use-modules (tests test-engine-extras))
 (use-modules (gnucash reports standard invoice))
 (use-modules (gnucash report stylesheets plain)) ; For the default stylesheet, required for rendering
diff --git a/gnucash/report/reports/standard/test/test-owner-report.scm b/gnucash/report/reports/standard/test/test-owner-report.scm
index aae287374..5c40a9c04 100644
--- a/gnucash/report/reports/standard/test/test-owner-report.scm
+++ b/gnucash/report/reports/standard/test/test-owner-report.scm
@@ -1,6 +1,5 @@
 (use-modules (gnucash engine))
-(use-modules (gnucash gnc-module))
-(gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
+(use-modules (gnucash app-utils))
 (use-modules (tests test-engine-extras))
 (use-modules (gnucash reports standard owner-report))
 (use-modules (gnucash reports standard job-report))
diff --git a/gnucash/report/reports/standard/test/test-portfolios.scm b/gnucash/report/reports/standard/test/test-portfolios.scm
index 219ef7225..aa0c1f1d1 100644
--- a/gnucash/report/reports/standard/test/test-portfolios.scm
+++ b/gnucash/report/reports/standard/test/test-portfolios.scm
@@ -1,6 +1,5 @@
 (use-modules (gnucash engine))
-(use-modules (gnucash gnc-module))
-(gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
+(use-modules (gnucash app-utils))
 (use-modules (tests test-engine-extras))
 (use-modules (gnucash reports standard portfolio))
 (use-modules (gnucash reports standard advanced-portfolio))
diff --git a/gnucash/report/reports/standard/test/test-stress-options.scm b/gnucash/report/reports/standard/test/test-stress-options.scm
index 8bd58fe45..5d9a92126 100644
--- a/gnucash/report/reports/standard/test/test-stress-options.scm
+++ b/gnucash/report/reports/standard/test/test-stress-options.scm
@@ -2,8 +2,7 @@
 (use-modules (ice-9 popen))
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
-(use-modules (gnucash gnc-module))
-(gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
+(use-modules (gnucash app-utils))
 (use-modules (tests test-engine-extras))
 (use-modules (gnucash reports standard view-column))
 (use-modules (gnucash report stylesheets plain)) ; For the default stylesheet, required for rendering
diff --git a/gnucash/report/reports/standard/test/test-transaction.scm b/gnucash/report/reports/standard/test/test-transaction.scm
index 34a8bd24f..a32a28012 100644
--- a/gnucash/report/reports/standard/test/test-transaction.scm
+++ b/gnucash/report/reports/standard/test/test-transaction.scm
@@ -1,6 +1,5 @@
 (use-modules (gnucash engine))
-(use-modules (gnucash gnc-module))
-(gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
+(use-modules (gnucash app-utils))
 (use-modules (tests test-engine-extras))
 (use-modules (gnucash reports standard transaction))
 (use-modules (gnucash reports standard reconcile-report))
diff --git a/gnucash/report/test/test-html-chart.scm b/gnucash/report/test/test-html-chart.scm
index cea724ee4..49839ce21 100644
--- a/gnucash/report/test/test-html-chart.scm
+++ b/gnucash/report/test/test-html-chart.scm
@@ -1,13 +1,12 @@
 (use-modules (gnucash gnc-module))
-
-(gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
 (gnc:module-begin-syntax (gnc:module-load "gnucash/report" 0))
 
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 (use-modules (srfi srfi-64))
 (use-modules (tests srfi64-extras))
 (use-modules (tests test-engine-extras))
 (use-modules (tests test-report-extras))
-(use-modules (gnucash report))
 
 (define (run-test)
   (test-runner-factory gnc:test-runner)
diff --git a/gnucash/report/test/test-html-utilities-srfi64.scm b/gnucash/report/test/test-html-utilities-srfi64.scm
index be8cb431f..a1788d34c 100644
--- a/gnucash/report/test/test-html-utilities-srfi64.scm
+++ b/gnucash/report/test/test-html-utilities-srfi64.scm
@@ -1,11 +1,10 @@
 (use-modules (gnucash gnc-module))
-
-(gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
 (gnc:module-begin-syntax (gnc:module-load "gnucash/report" 0))
 
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 (use-modules (tests test-engine-extras))
 (use-modules (tests test-report-extras))
-(use-modules (gnucash report))
 (use-modules (tests srfi64-extras))
 (use-modules (srfi srfi-64))
 
diff --git a/gnucash/report/test/test-report-html.scm b/gnucash/report/test/test-report-html.scm
index b7e6943fd..83143db21 100644
--- a/gnucash/report/test/test-report-html.scm
+++ b/gnucash/report/test/test-report-html.scm
@@ -1,15 +1,12 @@
-(use-modules (gnucash gnc-module))
-
-(gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
-
 (use-modules (gnucash engine))
-(use-modules (tests test-engine-extras))
+(use-modules (gnucash app-utils))
 (use-modules (gnucash report))
-(use-modules (tests test-report-extras))
 (use-modules (gnucash report stylesheets plain))
 (use-modules (srfi srfi-64))
 (use-modules (ice-9 pretty-print))
 (use-modules (sxml simple))
+(use-modules (tests test-engine-extras))
+(use-modules (tests test-report-extras))
 (use-modules (tests srfi64-extras))
 (use-modules (system vm coverage))
 
diff --git a/gnucash/report/test/test-report-utilities.scm b/gnucash/report/test/test-report-utilities.scm
index b9280a33c..cc3ad294e 100644
--- a/gnucash/report/test/test-report-utilities.scm
+++ b/gnucash/report/test/test-report-utilities.scm
@@ -1,14 +1,13 @@
 (use-modules (gnucash gnc-module))
-
-(gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
 (gnc:module-begin-syntax (gnc:module-load "gnucash/report" 0))
 
 (use-modules (gnucash engine))
+(use-modules (gnucash app-utils))
+(use-modules (gnucash report))
 (use-modules (srfi srfi-64))
 (use-modules (tests srfi64-extras))
 (use-modules (tests test-engine-extras))
 (use-modules (tests test-report-extras))
-(use-modules (gnucash report))
 
 (setlocale LC_ALL "C")
 
diff --git a/gnucash/report/test/test-report.scm b/gnucash/report/test/test-report.scm
index 481022214..d2d0efa4c 100644
--- a/gnucash/report/test/test-report.scm
+++ b/gnucash/report/test/test-report.scm
@@ -1,10 +1,7 @@
-(use-modules (gnucash gnc-module))
-
-(gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
-
-(use-modules (tests test-engine-extras))
+(use-modules (gnucash app-utils))
 (use-modules (gnucash report))
 (use-modules (srfi srfi-64))
+(use-modules (tests test-engine-extras))
 (use-modules (tests srfi64-extras))
 
 (define (run-test)
diff --git a/libgnucash/app-utils/app-utils.scm b/libgnucash/app-utils/app-utils.scm
index 068c31f2e..26aac63be 100644
--- a/libgnucash/app-utils/app-utils.scm
+++ b/libgnucash/app-utils/app-utils.scm
@@ -20,6 +20,11 @@
       (compile load eval expand)
       (load-extension "libgncmod-app-utils" "scm_init_sw_app_utils_module"))
 (use-modules (sw_app_utils))
+
+; Export the swig-wrapped symbols in the public interface of this module
+(let ((i (module-public-interface (current-module))))
+     (module-use! i (resolve-interface '(sw_app_utils))))
+
 (use-modules (srfi srfi-1))
 (use-modules (gnucash utilities))
 (use-modules (gnucash engine))
diff --git a/libgnucash/app-utils/test/test-date-utilities.scm b/libgnucash/app-utils/test/test-date-utilities.scm
index 760671b7b..71fa11e5e 100644
--- a/libgnucash/app-utils/test/test-date-utilities.scm
+++ b/libgnucash/app-utils/test/test-date-utilities.scm
@@ -1,6 +1,5 @@
 (use-modules (gnucash engine))
-(use-modules (gnucash gnc-module))
-(gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
+(use-modules (gnucash app-utils))
 (use-modules (tests test-engine-extras))
 (use-modules (srfi srfi-64))
 (use-modules (tests srfi64-extras))
diff --git a/libgnucash/app-utils/test/test-options.scm b/libgnucash/app-utils/test/test-options.scm
index 0ead090a9..27b970692 100644
--- a/libgnucash/app-utils/test/test-options.scm
+++ b/libgnucash/app-utils/test/test-options.scm
@@ -1,5 +1,4 @@
-(use-modules (gnucash gnc-module))
-(gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
+(use-modules (gnucash app-utils))
 (use-modules (srfi srfi-64))
 (use-modules (tests srfi64-extras))
 

commit 5a650ad566aecda6b93c80f37bf7da1414b9d16b
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Thu Nov 28 12:15:44 2019 +0100

    gnc-module - fix test build on Windows

diff --git a/libgnucash/gnc-module/test/test-dynload.c b/libgnucash/gnc-module/test/test-dynload.c
index 8732dacf5..d37751b20 100644
--- a/libgnucash/gnc-module/test/test-dynload.c
+++ b/libgnucash/gnc-module/test/test-dynload.c
@@ -26,6 +26,7 @@
 
 #include <config.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <gmodule.h>
 #include <unittest-support.h>
 

commit 63e89aecf7b95e4856834725682a30e06cd8ad07
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Thu Nov 21 18:18:33 2019 +0100

    gnc-module - fix incompatdep test
    
    The test passed but for the wrong reasons:
    as no GNC_MODULE_PATH was passed to the test
    it just didn't find the module. That's different
    from finding a module with the same name but
    a wrong sysver. This commit fixes that.

diff --git a/libgnucash/gnc-module/gnc-module.c b/libgnucash/gnc-module/gnc-module.c
index e4c164ed7..65f2d23fe 100644
--- a/libgnucash/gnc-module/gnc-module.c
+++ b/libgnucash/gnc-module/gnc-module.c
@@ -531,7 +531,7 @@ gnc_module_load_common(const char * module_name, gint iface, gboolean optional)
             if (!info->init_func(0))
             {
                 /* init failed. unload the module. */
-                g_warning ("Initialization failed for module %s\n", module_name);
+                g_warning ("Initialization failed for module %s", module_name);
                 g_hash_table_remove(loaded_modules, info);
                 g_free(info->filename);
                 g_free(info);
diff --git a/libgnucash/gnc-module/test/CMakeLists.txt b/libgnucash/gnc-module/test/CMakeLists.txt
index 2505e2b25..d9f029989 100644
--- a/libgnucash/gnc-module/test/CMakeLists.txt
+++ b/libgnucash/gnc-module/test/CMakeLists.txt
@@ -24,7 +24,8 @@ gnc_add_test(test-load-c
     test-load-c.c
     GNC_MODULE_TEST_INCLUDE_DIRS
     GNC_MODULE_TEST_LIBS
-    "GNC_MODULE_PATH=${LIBDIR_BUILD}/gnucash/test")
+    "GNC_MODULE_PATH=${LIBDIR_BUILD}/gnucash/test"
+)
 
 gnc_add_test(test-modsysver
     test-modsysver.c
@@ -36,6 +37,7 @@ gnc_add_test(test-incompatdep
     test-incompatdep.c
     GNC_MODULE_TEST_INCLUDE_DIRS
     GNC_MODULE_TEST_LIBS
+    "GNC_MODULE_PATH=${LIBDIR_BUILD}/gnucash/test"
 )
 gnc_add_test(test-agedver
     test-agedver.c
diff --git a/libgnucash/gnc-module/test/test-incompatdep.c b/libgnucash/gnc-module/test/test-incompatdep.c
index f558881f3..d45a78824 100644
--- a/libgnucash/gnc-module/test/test-incompatdep.c
+++ b/libgnucash/gnc-module/test/test-incompatdep.c
@@ -29,20 +29,20 @@ int
 main(int argc, char ** argv)
 {
     GNCModule foo;
-    gchar *msg = "Could not locate module gnucash/incompatdep interface v.0";
-    gchar *logdomain = "gnc.module";
-    guint loglevel = G_LOG_LEVEL_WARNING;
-    TestErrorStruct check = { loglevel, logdomain, msg };
-    test_add_error (&check);
-    g_log_set_handler (logdomain, loglevel,
-                       (GLogFunc)test_list_handler, NULL);
+    gchar *msg1 = "Could not locate module gnucash/ordinary interface v.25";
+    gchar *msg2 = "Initialization failed for module gnucash/incompatdep";
 
     g_test_message("  test-incompatdep.c:  loading a module with bad deps ...\n");
 
+    g_test_expect_message ("gnc.module", G_LOG_LEVEL_WARNING, msg1);
+    g_test_expect_message ("gnc.module", G_LOG_LEVEL_WARNING, msg2);
+
     gnc_module_system_init();
 
     foo = gnc_module_load("gnucash/incompatdep", 0);
 
+    g_test_assert_expected_messages();
+
     if (!foo)
     {
         printf("  ok\n");

commit 043c6367a5352f9be861eacd70ba2a8d0aac01df
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Thu Nov 21 16:55:17 2019 +0100

    gnc-module test updates
    
    - move test modules into a subdirectory on Windows as well
    - move the futuremod module into its own subdirectory
      to avoid its load warnings each time gnc_module_init is called
      That also tends to happen when building guile modules.
    - remove the log handlers filtering out the futuremodsys warnings
      They didn't match the actual warning signature anyway and
      they're no longer emitted during testing

diff --git a/bindings/guile/test/CMakeLists.txt b/bindings/guile/test/CMakeLists.txt
index 16c7c4900..5467de122 100644
--- a/bindings/guile/test/CMakeLists.txt
+++ b/bindings/guile/test/CMakeLists.txt
@@ -132,9 +132,6 @@ set (test_gnc_module_DEPENDS
     scm-mod-foo
     gncmod-bar
     scm-mod-baz
-    gncmod-agedver
-    gncmod-incompatdep
-    gncmod-futuremodsys
 )
 
 gnc_add_scheme_test_targets (test-gnc-modules-scm
diff --git a/bindings/guile/test/mod-bar/CMakeLists.txt b/bindings/guile/test/mod-bar/CMakeLists.txt
index 0912b23db..3b70c9f3e 100644
--- a/bindings/guile/test/mod-bar/CMakeLists.txt
+++ b/bindings/guile/test/mod-bar/CMakeLists.txt
@@ -29,7 +29,7 @@ gnc_add_scheme_test_targets(scm-mod-bar
 set_target_properties(bar gncmod-bar PROPERTIES
   LIBRARY_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
   ARCHIVE_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
-  RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
+  RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/test
   )
 
 set_dist_list(mod_bar_DIST CMakeLists.txt bar.c gnucash/bar.scm bar.h bar.i gnc-mod-bar.c)
diff --git a/bindings/guile/test/mod-baz/CMakeLists.txt b/bindings/guile/test/mod-baz/CMakeLists.txt
index d8b5231df..04ef81f9a 100644
--- a/bindings/guile/test/mod-baz/CMakeLists.txt
+++ b/bindings/guile/test/mod-baz/CMakeLists.txt
@@ -35,6 +35,6 @@ gnc_add_scheme_test_targets(scm-mod-baz
 set_target_properties(baz gncmod-baz PROPERTIES
 LIBRARY_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
 ARCHIVE_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
-RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/test)
 
 set_dist_list(mod_baz_DIST CMakeLists.txt baz.c gnucash/baz.scm baz.h baz.i gnc-mod-baz.c)
diff --git a/bindings/guile/test/mod-foo/CMakeLists.txt b/bindings/guile/test/mod-foo/CMakeLists.txt
index 583115770..6de0b79d9 100644
--- a/bindings/guile/test/mod-foo/CMakeLists.txt
+++ b/bindings/guile/test/mod-foo/CMakeLists.txt
@@ -29,6 +29,6 @@ gnc_add_scheme_test_targets(scm-mod-foo
 set_target_properties(foo gncmod-foo PROPERTIES
 LIBRARY_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
 ARCHIVE_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
-RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/test)
 
 set_dist_list(mod_foo_DIST CMakeLists.txt foo.i gnucash/foo.scm foo.c foo.h gnc-mod-foo.c)
diff --git a/bindings/guile/test/test-gnc-module-load-deps.scm b/bindings/guile/test/test-gnc-module-load-deps.scm
index c8f570382..16a55ced0 100755
--- a/bindings/guile/test/test-gnc-module-load-deps.scm
+++ b/bindings/guile/test/test-gnc-module-load-deps.scm
@@ -1,12 +1,3 @@
-(use-modules (tests unittest-support))
-(define log-domain "gnc.module")
-(define check (new-TestErrorStruct))
-(define log-level (G-LOG-LEVEL-WARNING))
-(define msg "Module '../../../libgnucash/gnc-module/test/misc-mods/.libs/libgncmod_futuremodsys.so' requires newer module system\n")
-(TestErrorStruct-log-domain-set check log-domain)
-(TestErrorStruct-log-level-set check log-level)
-(TestErrorStruct-msg-set check msg)
-(define handler (test-set-checked-handler log-domain log-level check))
 (use-modules (gnucash gnc-module))
 
 (gnc:module-system-init)
@@ -17,6 +8,4 @@
 (baz:scheme-hello)
 (foo:scheme-hello)
 
-(g-log-remove-handler log-domain handler)
-
 (exit 0)
diff --git a/bindings/guile/test/test-gnc-module-load-scm.scm b/bindings/guile/test/test-gnc-module-load-scm.scm
index 46a8385b2..37443f081 100755
--- a/bindings/guile/test/test-gnc-module-load-scm.scm
+++ b/bindings/guile/test/test-gnc-module-load-scm.scm
@@ -1,14 +1,6 @@
-(use-modules (tests unittest-support))
-(define log-domain "gnc.module")
-(define check (new-TestErrorStruct))
-(define log-level (G-LOG-LEVEL-WARNING))
-(define msg "Module '../../../libgnucash/gnc-module/test/misc-mods/.libs/libgncmod_futuremodsys.so' requires newer module system\n")
-(TestErrorStruct-log-domain-set check log-domain)
-(TestErrorStruct-log-level-set check log-level)
-(TestErrorStruct-msg-set check msg)
-(define handler (test-set-checked-handler log-domain log-level check))
 (use-modules (gnucash gnc-module))
+
 (gnc:module-system-init)
 (gnc:module-load "gnucash/foo" 0)
-(g-log-remove-handler log-domain handler)
+
 (exit 0)
diff --git a/bindings/guile/test/test-gnc-module-scm-init.scm b/bindings/guile/test/test-gnc-module-scm-init.scm
index b66bdbcb7..7a6685ac8 100755
--- a/bindings/guile/test/test-gnc-module-scm-init.scm
+++ b/bindings/guile/test/test-gnc-module-scm-init.scm
@@ -1,15 +1,5 @@
-(use-modules (tests unittest-support))
-(define log-domain "gnc.module")
-(define check (new-TestErrorStruct))
-(define log-level (G-LOG-LEVEL-WARNING))
-(define msg "Module '../../../libgnucash/gnc-module/test/misc-mods/.libs/libgncmod_futuremodsys.so' requires newer module system\n")
-(TestErrorStruct-log-domain-set check log-domain)
-(TestErrorStruct-log-level-set check log-level)
-(TestErrorStruct-msg-set check msg)
-(define handler (test-set-checked-handler log-domain log-level check))
-
 (use-modules (gnucash gnc-module))
+
 (gnc:module-system-init)
 
-(g-log-remove-handler log-domain handler)
 (exit 0)
diff --git a/bindings/guile/test/test-gnc-module-scm-module.scm b/bindings/guile/test/test-gnc-module-scm-module.scm
index 689bb7c2c..47e7dc430 100755
--- a/bindings/guile/test/test-gnc-module-scm-module.scm
+++ b/bindings/guile/test/test-gnc-module-scm-module.scm
@@ -1,14 +1,6 @@
-(use-modules (tests unittest-support))
-(define log-domain "gnc.module")
-(define check (new-TestErrorStruct))
-(define log-level (G-LOG-LEVEL-WARNING))
-(define msg "Module '../../../libgnucash/gnc-module/test/misc-mods/.libs/libgncmod_futuremodsys.so' requires newer module system\n")
-(TestErrorStruct-log-domain-set check log-domain)
-(TestErrorStruct-log-level-set check log-level)
-(TestErrorStruct-msg-set check msg)
-(define handler (test-set-checked-handler log-domain log-level check))
 (use-modules (gnucash gnc-module))
+
 (gnc:module-system-init)
 (if (not (gnc:module-load "gnucash/foo" 0)) (exit -1))
+
 (exit (foo:scheme-hello))
-(g-log-remove-handler log-domain handler)
diff --git a/bindings/guile/test/test-gnc-module-scm-multi.scm b/bindings/guile/test/test-gnc-module-scm-multi.scm
index 126c44409..edebd9bec 100755
--- a/bindings/guile/test/test-gnc-module-scm-multi.scm
+++ b/bindings/guile/test/test-gnc-module-scm-multi.scm
@@ -1,23 +1,14 @@
-(use-modules (tests unittest-support))
-(define log-domain "gnc.module")
-(define check (new-TestErrorStruct))
-(define log-level (G-LOG-LEVEL-WARNING))
-(define msg "Module '../../../libgnucash/gnc-module/test/misc-mods/.libs/libgncmod_futuremodsys.so' requires newer module system\n")
-(TestErrorStruct-log-domain-set check log-domain)
-(TestErrorStruct-log-level-set check log-level)
-(TestErrorStruct-msg-set check msg)
-(define handler (test-set-checked-handler log-domain log-level check))
-
 (use-modules (gnucash gnc-module))
+
 (gnc:module-system-init)
 (gnc:module-load "gnucash/foo" 0)
 (foo-hello)
 (foo:scheme-hello)
+
 (gnc:module-load "gnucash/bar" 0)
 (foo-hello)
 (foo:scheme-hello)
 (bar-hello)
 (bar:scheme-hello)
 
-(g-log-remove-handler log-domain handler)
 (exit 0)
diff --git a/bindings/guile/test/test-gnc-module-swigged-c.scm b/bindings/guile/test/test-gnc-module-swigged-c.scm
index 89c5216da..a74e68ff3 100755
--- a/bindings/guile/test/test-gnc-module-swigged-c.scm
+++ b/bindings/guile/test/test-gnc-module-swigged-c.scm
@@ -1,14 +1,5 @@
-(use-modules (tests unittest-support))
-(define log-domain "gnc.module")
-(define check (new-TestErrorStruct))
-(define log-level (G-LOG-LEVEL-WARNING))
-(define msg "Module '../../../libgnucash/gnc-module/test/misc-mods/.libs/libgncmod_futuremodsys.so' requires newer module system\n")
-(TestErrorStruct-log-domain-set check log-domain)
-(TestErrorStruct-log-level-set check log-level)
-(TestErrorStruct-msg-set check msg)
-(define handler (test-set-checked-handler log-domain log-level check))
 (use-modules (gnucash gnc-module))
+
 (gnc:module-system-init)
 (gnc:module-load "gnucash/foo" 0)
 (exit (eq? 10 (foo-hello)))
-(g-log-remove-handler log-domain handler)
diff --git a/libgnucash/gnc-module/test/CMakeLists.txt b/libgnucash/gnc-module/test/CMakeLists.txt
index 80edc7303..2505e2b25 100644
--- a/libgnucash/gnc-module/test/CMakeLists.txt
+++ b/libgnucash/gnc-module/test/CMakeLists.txt
@@ -30,6 +30,7 @@ gnc_add_test(test-modsysver
     test-modsysver.c
     GNC_MODULE_TEST_INCLUDE_DIRS
     GNC_MODULE_TEST_LIBS
+    "GNC_MODULE_PATH=${LIBDIR_BUILD}/gnucash/test/future"
 )
 gnc_add_test(test-incompatdep
     test-incompatdep.c
diff --git a/libgnucash/gnc-module/test/misc-mods/CMakeLists.txt b/libgnucash/gnc-module/test/misc-mods/CMakeLists.txt
index b3cf730ac..7412ffe14 100644
--- a/libgnucash/gnc-module/test/misc-mods/CMakeLists.txt
+++ b/libgnucash/gnc-module/test/misc-mods/CMakeLists.txt
@@ -13,9 +13,14 @@ target_link_libraries(gncmod-futuremodsys ${GLIB2_LDFLAGS})
 add_library(gncmod-incompatdep  EXCLUDE_FROM_ALL incompatdep.c)
 target_link_libraries(gncmod-incompatdep gnc-module ${GLIB2_LDFLAGS})
 
-set_target_properties(gncmod-agedver gncmod-futuremodsys gncmod-incompatdep PROPERTIES
+set_target_properties(gncmod-agedver gncmod-incompatdep PROPERTIES
 LIBRARY_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
 ARCHIVE_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
-RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/test)
+
+set_target_properties(gncmod-futuremodsys PROPERTIES
+LIBRARY_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test/future
+ARCHIVE_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test/future
+RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/test/future)
 
 set_dist_list(misc_mods_DIST CMakeLists.txt agedver.c futuremodsys.c incompatdep.c)
diff --git a/libgnucash/gnc-module/test/mod-ordinary/CMakeLists.txt b/libgnucash/gnc-module/test/mod-ordinary/CMakeLists.txt
index a3d754421..bd939eb7c 100644
--- a/libgnucash/gnc-module/test/mod-ordinary/CMakeLists.txt
+++ b/libgnucash/gnc-module/test/mod-ordinary/CMakeLists.txt
@@ -16,6 +16,6 @@ target_include_directories(gncmod-ordinary PRIVATE
 set_target_properties(ordinary gncmod-ordinary PROPERTIES
 LIBRARY_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
 ARCHIVE_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
-RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/test)
 
 set_dist_list(mod_ordinary_DIST CMakeLists.txt ordinary.c ordinary.h gnc-mod-ordinary.c)
diff --git a/libgnucash/gnc-module/test/mod-withdep/CMakeLists.txt b/libgnucash/gnc-module/test/mod-withdep/CMakeLists.txt
index 756719045..514a68112 100644
--- a/libgnucash/gnc-module/test/mod-withdep/CMakeLists.txt
+++ b/libgnucash/gnc-module/test/mod-withdep/CMakeLists.txt
@@ -22,6 +22,6 @@ target_include_directories(gncmod-withdep PRIVATE
 set_target_properties(withdep gncmod-withdep PROPERTIES
 LIBRARY_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
 ARCHIVE_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
-RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/test)
 
 set_dist_list(mod_withdep_DIST CMakeLists.txt withdep.c withdep.h gnc-mod-withdep.c)
diff --git a/libgnucash/gnc-module/test/test-agedver.c b/libgnucash/gnc-module/test/test-agedver.c
index 51a4f611f..60d0bb993 100644
--- a/libgnucash/gnc-module/test/test-agedver.c
+++ b/libgnucash/gnc-module/test/test-agedver.c
@@ -29,12 +29,6 @@ int
 main(int argc, char ** argv)
 {
     GNCModule testmod;
-    gchar *msg = "Module '../../../libgnucash/gnc-module/test/misc-mods/.libs/libgncmod_futuremodsys.so' requires newer module system\n";
-    gchar *logdomain = "gnc.module";
-    guint loglevel = G_LOG_LEVEL_WARNING;
-    TestErrorStruct check = { loglevel, logdomain, msg };
-    g_log_set_handler (logdomain, loglevel,
-                       (GLogFunc)test_checked_handler, &check);
     g_test_message("  test-agedver.c:  asking for an old but supported interface ...");
 
     gnc_module_system_init();
diff --git a/libgnucash/gnc-module/test/test-dynload.c b/libgnucash/gnc-module/test/test-dynload.c
index 99bbe7d53..8732dacf5 100644
--- a/libgnucash/gnc-module/test/test-dynload.c
+++ b/libgnucash/gnc-module/test/test-dynload.c
@@ -35,14 +35,8 @@ int
 main(int argc, char ** argv)
 {
     GModule *gmodule;
-    gchar *msg = "Module '../../../libgnucash/gnc-module/test/misc-mods/.libs/libgncmod_futuremodsys.so' requires newer module system\n";
-    gchar *logdomain = "gnc.module";
     gchar *modpath;
-    guint loglevel = G_LOG_LEVEL_WARNING;
     const char *libdir = g_getenv("LIBDIR");
-    TestErrorStruct check = { loglevel, logdomain, msg };
-    g_log_set_handler (logdomain, loglevel,
-                       (GLogFunc)test_checked_handler, &check);
 
     if (libdir == NULL)
     {
diff --git a/libgnucash/gnc-module/test/test-incompatdep.c b/libgnucash/gnc-module/test/test-incompatdep.c
index fd5a8e24a..f558881f3 100644
--- a/libgnucash/gnc-module/test/test-incompatdep.c
+++ b/libgnucash/gnc-module/test/test-incompatdep.c
@@ -29,14 +29,11 @@ int
 main(int argc, char ** argv)
 {
     GNCModule foo;
-    gchar *msg1 = "Module '../../../libgnucash/gnc-module/test/misc-mods/.libs/libgncmod_futuremodsys.so' requires newer module system\n";
-    gchar *msg2 = "Could not locate module gnucash/incompatdep interface v.0";
+    gchar *msg = "Could not locate module gnucash/incompatdep interface v.0";
     gchar *logdomain = "gnc.module";
     guint loglevel = G_LOG_LEVEL_WARNING;
-    TestErrorStruct check1 = { loglevel, logdomain, msg1 };
-    TestErrorStruct check2 = { loglevel, logdomain, msg2 };
-    test_add_error (&check1);
-    test_add_error (&check2);
+    TestErrorStruct check = { loglevel, logdomain, msg };
+    test_add_error (&check);
     g_log_set_handler (logdomain, loglevel,
                        (GLogFunc)test_list_handler, NULL);
 
diff --git a/libgnucash/gnc-module/test/test-load-c.c b/libgnucash/gnc-module/test/test-load-c.c
index b7026714a..295ca74af 100644
--- a/libgnucash/gnc-module/test/test-load-c.c
+++ b/libgnucash/gnc-module/test/test-load-c.c
@@ -32,12 +32,6 @@ main(int argc, char ** argv)
 {
     gint retval = 0;
     GNCModule testmod;
-    gchar *msg = "Module '../../../libgnucash/gnc-module/test/misc-mods/.libs/libgncmod-futuremodsys.so' requires newer module system\n";
-    gchar *logdomain = "gnc.module";
-    guint loglevel = G_LOG_LEVEL_WARNING;
-    TestErrorStruct check = { loglevel, logdomain, msg };
-    g_log_set_handler (logdomain, loglevel,
-                       (GLogFunc)test_checked_handler, &check);
 
     gnc_module_system_init();
 

commit 8aed43ec55568cc157296c4d844e38a4353fa099
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Wed Nov 20 18:54:26 2019 +0100

    gnc-module - drop redundant extra_dist specificiation
    
    There was only the README left in this list and that was already in
    the local dist list by itself

diff --git a/libgnucash/gnc-module/test/CMakeLists.txt b/libgnucash/gnc-module/test/CMakeLists.txt
index 64b677eba..80edc7303 100644
--- a/libgnucash/gnc-module/test/CMakeLists.txt
+++ b/libgnucash/gnc-module/test/CMakeLists.txt
@@ -62,11 +62,7 @@ set(test_gnc_module_SOURCE_DIST
   test-modsysver.c
 )
 
-set(test_gnc_module_EXTRA_DIST
-  README
-)
-
-set_local_dist(test_gnc_module_DIST_local CMakeLists.txt README ${test_gnc_module_SOURCE_DIST} ${test_gnc_module_EXTRA_DIST})
+set_local_dist(test_gnc_module_DIST_local CMakeLists.txt README ${test_gnc_module_SOURCE_DIST})
 
 set(test_gnc_module_DIST ${test_gnc_module_DIST_local} ${misc_mods_DIST}
                          ${mod_ordinary_DIST} ${mod_withdep_DIST} PARENT_SCOPE)

commit 2c6166211348e6954470eba36a5171880868b524
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Wed Nov 20 18:52:54 2019 +0100

    gnc-module - remove guile traces from c-interface tests and examples
    
    None of them still depend on guile.

diff --git a/libgnucash/gnc-module/example/gncmod-example.c b/libgnucash/gnc-module/example/gncmod-example.c
index 94e204bcc..7d1e55599 100644
--- a/libgnucash/gnc-module/example/gncmod-example.c
+++ b/libgnucash/gnc-module/example/gncmod-example.c
@@ -31,7 +31,6 @@
 #include <gmodule.h>
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
-#include <libguile.h>
 
 #include "gnc-hooks.h"
 #include "gnc-module.h"
@@ -66,12 +65,6 @@ libgncmod_example_gnc_module_description (void)
 int
 libgncmod_example_gnc_module_init (int refcount)
 {
-    if (!gnc_module_load ("gnucash/app-utils", 0)) {
-        return FALSE;
-    }
-    if (!gnc_module_load ("gnucash/gnome-utils", 0)) {
-        return FALSE;
-    }
     if (!gnc_module_load ("gnucash/engine", 0)) {
         return FALSE;
     }
diff --git a/libgnucash/gnc-module/test/CMakeLists.txt b/libgnucash/gnc-module/test/CMakeLists.txt
index f373f3951..64b677eba 100644
--- a/libgnucash/gnc-module/test/CMakeLists.txt
+++ b/libgnucash/gnc-module/test/CMakeLists.txt
@@ -8,15 +8,11 @@ set(GNC_MODULE_TEST_INCLUDE_DIRS
   ${CMAKE_SOURCE_DIR}/libgnucash/gnc-module
   ${CMAKE_SOURCE_DIR}/common/test-core
   ${GLIB2_INCLUDE_DIRS}
-  ${GUILE_INCLUDE_DIRS}
 )
 
 set(GNC_MODULE_TEST_LIBS
   gnc-module
   test-core
-  gncmod-foo
-  gncmod-bar
-  gncmod-baz
   gncmod-agedver
   gncmod-futuremodsys
   gncmod-incompatdep
@@ -24,26 +20,38 @@ set(GNC_MODULE_TEST_LIBS
   gncmod-withdep
   )
 
-gnc_add_test_with_guile(test-load-c test-load-c.c GNC_MODULE_TEST_INCLUDE_DIRS GNC_MODULE_TEST_LIBS "GNC_MODULE_PATH=${LIBDIR_BUILD}/gnucash/test")
+gnc_add_test(test-load-c
+    test-load-c.c
+    GNC_MODULE_TEST_INCLUDE_DIRS
+    GNC_MODULE_TEST_LIBS
+    "GNC_MODULE_PATH=${LIBDIR_BUILD}/gnucash/test")
 
-gnc_add_test_with_guile(test-modsysver test-modsysver.c
-  GNC_MODULE_TEST_INCLUDE_DIRS GNC_MODULE_TEST_LIBS
+gnc_add_test(test-modsysver
+    test-modsysver.c
+    GNC_MODULE_TEST_INCLUDE_DIRS
+    GNC_MODULE_TEST_LIBS
 )
-gnc_add_test_with_guile(test-incompatdep test-incompatdep.c
-  GNC_MODULE_TEST_INCLUDE_DIRS GNC_MODULE_TEST_LIBS
+gnc_add_test(test-incompatdep
+    test-incompatdep.c
+    GNC_MODULE_TEST_INCLUDE_DIRS
+    GNC_MODULE_TEST_LIBS
 )
-gnc_add_test_with_guile(test-agedver test-agedver.c
-  GNC_MODULE_TEST_INCLUDE_DIRS GNC_MODULE_TEST_LIBS
-  "GNC_MODULE_PATH=${LIBDIR_BUILD}/gnucash/test"
+gnc_add_test(test-agedver
+    test-agedver.c
+    GNC_MODULE_TEST_INCLUDE_DIRS
+    GNC_MODULE_TEST_LIBS
+    "GNC_MODULE_PATH=${LIBDIR_BUILD}/gnucash/test"
   )
 
 set(_LIBDIR ${LIBDIR_BUILD})
 if (WIN32)
   set(_LIBDIR ${CMAKE_BINARY_DIR}/bin)
 endif()
-gnc_add_test(test-dynload test-dynload.c
-  GNC_MODULE_TEST_INCLUDE_DIRS GNC_MODULE_TEST_LIBS
-  LIBDIR=${_LIBDIR}
+gnc_add_test(test-dynload
+    test-dynload.c
+    GNC_MODULE_TEST_INCLUDE_DIRS
+    GNC_MODULE_TEST_LIBS
+    LIBDIR=${_LIBDIR}
 )
 
 set(test_gnc_module_SOURCE_DIST
diff --git a/libgnucash/gnc-module/test/mod-ordinary/gnc-mod-ordinary.c b/libgnucash/gnc-module/test/mod-ordinary/gnc-mod-ordinary.c
index 81752e99e..1ae7d21d3 100644
--- a/libgnucash/gnc-module/test/mod-ordinary/gnc-mod-ordinary.c
+++ b/libgnucash/gnc-module/test/mod-ordinary/gnc-mod-ordinary.c
@@ -24,7 +24,6 @@
 #include <config.h>
 #include <stdio.h>
 #include <gmodule.h>
-#include <libguile.h>
 
 #include "gnc-module-api.h"
 
diff --git a/libgnucash/gnc-module/test/mod-withdep/gnc-mod-withdep.c b/libgnucash/gnc-module/test/mod-withdep/gnc-mod-withdep.c
index 6c6135304..f32cd6e42 100644
--- a/libgnucash/gnc-module/test/mod-withdep/gnc-mod-withdep.c
+++ b/libgnucash/gnc-module/test/mod-withdep/gnc-mod-withdep.c
@@ -24,7 +24,6 @@
 #include <config.h>
 #include <stdio.h>
 #include <gmodule.h>
-#include <libguile.h>
 
 #include "gnc-module.h"
 #include "gnc-module-api.h"
diff --git a/libgnucash/gnc-module/test/test-agedver.c b/libgnucash/gnc-module/test/test-agedver.c
index bdba0a074..51a4f611f 100644
--- a/libgnucash/gnc-module/test/test-agedver.c
+++ b/libgnucash/gnc-module/test/test-agedver.c
@@ -21,15 +21,14 @@
 #include <config.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <libguile.h>
 
 #include "gnc-module.h"
 #include <unittest-support.h>
 
-static void
-guile_main(void *closure, int argc, char ** argv)
+int
+main(int argc, char ** argv)
 {
-    GNCModule foo;
+    GNCModule testmod;
     gchar *msg = "Module '../../../libgnucash/gnc-module/test/misc-mods/.libs/libgncmod_futuremodsys.so' requires newer module system\n";
     gchar *logdomain = "gnc.module";
     guint loglevel = G_LOG_LEVEL_WARNING;
@@ -40,9 +39,9 @@ guile_main(void *closure, int argc, char ** argv)
 
     gnc_module_system_init();
 
-    foo = gnc_module_load("gnucash/agedver", 5);
+    testmod = gnc_module_load("gnucash/agedver", 5);
 
-    if (foo)
+    if (testmod)
     {
         printf("  ok\n");
         exit(0);
@@ -53,10 +52,3 @@ guile_main(void *closure, int argc, char ** argv)
         exit(-1);
     }
 }
-
-int
-main(int argc, char ** argv)
-{
-    scm_boot_guile(argc, argv, guile_main, NULL);
-    return 0;
-}
diff --git a/libgnucash/gnc-module/test/test-dynload.c b/libgnucash/gnc-module/test/test-dynload.c
index 34933ccb5..99bbe7d53 100644
--- a/libgnucash/gnc-module/test/test-dynload.c
+++ b/libgnucash/gnc-module/test/test-dynload.c
@@ -27,13 +27,12 @@
 #include <config.h>
 #include <stdio.h>
 #include <gmodule.h>
-#include <libguile.h>
 #include <unittest-support.h>
 
 #include "gnc-module.h"
 
-static void
-guile_main(void *closure, int argc, char ** argv)
+int
+main(int argc, char ** argv)
 {
     GModule *gmodule;
     gchar *msg = "Module '../../../libgnucash/gnc-module/test/misc-mods/.libs/libgncmod_futuremodsys.so' requires newer module system\n";
@@ -102,11 +101,3 @@ guile_main(void *closure, int argc, char ** argv)
         exit(-1);
     }
 }
-
-int
-main(int argc, char ** argv)
-{
-    scm_boot_guile(argc, argv, guile_main, NULL);
-    return 0;
-}
-
diff --git a/libgnucash/gnc-module/test/test-incompatdep.c b/libgnucash/gnc-module/test/test-incompatdep.c
index 96c873b27..fd5a8e24a 100644
--- a/libgnucash/gnc-module/test/test-incompatdep.c
+++ b/libgnucash/gnc-module/test/test-incompatdep.c
@@ -21,13 +21,12 @@
 #include <config.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <libguile.h>
 #include <unittest-support.h>
 
 #include "gnc-module.h"
 
-static void
-guile_main(void *closure, int argc, char ** argv)
+int
+main(int argc, char ** argv)
 {
     GNCModule foo;
     gchar *msg1 = "Module '../../../libgnucash/gnc-module/test/misc-mods/.libs/libgncmod_futuremodsys.so' requires newer module system\n";
@@ -58,10 +57,3 @@ guile_main(void *closure, int argc, char ** argv)
         exit(-1);
     }
 }
-
-int
-main(int argc, char ** argv)
-{
-    scm_boot_guile(argc, argv, guile_main, NULL);
-    return 0;
-}
diff --git a/libgnucash/gnc-module/test/test-modsysver.c b/libgnucash/gnc-module/test/test-modsysver.c
index a27618258..f1208b977 100644
--- a/libgnucash/gnc-module/test/test-modsysver.c
+++ b/libgnucash/gnc-module/test/test-modsysver.c
@@ -21,13 +21,13 @@
 #include <config.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <libguile.h>
 #include <unittest-support.h>
 
 #include "gnc-module.h"
 
-static void
-guile_main(void *closure, int argc, char ** argv)
+
+int
+main(int argc, char ** argv)
 {
     GNCModule foo;
     gchar *msg1 = "Module '../../../libgnucash/gnc-module/test/misc-mods/.libs/libgncmod_futuremodsys.so' requires newer module system\n";
@@ -59,10 +59,3 @@ guile_main(void *closure, int argc, char ** argv)
     }
     test_clear_error_list ();
 }
-
-int
-main(int argc, char ** argv)
-{
-    scm_boot_guile(argc, argv, guile_main, NULL);
-    return 0;
-}

commit 331039cdcc093b753921c04f2ad3611f3447a3ed
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Wed Nov 20 18:19:13 2019 +0100

    gnc-module - expand c-interface load test and make it guile independent

diff --git a/libgnucash/gnc-module/test/CMakeLists.txt b/libgnucash/gnc-module/test/CMakeLists.txt
index 5c359b236..f373f3951 100644
--- a/libgnucash/gnc-module/test/CMakeLists.txt
+++ b/libgnucash/gnc-module/test/CMakeLists.txt
@@ -1,5 +1,7 @@
 
 add_subdirectory(misc-mods)
+add_subdirectory(mod-ordinary)
+add_subdirectory(mod-withdep)
 
 set(GNC_MODULE_TEST_INCLUDE_DIRS
   ${CMAKE_BINARY_DIR}/common # for config.h
@@ -18,7 +20,8 @@ set(GNC_MODULE_TEST_LIBS
   gncmod-agedver
   gncmod-futuremodsys
   gncmod-incompatdep
-  gncmod-ordinarymod
+  gncmod-ordinary
+  gncmod-withdep
   )
 
 gnc_add_test_with_guile(test-load-c test-load-c.c GNC_MODULE_TEST_INCLUDE_DIRS GNC_MODULE_TEST_LIBS "GNC_MODULE_PATH=${LIBDIR_BUILD}/gnucash/test")
@@ -58,4 +61,4 @@ set(test_gnc_module_EXTRA_DIST
 set_local_dist(test_gnc_module_DIST_local CMakeLists.txt README ${test_gnc_module_SOURCE_DIST} ${test_gnc_module_EXTRA_DIST})
 
 set(test_gnc_module_DIST ${test_gnc_module_DIST_local} ${misc_mods_DIST}
-                         ${mod_bar_DIST} ${mod_baz_DIST} ${mod_foo_DIST} PARENT_SCOPE)
+                         ${mod_ordinary_DIST} ${mod_withdep_DIST} PARENT_SCOPE)
diff --git a/libgnucash/gnc-module/test/misc-mods/CMakeLists.txt b/libgnucash/gnc-module/test/misc-mods/CMakeLists.txt
index c7945322c..b3cf730ac 100644
--- a/libgnucash/gnc-module/test/misc-mods/CMakeLists.txt
+++ b/libgnucash/gnc-module/test/misc-mods/CMakeLists.txt
@@ -13,12 +13,9 @@ target_link_libraries(gncmod-futuremodsys ${GLIB2_LDFLAGS})
 add_library(gncmod-incompatdep  EXCLUDE_FROM_ALL incompatdep.c)
 target_link_libraries(gncmod-incompatdep gnc-module ${GLIB2_LDFLAGS})
 
-add_library(gncmod-ordinarymod  EXCLUDE_FROM_ALL ordinarymod.c)
-target_link_libraries(gncmod-ordinarymod gnc-module ${GLIB2_LDFLAGS})
-
-set_target_properties(gncmod-agedver gncmod-futuremodsys gncmod-incompatdep gncmod-ordinarymod PROPERTIES
+set_target_properties(gncmod-agedver gncmod-futuremodsys gncmod-incompatdep PROPERTIES
 LIBRARY_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
 ARCHIVE_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
 RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
 
-set_dist_list(misc_mods_DIST CMakeLists.txt agedver.c futuremodsys.c incompatdep.c ordinarymod.c)
+set_dist_list(misc_mods_DIST CMakeLists.txt agedver.c futuremodsys.c incompatdep.c)
diff --git a/libgnucash/gnc-module/test/misc-mods/incompatdep.c b/libgnucash/gnc-module/test/misc-mods/incompatdep.c
index 0b7b97c7a..116384539 100644
--- a/libgnucash/gnc-module/test/misc-mods/incompatdep.c
+++ b/libgnucash/gnc-module/test/misc-mods/incompatdep.c
@@ -51,7 +51,7 @@ libgncmod_incompatdep_gnc_module_description(void)
 int
 libgncmod_incompatdep_gnc_module_init(int refcount)
 {
-    if (gnc_module_load("gnucash/ordinarymod", 25))
+    if (gnc_module_load("gnucash/ordinary", 25))
     {
         return TRUE;
     }
diff --git a/libgnucash/gnc-module/test/mod-ordinary/CMakeLists.txt b/libgnucash/gnc-module/test/mod-ordinary/CMakeLists.txt
new file mode 100644
index 000000000..a3d754421
--- /dev/null
+++ b/libgnucash/gnc-module/test/mod-ordinary/CMakeLists.txt
@@ -0,0 +1,21 @@
+
+add_library(ordinary EXCLUDE_FROM_ALL ordinary.c ordinary.h)
+add_library(gncmod-ordinary EXCLUDE_FROM_ALL gnc-mod-ordinary.c)
+
+target_link_libraries(gncmod-ordinary ordinary gnc-module)
+target_include_directories(gncmod-ordinary PRIVATE
+  ${CMAKE_BINARY_DIR}/common
+  ${CMAKE_CURRENT_SOURCE_DIR}
+  ${CMAKE_CURRENT_BINARY_DIR}
+  ${CMAKE_SOURCE_DIR}/common
+  ${CMAKE_SOURCE_DIR}/libgnucash/gnc-module
+  ${GLIB2_INCLUDE_DIRS}
+  ${GUILE_INCLUDE_DIRS}
+)
+
+set_target_properties(ordinary gncmod-ordinary PROPERTIES
+LIBRARY_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
+ARCHIVE_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
+RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+
+set_dist_list(mod_ordinary_DIST CMakeLists.txt ordinary.c ordinary.h gnc-mod-ordinary.c)
diff --git a/libgnucash/gnc-module/test/misc-mods/ordinarymod.c b/libgnucash/gnc-module/test/mod-ordinary/gnc-mod-ordinary.c
similarity index 69%
copy from libgnucash/gnc-module/test/misc-mods/ordinarymod.c
copy to libgnucash/gnc-module/test/mod-ordinary/gnc-mod-ordinary.c
index fe34fe16b..81752e99e 100644
--- a/libgnucash/gnc-module/test/misc-mods/ordinarymod.c
+++ b/libgnucash/gnc-module/test/mod-ordinary/gnc-mod-ordinary.c
@@ -1,4 +1,5 @@
-/* ordinarymod.c : ordinary module */
+/* gnc-mod-ordinary.c : the Gnucash plugin that wraps the library
+ * 'libordinary.so'. it does this by being linked against libordinary.so */
 /********************************************************************\
  * This program is free software; you can redistribute it and/or    *
  * modify it under the terms of the GNU General Public License as   *
@@ -20,40 +21,35 @@
 \********************************************************************/
 
 
+#include <config.h>
 #include <stdio.h>
 #include <gmodule.h>
+#include <libguile.h>
 
-#include "gnc-module.h"
 #include "gnc-module-api.h"
 
-GNC_MODULE_API_DECL(libgncmod_ordinarymod)
+GNC_MODULE_API_DECL(libgncmod_ordinary)
 
-int libgncmod_ordinarymod_gnc_module_system_interface = 0;
+int libgncmod_ordinary_gnc_module_system_interface = 0;
 
-int libgncmod_ordinarymod_gnc_module_current = 0;
-int libgncmod_ordinarymod_gnc_module_age = 0;
-int libgncmod_ordinarymod_gnc_module_revision = 0;
+int libgncmod_ordinary_gnc_module_current = 0;
+int libgncmod_ordinary_gnc_module_age = 0;
+int libgncmod_ordinary_gnc_module_revision = 0;
 
 char *
-libgncmod_ordinarymod_gnc_module_path(void)
+libgncmod_ordinary_gnc_module_path(void)
 {
-    return g_strdup("gnucash/ordinarymod");
+    return g_strdup("gnucash/ordinary");
 }
 
 char *
-libgncmod_ordinarymod_gnc_module_description(void)
+libgncmod_ordinary_gnc_module_description(void)
 {
-    return g_strdup("this is a very ordinary module");
+    return g_strdup("this is an ordinary module");
 }
 
 int
-libgncmod_ordinarymod_gnc_module_init(int refcount)
-{
-    return TRUE;
-}
-
-int
-libgncmod_ordinarymod_gnc_module_end(int refcount)
+libgncmod_ordinary_gnc_module_init(int refcount)
 {
     return TRUE;
 }
diff --git a/libgnucash/gnc-module/test/misc-mods/ordinarymod.c b/libgnucash/gnc-module/test/mod-ordinary/ordinary.c
similarity index 65%
copy from libgnucash/gnc-module/test/misc-mods/ordinarymod.c
copy to libgnucash/gnc-module/test/mod-ordinary/ordinary.c
index fe34fe16b..259dc1ab0 100644
--- a/libgnucash/gnc-module/test/misc-mods/ordinarymod.c
+++ b/libgnucash/gnc-module/test/mod-ordinary/ordinary.c
@@ -1,4 +1,6 @@
-/* ordinarymod.c : ordinary module */
+/* libordinary.  this is a dependency-free client library, equivalent to
+ * the engine or some other core component that's ignorant of guile
+ * and the module system */
 /********************************************************************\
  * This program is free software; you can redistribute it and/or    *
  * modify it under the terms of the GNU General Public License as   *
@@ -21,39 +23,11 @@
 
 
 #include <stdio.h>
-#include <gmodule.h>
 
-#include "gnc-module.h"
-#include "gnc-module-api.h"
-
-GNC_MODULE_API_DECL(libgncmod_ordinarymod)
-
-int libgncmod_ordinarymod_gnc_module_system_interface = 0;
-
-int libgncmod_ordinarymod_gnc_module_current = 0;
-int libgncmod_ordinarymod_gnc_module_age = 0;
-int libgncmod_ordinarymod_gnc_module_revision = 0;
-
-char *
-libgncmod_ordinarymod_gnc_module_path(void)
-{
-    return g_strdup("gnucash/ordinarymod");
-}
-
-char *
-libgncmod_ordinarymod_gnc_module_description(void)
-{
-    return g_strdup("this is a very ordinary module");
-}
-
-int
-libgncmod_ordinarymod_gnc_module_init(int refcount)
-{
-    return TRUE;
-}
+#include "ordinary.h"
 
 int
-libgncmod_ordinarymod_gnc_module_end(int refcount)
+ordinary_hello(void)
 {
-    return TRUE;
+    return 10;
 }
diff --git a/libgnucash/gnc-module/test/misc-mods/ordinarymod.c b/libgnucash/gnc-module/test/mod-ordinary/ordinary.h
similarity index 63%
copy from libgnucash/gnc-module/test/misc-mods/ordinarymod.c
copy to libgnucash/gnc-module/test/mod-ordinary/ordinary.h
index fe34fe16b..689139d11 100644
--- a/libgnucash/gnc-module/test/misc-mods/ordinarymod.c
+++ b/libgnucash/gnc-module/test/mod-ordinary/ordinary.h
@@ -1,4 +1,4 @@
-/* ordinarymod.c : ordinary module */
+/* ordinary.h: header for a dependency-free, guile-free client lib */
 /********************************************************************\
  * This program is free software; you can redistribute it and/or    *
  * modify it under the terms of the GNU General Public License as   *
@@ -20,40 +20,9 @@
 \********************************************************************/
 
 
-#include <stdio.h>
-#include <gmodule.h>
+#ifndef ORDINARY_H
+#define ORDINARY_H
 
-#include "gnc-module.h"
-#include "gnc-module-api.h"
+int ordinary_hello(void);
 
-GNC_MODULE_API_DECL(libgncmod_ordinarymod)
-
-int libgncmod_ordinarymod_gnc_module_system_interface = 0;
-
-int libgncmod_ordinarymod_gnc_module_current = 0;
-int libgncmod_ordinarymod_gnc_module_age = 0;
-int libgncmod_ordinarymod_gnc_module_revision = 0;
-
-char *
-libgncmod_ordinarymod_gnc_module_path(void)
-{
-    return g_strdup("gnucash/ordinarymod");
-}
-
-char *
-libgncmod_ordinarymod_gnc_module_description(void)
-{
-    return g_strdup("this is a very ordinary module");
-}
-
-int
-libgncmod_ordinarymod_gnc_module_init(int refcount)
-{
-    return TRUE;
-}
-
-int
-libgncmod_ordinarymod_gnc_module_end(int refcount)
-{
-    return TRUE;
-}
+#endif
diff --git a/libgnucash/gnc-module/test/mod-withdep/CMakeLists.txt b/libgnucash/gnc-module/test/mod-withdep/CMakeLists.txt
new file mode 100644
index 000000000..756719045
--- /dev/null
+++ b/libgnucash/gnc-module/test/mod-withdep/CMakeLists.txt
@@ -0,0 +1,27 @@
+
+add_library(withdep EXCLUDE_FROM_ALL withdep.c withdep.h)
+target_include_directories(withdep PRIVATE
+  ${CMAKE_SOURCE_DIR}/libgnucash/gnc-module/test/mod-ordinary
+)
+target_link_libraries(withdep ordinary)
+
+
+add_library(gncmod-withdep EXCLUDE_FROM_ALL gnc-mod-withdep.c)
+
+target_link_libraries(gncmod-withdep withdep gnc-module)
+target_include_directories(gncmod-withdep PRIVATE
+  ${CMAKE_BINARY_DIR}/common
+  ${CMAKE_CURRENT_SOURCE_DIR}
+  ${CMAKE_CURRENT_BINARY_DIR}
+  ${CMAKE_SOURCE_DIR}/common
+  ${CMAKE_SOURCE_DIR}/libgnucash/gnc-module
+  ${GLIB2_INCLUDE_DIRS}
+  ${GUILE_INCLUDE_DIRS}
+)
+
+set_target_properties(withdep gncmod-withdep PROPERTIES
+LIBRARY_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
+ARCHIVE_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
+RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+
+set_dist_list(mod_withdep_DIST CMakeLists.txt withdep.c withdep.h gnc-mod-withdep.c)
diff --git a/libgnucash/gnc-module/test/misc-mods/incompatdep.c b/libgnucash/gnc-module/test/mod-withdep/gnc-mod-withdep.c
similarity index 68%
copy from libgnucash/gnc-module/test/misc-mods/incompatdep.c
copy to libgnucash/gnc-module/test/mod-withdep/gnc-mod-withdep.c
index 0b7b97c7a..6c6135304 100644
--- a/libgnucash/gnc-module/test/misc-mods/incompatdep.c
+++ b/libgnucash/gnc-module/test/mod-withdep/gnc-mod-withdep.c
@@ -1,5 +1,5 @@
-/* incompatdep.c : a gnucash module that depends on an incompatible
- * version of another module. the initialization should fail. */
+/* gnc-mod-withdep.c : the Gnucash plugin that wraps the library
+ * 'libwithdep.so'. it does this by being linked against libwithdep.so */
 /********************************************************************\
  * This program is free software; you can redistribute it and/or    *
  * modify it under the terms of the GNU General Public License as   *
@@ -21,42 +21,40 @@
 \********************************************************************/
 
 
+#include <config.h>
 #include <stdio.h>
 #include <gmodule.h>
+#include <libguile.h>
 
 #include "gnc-module.h"
 #include "gnc-module-api.h"
 
-GNC_MODULE_API_DECL(libgncmod_incompatdep)
+GNC_MODULE_API_DECL(libgncmod_withdep)
 
-int libgncmod_incompatdep_gnc_module_system_interface = 0;
-
-int libgncmod_incompatdep_gnc_module_current = 0;
-int libgncmod_incompatdep_gnc_module_age = 0;
-int libgncmod_incompatdep_gnc_module_revision = 0;
+int libgncmod_withdep_gnc_module_system_interface = 0;
 
+int libgncmod_withdep_gnc_module_current = 0;
+int libgncmod_withdep_gnc_module_age = 0;
+int libgncmod_withdep_gnc_module_revision = 0;
 
 char *
-libgncmod_incompatdep_gnc_module_path(void)
+libgncmod_withdep_gnc_module_path(void)
 {
-    return g_strdup("gnucash/incompatdep");
+    return g_strdup("gnucash/withdep");
 }
 
 char *
-libgncmod_incompatdep_gnc_module_description(void)
+libgncmod_withdep_gnc_module_description(void)
 {
-    return g_strdup("this is a broken module");
+    return g_strdup("this is the withdep module");
 }
 
 int
-libgncmod_incompatdep_gnc_module_init(int refcount)
+libgncmod_withdep_gnc_module_init(int refcount)
 {
-    if (gnc_module_load("gnucash/ordinarymod", 25))
-    {
+    /* load libfoo */
+    if (gnc_module_load("gnucash/ordinary", 0))
         return TRUE;
-    }
     else
-    {
         return FALSE;
-    }
 }
diff --git a/libgnucash/gnc-module/test/misc-mods/ordinarymod.c b/libgnucash/gnc-module/test/mod-withdep/withdep.c
similarity index 65%
copy from libgnucash/gnc-module/test/misc-mods/ordinarymod.c
copy to libgnucash/gnc-module/test/mod-withdep/withdep.c
index fe34fe16b..d8885935e 100644
--- a/libgnucash/gnc-module/test/misc-mods/ordinarymod.c
+++ b/libgnucash/gnc-module/test/mod-withdep/withdep.c
@@ -1,4 +1,4 @@
-/* ordinarymod.c : ordinary module */
+/* libwithdep.  this library depends on ordinary */
 /********************************************************************\
  * This program is free software; you can redistribute it and/or    *
  * modify it under the terms of the GNU General Public License as   *
@@ -21,39 +21,14 @@
 
 
 #include <stdio.h>
-#include <gmodule.h>
 
-#include "gnc-module.h"
-#include "gnc-module-api.h"
-
-GNC_MODULE_API_DECL(libgncmod_ordinarymod)
-
-int libgncmod_ordinarymod_gnc_module_system_interface = 0;
-
-int libgncmod_ordinarymod_gnc_module_current = 0;
-int libgncmod_ordinarymod_gnc_module_age = 0;
-int libgncmod_ordinarymod_gnc_module_revision = 0;
-
-char *
-libgncmod_ordinarymod_gnc_module_path(void)
-{
-    return g_strdup("gnucash/ordinarymod");
-}
-
-char *
-libgncmod_ordinarymod_gnc_module_description(void)
-{
-    return g_strdup("this is a very ordinary module");
-}
+#include "withdep.h"
+#include "ordinary.h"
 
 int
-libgncmod_ordinarymod_gnc_module_init(int refcount)
+withdep_hello(void)
 {
-    return TRUE;
+    // ordinary_hello returns 10 so the final return value should be 11
+    return ordinary_hello() + 1;
 }
 
-int
-libgncmod_ordinarymod_gnc_module_end(int refcount)
-{
-    return TRUE;
-}
diff --git a/libgnucash/gnc-module/test/misc-mods/ordinarymod.c b/libgnucash/gnc-module/test/mod-withdep/withdep.h
similarity index 63%
rename from libgnucash/gnc-module/test/misc-mods/ordinarymod.c
rename to libgnucash/gnc-module/test/mod-withdep/withdep.h
index fe34fe16b..9a0c8ee67 100644
--- a/libgnucash/gnc-module/test/misc-mods/ordinarymod.c
+++ b/libgnucash/gnc-module/test/mod-withdep/withdep.h
@@ -1,4 +1,4 @@
-/* ordinarymod.c : ordinary module */
+/* withdep.h: header for a dependency-free, guile-free client lib */
 /********************************************************************\
  * This program is free software; you can redistribute it and/or    *
  * modify it under the terms of the GNU General Public License as   *
@@ -20,40 +20,9 @@
 \********************************************************************/
 
 
-#include <stdio.h>
-#include <gmodule.h>
+#ifndef WITHDEP_H
+#define WITHDEP_H
 
-#include "gnc-module.h"
-#include "gnc-module-api.h"
+int withdep_hello(void);
 
-GNC_MODULE_API_DECL(libgncmod_ordinarymod)
-
-int libgncmod_ordinarymod_gnc_module_system_interface = 0;
-
-int libgncmod_ordinarymod_gnc_module_current = 0;
-int libgncmod_ordinarymod_gnc_module_age = 0;
-int libgncmod_ordinarymod_gnc_module_revision = 0;
-
-char *
-libgncmod_ordinarymod_gnc_module_path(void)
-{
-    return g_strdup("gnucash/ordinarymod");
-}
-
-char *
-libgncmod_ordinarymod_gnc_module_description(void)
-{
-    return g_strdup("this is a very ordinary module");
-}
-
-int
-libgncmod_ordinarymod_gnc_module_init(int refcount)
-{
-    return TRUE;
-}
-
-int
-libgncmod_ordinarymod_gnc_module_end(int refcount)
-{
-    return TRUE;
-}
+#endif
diff --git a/libgnucash/gnc-module/test/test-load-c.c b/libgnucash/gnc-module/test/test-load-c.c
index 3a73ff5a8..b7026714a 100644
--- a/libgnucash/gnc-module/test/test-load-c.c
+++ b/libgnucash/gnc-module/test/test-load-c.c
@@ -21,15 +21,17 @@
 #include <config.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <libguile.h>
 #include <unittest-support.h>
+#include "test/mod-ordinary/ordinary.h"
+#include "test/mod-withdep/withdep.h"
 
 #include "gnc-module.h"
 
-static void
-guile_main(void *closure, int argc, char ** argv)
+int
+main(int argc, char ** argv)
 {
-    GNCModule ordinarymod;
+    gint retval = 0;
+    GNCModule testmod;
     gchar *msg = "Module '../../../libgnucash/gnc-module/test/misc-mods/.libs/libgncmod-futuremodsys.so' requires newer module system\n";
     gchar *logdomain = "gnc.module";
     guint loglevel = G_LOG_LEVEL_WARNING;
@@ -37,31 +39,68 @@ guile_main(void *closure, int argc, char ** argv)
     g_log_set_handler (logdomain, loglevel,
                        (GLogFunc)test_checked_handler, &check);
 
-    g_test_message("  test-load-c.c: testing module load/unload from C ... ");
-
     gnc_module_system_init();
 
-    ordinarymod = gnc_module_load("gnucash/ordinarymod", 0);
+    g_test_message("  test-load-c.c: load module gnucash/ordinary from C ... ");
+    testmod = gnc_module_load("gnucash/ordinary", 0);
+    if (!testmod)
+    {
+        g_test_message("  failed\n");
+        exit(-1);
+    }
+    g_test_message(" ok\n");
 
-    if (!ordinarymod)
+    g_test_message("  test-load-c.c: call function ordinary_hello in module gnucash/ordinary ... ");
+    retval = ordinary_hello();
+    if (retval != 10)
     {
-        g_test_message("  Failed to load ordinarymod\n");
+        g_test_message("  failed. Expected 10, got %i\n", retval);
         exit(-1);
     }
+    g_test_message(" ok\n");
 
-    if (!gnc_module_unload(ordinarymod))
+    g_test_message("  test-load-c.c: unload module gnucash/ordinary from C ... ");
+    if (!gnc_module_unload(testmod))
     {
-        g_test_message("  Failed to unload ordinarymod\n");
+        g_test_message("  failed\n");
         exit(-1);
     }
-    g_test_message(" successful.\n");
+    g_test_message(" ok.\n");
 
-    exit(0);
-}
+    g_test_message("  test-load-c.c: load module gnucash/withdep from C ... ");
+    testmod = gnc_module_load("gnucash/withdep", 0);
+    if (!testmod)
+    {
+        g_test_message("  failed\n");
+        exit(-1);
+    }
+    g_test_message(" ok\n");
 
-int
-main(int argc, char ** argv)
-{
-    scm_boot_guile(argc, argv, guile_main, NULL);
-    return 0;
+    g_test_message("  test-load-c.c: call function withdep_hello in module gnucash/withdep ... ");
+    retval = withdep_hello();
+    if (retval != 11)
+    {
+        g_test_message("  failed. Expected 11, got %i\n", retval);
+        exit(-1);
+    }
+    g_test_message(" ok\n");
+
+    g_test_message("  test-load-c.c: call function ordinary_hello in depended on module gnucash/ordinary ... ");
+    retval = ordinary_hello();
+    if (retval != 10)
+    {
+        g_test_message("  failed. Expected 10, got %i\n", retval);
+        exit(-1);
+    }
+    g_test_message(" ok\n");
+
+    g_test_message("  test-load-c.c: unload module gnucash/withdep from C ... ");
+    if (!gnc_module_unload(testmod))
+    {
+        g_test_message("  failed\n");
+        exit(-1);
+    }
+    g_test_message(" ok.\n");
+
+    exit(0);
 }

commit fbd73c83cfd66ee8fce9f6fbe8a4e5209df1bc53
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Nov 19 18:17:05 2019 +0100

    gnc-module - move most of scm tests to bindings/guile
    
    This is a first rudimentary separation of gnc-module tests
    based on whether they require guile or not. Needs plenty of refinement
    which will be applied in followup commits.

diff --git a/bindings/guile/test/CMakeLists.txt b/bindings/guile/test/CMakeLists.txt
index f1ac9c6b6..16c7c4900 100644
--- a/bindings/guile/test/CMakeLists.txt
+++ b/bindings/guile/test/CMakeLists.txt
@@ -1,5 +1,9 @@
 # C(++) tests requiring a proper guile environment set up
 
+add_subdirectory(mod-foo)
+add_subdirectory(mod-bar)
+add_subdirectory(mod-baz)
+
 set(ENGINE_TEST_INCLUDE_DIRS
     ${CMAKE_SOURCE_DIR}/libgnucash/backend/xml
     ${CMAKE_SOURCE_DIR}/libgnucash/engine
@@ -112,6 +116,44 @@ if (HAVE_SRFI64)
 endif (HAVE_SRFI64)
 
 
+set (test_gnc_module_SCHEME
+    test-gnc-module-scm-init.scm
+    test-gnc-module-load-scm.scm
+    test-gnc-module-swigged-c.scm
+    test-gnc-module-load-deps.scm
+    test-gnc-module-scm-dynload.scm
+    test-gnc-module-scm-module.scm
+    test-gnc-module-scm-multi.scm
+)
+
+set (test_gnc_module_DEPENDS
+    scm-gnc-module
+    scm-test-core
+    scm-mod-foo
+    gncmod-bar
+    scm-mod-baz
+    gncmod-agedver
+    gncmod-incompatdep
+    gncmod-futuremodsys
+)
+
+gnc_add_scheme_test_targets (test-gnc-modules-scm
+    "${test_gnc_module_SCHEME}"
+    "tests"
+    "${test_gnc_module_DEPENDS}"
+    TRUE
+)
+gnc_add_scheme_tests ("${test_gnc_module_SCHEME}")
+if(NOT WIN32)
+  # This little dance is needed because gnc_module_init will assert if
+  # it finds libgncmod-futuremod.so outside of a test that expects it.
+  get_guile_env()
+  set(_GNC_MODULE_PATH "${LIBDIR_BUILD}:${LIBDIR_BUILD}/gnucash:${LIBDIR_BUILD}/gnucash/test")
+  foreach(test_file ${test_gnc_module_SCHEME})
+    get_filename_component(basename ${test_file} NAME_WE)
+    set_tests_properties(${basename} PROPERTIES ENVIRONMENT "${GUILE_ENV};GNC_MODULE_PATH=${_GNC_MODULE_PATH}")
+  endforeach()
+endif()
 
 set(test_engine_SCHEME_DIST
     srfi64-extras.scm
@@ -121,12 +163,20 @@ set(test_engine_SCHEME_DIST
     test-business-core.scm
 )
 
-set_dist_list(test_guile_DIST
+set_local_dist(test_guile_DIST_local
     CMakeLists.txt
     test-scm-query.cpp
     ${test_engine_SCHEME_DIST}
+    ${test_gnc_module_SCHEME}
     ${test_scm_SCHEME}
 )
+set(test_guile_DIST
+    ${test_guile_DIST_local}
+    ${mod_bar_DIST}
+    ${mod_baz_DIST}
+    ${mod_foo_DIST}
+    PARENT_SCOPE
+)
 
 # Define two imaginary deprecated guile modules to test the compat file generation code
 gnc_add_scheme_deprecated_module ("gnucash deprecated-module" "" "" "")
diff --git a/libgnucash/gnc-module/test/mod-bar/CMakeLists.txt b/bindings/guile/test/mod-bar/CMakeLists.txt
similarity index 100%
rename from libgnucash/gnc-module/test/mod-bar/CMakeLists.txt
rename to bindings/guile/test/mod-bar/CMakeLists.txt
diff --git a/libgnucash/gnc-module/test/mod-bar/bar.c b/bindings/guile/test/mod-bar/bar.c
similarity index 100%
rename from libgnucash/gnc-module/test/mod-bar/bar.c
rename to bindings/guile/test/mod-bar/bar.c
diff --git a/libgnucash/gnc-module/test/mod-bar/bar.h b/bindings/guile/test/mod-bar/bar.h
similarity index 100%
rename from libgnucash/gnc-module/test/mod-bar/bar.h
rename to bindings/guile/test/mod-bar/bar.h
diff --git a/libgnucash/gnc-module/test/mod-bar/bar.i b/bindings/guile/test/mod-bar/bar.i
similarity index 100%
rename from libgnucash/gnc-module/test/mod-bar/bar.i
rename to bindings/guile/test/mod-bar/bar.i
diff --git a/libgnucash/gnc-module/test/mod-bar/gnc-mod-bar.c b/bindings/guile/test/mod-bar/gnc-mod-bar.c
similarity index 100%
rename from libgnucash/gnc-module/test/mod-bar/gnc-mod-bar.c
rename to bindings/guile/test/mod-bar/gnc-mod-bar.c
diff --git a/libgnucash/gnc-module/test/mod-bar/gnucash/bar.scm b/bindings/guile/test/mod-bar/gnucash/bar.scm
similarity index 100%
rename from libgnucash/gnc-module/test/mod-bar/gnucash/bar.scm
rename to bindings/guile/test/mod-bar/gnucash/bar.scm
diff --git a/libgnucash/gnc-module/test/mod-baz/CMakeLists.txt b/bindings/guile/test/mod-baz/CMakeLists.txt
similarity index 94%
rename from libgnucash/gnc-module/test/mod-baz/CMakeLists.txt
rename to bindings/guile/test/mod-baz/CMakeLists.txt
index f39d658e1..d8b5231df 100644
--- a/libgnucash/gnc-module/test/mod-baz/CMakeLists.txt
+++ b/bindings/guile/test/mod-baz/CMakeLists.txt
@@ -6,7 +6,7 @@ gnc_add_swig_guile_command (swig-baz-c
 
 add_library(baz EXCLUDE_FROM_ALL baz.c baz.h)
 target_include_directories(baz PRIVATE
-  ${CMAKE_SOURCE_DIR}/libgnucash/gnc-module/test/mod-foo
+  ${CMAKE_SOURCE_DIR}/bindings/guile/test/mod-foo
 )
 target_link_libraries(baz foo)
 
diff --git a/libgnucash/gnc-module/test/mod-baz/baz.c b/bindings/guile/test/mod-baz/baz.c
similarity index 100%
rename from libgnucash/gnc-module/test/mod-baz/baz.c
rename to bindings/guile/test/mod-baz/baz.c
diff --git a/libgnucash/gnc-module/test/mod-baz/baz.h b/bindings/guile/test/mod-baz/baz.h
similarity index 100%
rename from libgnucash/gnc-module/test/mod-baz/baz.h
rename to bindings/guile/test/mod-baz/baz.h
diff --git a/libgnucash/gnc-module/test/mod-baz/baz.i b/bindings/guile/test/mod-baz/baz.i
similarity index 100%
rename from libgnucash/gnc-module/test/mod-baz/baz.i
rename to bindings/guile/test/mod-baz/baz.i
diff --git a/libgnucash/gnc-module/test/mod-baz/gnc-mod-baz.c b/bindings/guile/test/mod-baz/gnc-mod-baz.c
similarity index 100%
rename from libgnucash/gnc-module/test/mod-baz/gnc-mod-baz.c
rename to bindings/guile/test/mod-baz/gnc-mod-baz.c
diff --git a/libgnucash/gnc-module/test/mod-baz/gnucash/baz.scm b/bindings/guile/test/mod-baz/gnucash/baz.scm
similarity index 100%
rename from libgnucash/gnc-module/test/mod-baz/gnucash/baz.scm
rename to bindings/guile/test/mod-baz/gnucash/baz.scm
diff --git a/libgnucash/gnc-module/test/mod-foo/CMakeLists.txt b/bindings/guile/test/mod-foo/CMakeLists.txt
similarity index 100%
rename from libgnucash/gnc-module/test/mod-foo/CMakeLists.txt
rename to bindings/guile/test/mod-foo/CMakeLists.txt
diff --git a/libgnucash/gnc-module/test/mod-foo/foo.c b/bindings/guile/test/mod-foo/foo.c
similarity index 100%
rename from libgnucash/gnc-module/test/mod-foo/foo.c
rename to bindings/guile/test/mod-foo/foo.c
diff --git a/libgnucash/gnc-module/test/mod-foo/foo.h b/bindings/guile/test/mod-foo/foo.h
similarity index 100%
rename from libgnucash/gnc-module/test/mod-foo/foo.h
rename to bindings/guile/test/mod-foo/foo.h
diff --git a/libgnucash/gnc-module/test/mod-foo/foo.i b/bindings/guile/test/mod-foo/foo.i
similarity index 100%
rename from libgnucash/gnc-module/test/mod-foo/foo.i
rename to bindings/guile/test/mod-foo/foo.i
diff --git a/libgnucash/gnc-module/test/mod-foo/gnc-mod-foo.c b/bindings/guile/test/mod-foo/gnc-mod-foo.c
similarity index 100%
rename from libgnucash/gnc-module/test/mod-foo/gnc-mod-foo.c
rename to bindings/guile/test/mod-foo/gnc-mod-foo.c
diff --git a/libgnucash/gnc-module/test/mod-foo/gnucash/foo.scm b/bindings/guile/test/mod-foo/gnucash/foo.scm
similarity index 100%
rename from libgnucash/gnc-module/test/mod-foo/gnucash/foo.scm
rename to bindings/guile/test/mod-foo/gnucash/foo.scm
diff --git a/libgnucash/gnc-module/test/test-gnc-module-load-deps.scm b/bindings/guile/test/test-gnc-module-load-deps.scm
similarity index 100%
rename from libgnucash/gnc-module/test/test-gnc-module-load-deps.scm
rename to bindings/guile/test/test-gnc-module-load-deps.scm
diff --git a/libgnucash/gnc-module/test/test-gnc-module-load-scm.scm b/bindings/guile/test/test-gnc-module-load-scm.scm
similarity index 100%
rename from libgnucash/gnc-module/test/test-gnc-module-load-scm.scm
rename to bindings/guile/test/test-gnc-module-load-scm.scm
diff --git a/libgnucash/gnc-module/test/test-gnc-module-scm-dynload.scm b/bindings/guile/test/test-gnc-module-scm-dynload.scm
similarity index 100%
rename from libgnucash/gnc-module/test/test-gnc-module-scm-dynload.scm
rename to bindings/guile/test/test-gnc-module-scm-dynload.scm
diff --git a/libgnucash/gnc-module/test/test-gnc-module-scm-init.scm b/bindings/guile/test/test-gnc-module-scm-init.scm
similarity index 100%
rename from libgnucash/gnc-module/test/test-gnc-module-scm-init.scm
rename to bindings/guile/test/test-gnc-module-scm-init.scm
diff --git a/libgnucash/gnc-module/test/test-gnc-module-scm-module.scm b/bindings/guile/test/test-gnc-module-scm-module.scm
similarity index 100%
rename from libgnucash/gnc-module/test/test-gnc-module-scm-module.scm
rename to bindings/guile/test/test-gnc-module-scm-module.scm
diff --git a/libgnucash/gnc-module/test/test-gnc-module-scm-multi.scm b/bindings/guile/test/test-gnc-module-scm-multi.scm
similarity index 100%
rename from libgnucash/gnc-module/test/test-gnc-module-scm-multi.scm
rename to bindings/guile/test/test-gnc-module-scm-multi.scm
diff --git a/libgnucash/gnc-module/test/test-gnc-module-swigged-c.scm b/bindings/guile/test/test-gnc-module-swigged-c.scm
similarity index 100%
rename from libgnucash/gnc-module/test/test-gnc-module-swigged-c.scm
rename to bindings/guile/test/test-gnc-module-swigged-c.scm
diff --git a/libgnucash/gnc-module/test/CMakeLists.txt b/libgnucash/gnc-module/test/CMakeLists.txt
index 4a96c09eb..5c359b236 100644
--- a/libgnucash/gnc-module/test/CMakeLists.txt
+++ b/libgnucash/gnc-module/test/CMakeLists.txt
@@ -1,7 +1,4 @@
 
-add_subdirectory(mod-foo)
-add_subdirectory(mod-bar)
-add_subdirectory(mod-baz)
 add_subdirectory(misc-mods)
 
 set(GNC_MODULE_TEST_INCLUDE_DIRS
@@ -21,6 +18,7 @@ set(GNC_MODULE_TEST_LIBS
   gncmod-agedver
   gncmod-futuremodsys
   gncmod-incompatdep
+  gncmod-ordinarymod
   )
 
 gnc_add_test_with_guile(test-load-c test-load-c.c GNC_MODULE_TEST_INCLUDE_DIRS GNC_MODULE_TEST_LIBS "GNC_MODULE_PATH=${LIBDIR_BUILD}/gnucash/test")
@@ -45,46 +43,6 @@ gnc_add_test(test-dynload test-dynload.c
   LIBDIR=${_LIBDIR}
 )
 
-set(test_gnc_module_SCHEME
-  test-gnc-module-scm-init.scm
-  test-gnc-module-load-scm.scm
-  test-gnc-module-swigged-c.scm
-  test-gnc-module-load-deps.scm
-  test-gnc-module-scm-dynload.scm
-  test-gnc-module-scm-module.scm
-  test-gnc-module-scm-multi.scm
-  )
-
-set(CORE_GUILE_DEPENDS
-  scm-gnc-module
-  scm-test-core
-  scm-mod-foo
-  gncmod-bar
-  scm-mod-baz
-  gncmod-agedver
-  gncmod-incompatdep
-  gncmod-futuremodsys
-  )
-
-gnc_add_scheme_test_targets(test-gnc-modules-scm
-  "${test_gnc_module_SCHEME}"
-  "tests"
-  "${CORE_GUILE_DEPENDS}"
-  TRUE
-  )
-
-gnc_add_scheme_tests("${test_gnc_module_SCHEME}")
-if(NOT WIN32)
-  # This little dance is needed because gnc_module_init will assert if
-  # it finds libgncmod-futuremod.so outside of a test that expects it.
-  get_guile_env()
-  set(_GNC_MODULE_PATH "${LIBDIR_BUILD}:${LIBDIR_BUILD}/gnucash:${LIBDIR_BUILD}/gnucash/test")
-  foreach(test_file ${test_gnc_module_SCHEME})
-    get_filename_component(basename ${test_file} NAME_WE)
-    set_tests_properties(${basename} PROPERTIES ENVIRONMENT "${GUILE_ENV};GNC_MODULE_PATH=${_GNC_MODULE_PATH}")
-  endforeach()
-endif()
-
 set(test_gnc_module_SOURCE_DIST
   test-agedver.c
   test-dynload.c
@@ -95,7 +53,6 @@ set(test_gnc_module_SOURCE_DIST
 
 set(test_gnc_module_EXTRA_DIST
   README
-  ${test_gnc_module_SCHEME}
 )
 
 set_local_dist(test_gnc_module_DIST_local CMakeLists.txt README ${test_gnc_module_SOURCE_DIST} ${test_gnc_module_EXTRA_DIST})
diff --git a/libgnucash/gnc-module/test/misc-mods/CMakeLists.txt b/libgnucash/gnc-module/test/misc-mods/CMakeLists.txt
index b3cf730ac..c7945322c 100644
--- a/libgnucash/gnc-module/test/misc-mods/CMakeLists.txt
+++ b/libgnucash/gnc-module/test/misc-mods/CMakeLists.txt
@@ -13,9 +13,12 @@ target_link_libraries(gncmod-futuremodsys ${GLIB2_LDFLAGS})
 add_library(gncmod-incompatdep  EXCLUDE_FROM_ALL incompatdep.c)
 target_link_libraries(gncmod-incompatdep gnc-module ${GLIB2_LDFLAGS})
 
-set_target_properties(gncmod-agedver gncmod-futuremodsys gncmod-incompatdep PROPERTIES
+add_library(gncmod-ordinarymod  EXCLUDE_FROM_ALL ordinarymod.c)
+target_link_libraries(gncmod-ordinarymod gnc-module ${GLIB2_LDFLAGS})
+
+set_target_properties(gncmod-agedver gncmod-futuremodsys gncmod-incompatdep gncmod-ordinarymod PROPERTIES
 LIBRARY_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
 ARCHIVE_OUTPUT_DIRECTORY ${LIBDIR_BUILD}/gnucash/test
 RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
 
-set_dist_list(misc_mods_DIST CMakeLists.txt agedver.c futuremodsys.c incompatdep.c)
+set_dist_list(misc_mods_DIST CMakeLists.txt agedver.c futuremodsys.c incompatdep.c ordinarymod.c)
diff --git a/libgnucash/gnc-module/test/misc-mods/incompatdep.c b/libgnucash/gnc-module/test/misc-mods/incompatdep.c
index ae54e2965..0b7b97c7a 100644
--- a/libgnucash/gnc-module/test/misc-mods/incompatdep.c
+++ b/libgnucash/gnc-module/test/misc-mods/incompatdep.c
@@ -51,7 +51,7 @@ libgncmod_incompatdep_gnc_module_description(void)
 int
 libgncmod_incompatdep_gnc_module_init(int refcount)
 {
-    if (gnc_module_load("gnucash/foo", 25))
+    if (gnc_module_load("gnucash/ordinarymod", 25))
     {
         return TRUE;
     }
diff --git a/libgnucash/gnc-module/test/misc-mods/incompatdep.c b/libgnucash/gnc-module/test/misc-mods/ordinarymod.c
similarity index 66%
copy from libgnucash/gnc-module/test/misc-mods/incompatdep.c
copy to libgnucash/gnc-module/test/misc-mods/ordinarymod.c
index ae54e2965..fe34fe16b 100644
--- a/libgnucash/gnc-module/test/misc-mods/incompatdep.c
+++ b/libgnucash/gnc-module/test/misc-mods/ordinarymod.c
@@ -1,5 +1,4 @@
-/* incompatdep.c : a gnucash module that depends on an incompatible
- * version of another module. the initialization should fail. */
+/* ordinarymod.c : ordinary module */
 /********************************************************************\
  * This program is free software; you can redistribute it and/or    *
  * modify it under the terms of the GNU General Public License as   *
@@ -27,36 +26,34 @@
 #include "gnc-module.h"
 #include "gnc-module-api.h"
 
-GNC_MODULE_API_DECL(libgncmod_incompatdep)
+GNC_MODULE_API_DECL(libgncmod_ordinarymod)
 
-int libgncmod_incompatdep_gnc_module_system_interface = 0;
-
-int libgncmod_incompatdep_gnc_module_current = 0;
-int libgncmod_incompatdep_gnc_module_age = 0;
-int libgncmod_incompatdep_gnc_module_revision = 0;
+int libgncmod_ordinarymod_gnc_module_system_interface = 0;
 
+int libgncmod_ordinarymod_gnc_module_current = 0;
+int libgncmod_ordinarymod_gnc_module_age = 0;
+int libgncmod_ordinarymod_gnc_module_revision = 0;
 
 char *
-libgncmod_incompatdep_gnc_module_path(void)
+libgncmod_ordinarymod_gnc_module_path(void)
 {
-    return g_strdup("gnucash/incompatdep");
+    return g_strdup("gnucash/ordinarymod");
 }
 
 char *
-libgncmod_incompatdep_gnc_module_description(void)
+libgncmod_ordinarymod_gnc_module_description(void)
+{
+    return g_strdup("this is a very ordinary module");
+}
+
+int
+libgncmod_ordinarymod_gnc_module_init(int refcount)
 {
-    return g_strdup("this is a broken module");
+    return TRUE;
 }
 
 int
-libgncmod_incompatdep_gnc_module_init(int refcount)
+libgncmod_ordinarymod_gnc_module_end(int refcount)
 {
-    if (gnc_module_load("gnucash/foo", 25))
-    {
-        return TRUE;
-    }
-    else
-    {
-        return FALSE;
-    }
+    return TRUE;
 }
diff --git a/libgnucash/gnc-module/test/test-load-c.c b/libgnucash/gnc-module/test/test-load-c.c
index af35b7efb..3a73ff5a8 100644
--- a/libgnucash/gnc-module/test/test-load-c.c
+++ b/libgnucash/gnc-module/test/test-load-c.c
@@ -29,7 +29,7 @@
 static void
 guile_main(void *closure, int argc, char ** argv)
 {
-    GNCModule foo;
+    GNCModule ordinarymod;
     gchar *msg = "Module '../../../libgnucash/gnc-module/test/misc-mods/.libs/libgncmod-futuremodsys.so' requires newer module system\n";
     gchar *logdomain = "gnc.module";
     guint loglevel = G_LOG_LEVEL_WARNING;
@@ -41,17 +41,17 @@ guile_main(void *closure, int argc, char ** argv)
 
     gnc_module_system_init();
 
-    foo = gnc_module_load("gnucash/foo", 0);
+    ordinarymod = gnc_module_load("gnucash/ordinarymod", 0);
 
-    if (!foo)
+    if (!ordinarymod)
     {
-        g_test_message("  Failed to load foo\n");
+        g_test_message("  Failed to load ordinarymod\n");
         exit(-1);
     }
 
-    if (!gnc_module_unload(foo))
+    if (!gnc_module_unload(ordinarymod))
     {
-        g_test_message("  Failed to unload foo\n");
+        g_test_message("  Failed to unload ordinarymod\n");
         exit(-1);
     }
     g_test_message(" successful.\n");

commit 6eb0ccfa1172a20074c03e1b1fdf1c730edd09ad
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Nov 19 16:40:41 2019 +0100

    gnc-module - move guile wrappers to bindings/guile

diff --git a/bindings/CMakeLists.txt b/bindings/CMakeLists.txt
index 651037956..99e2ca73b 100644
--- a/bindings/CMakeLists.txt
+++ b/bindings/CMakeLists.txt
@@ -6,5 +6,6 @@ set_local_dist(bindings_DIST_local
     business-core.i
     core-utils.i
     engine.i
-    engine-common.i)
+    engine-common.i
+    gnc-module.i)
 set(bindings_DIST ${bindings_DIST_local} ${guile_DIST} ${python_bindings_DIST} PARENT_SCOPE)
diff --git a/libgnucash/gnc-module/gnc-module.i b/bindings/gnc-module.i
similarity index 100%
rename from libgnucash/gnc-module/gnc-module.i
rename to bindings/gnc-module.i
diff --git a/bindings/guile/CMakeLists.txt b/bindings/guile/CMakeLists.txt
index 3810a423d..ad73e4a76 100644
--- a/bindings/guile/CMakeLists.txt
+++ b/bindings/guile/CMakeLists.txt
@@ -20,6 +20,15 @@ gnc_add_swig_guile_command (swig-engine-c
     ${CMAKE_SOURCE_DIR}/bindings/engine-common.i
 )
 
+# Command to generate the swig-gnc-module.c wrapper file
+gnc_swig_extract_header_files (gnc-module GNC_MODULE_HEADERS)
+gnc_add_swig_guile_command (swig-gnc-module-c
+    SWIG_GNC_MODULE_C swig-gnc-module.c
+    ${CMAKE_SOURCE_DIR}/bindings/gnc-module.i
+    "${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_SOURCE_DIR}/libgnucash/gnc-module"
+    ${GNC_MODULE_HEADERS}
+)
+
 set(guile_HEADERS
     glib-guile.h
     gnc-engine-guile.h
@@ -37,7 +46,8 @@ add_library(gnucash-guile SHARED
     ${guile_SOURCES}
     ${guile_HEADERS}
     ${SWIG_CORE_UTILS_GUILE_C}
-    ${SWIG_ENGINE_C})
+    ${SWIG_ENGINE_C}
+    ${SWIG_GNC_MODULE_C})
 
 add_dependencies(gnucash-guile
     swig-runtime-h)
@@ -57,6 +67,7 @@ target_link_libraries(gnucash-guile
     PRIVATE
         gnc-core-utils
         gncmod-engine
+        gnc-module
         ${GLIB2_LDFLAGS})
 
 install(TARGETS gnucash-guile
@@ -128,6 +139,17 @@ gnc_add_scheme_targets(scm-engine-2
 
 add_custom_target(scm-engine ALL DEPENDS scm-engine-2 scm-engine-1 scm-engine-0)
 
+set(scm_gnc_module_DEPENDS
+    gnc-module
+    gnucash-guile)
+
+gnc_add_scheme_targets(scm-gnc-module
+    gnc-module.scm
+    gnucash
+    "${scm_gnc_module_DEPENDS}"
+    FALSE
+)
+
 gnc_add_scheme_targets(price-quotes
     price-quotes.scm
     gnucash
@@ -137,6 +159,7 @@ gnc_add_scheme_targets(price-quotes
 set_local_dist(guile_DIST_local
     CMakeLists.txt
     core-utils.scm
+    gnc-module.scm
     price-quotes.scm
     ${guile_SOURCES}
     ${guile_HEADERS}
diff --git a/bindings/guile/engine-utilities.scm b/bindings/guile/engine-utilities.scm
index 3d101757e..77feacb30 100644
--- a/bindings/guile/engine-utilities.scm
+++ b/bindings/guile/engine-utilities.scm
@@ -20,8 +20,6 @@
 ;; Boston, MA  02110-1301,  USA       gnu at gnu.org
 
 ;; Copyright 2000 Rob Browning <rlb at cs.utexas.edu>
-(use-modules (gnucash gnc-module))
-
 (eval-when
       (compile load eval expand)
       (load-extension "libgnucash-guile" "gnc_guile_bindings_init"))
diff --git a/bindings/guile/gnc-guile-bindings.c b/bindings/guile/gnc-guile-bindings.c
index 4d40df5cd..424d31daf 100644
--- a/bindings/guile/gnc-guile-bindings.c
+++ b/bindings/guile/gnc-guile-bindings.c
@@ -34,6 +34,7 @@ static int is_initialized = 0;
 
 extern SCM scm_init_sw_core_utils_module (void);
 extern SCM scm_init_sw_engine_module (void);
+extern SCM scm_init_sw_gnc_module_module (void);
 
 void
 gnc_guile_bindings_init(void)
@@ -43,6 +44,7 @@ gnc_guile_bindings_init(void)
         /* Do what's necessary to initialize the bindings */
         scm_init_sw_core_utils_module();
         scm_init_sw_engine_module();
+        scm_init_sw_gnc_module_module();
 
         is_initialized = 1;
     }
diff --git a/libgnucash/gnc-module/gnc-module.scm b/bindings/guile/gnc-module.scm
similarity index 74%
rename from libgnucash/gnc-module/gnc-module.scm
rename to bindings/guile/gnc-module.scm
index 236f02f17..9785e8bae 100644
--- a/libgnucash/gnc-module/gnc-module.scm
+++ b/bindings/guile/gnc-module.scm
@@ -30,23 +30,20 @@
 ;; Guile 2 needs to find the symbols from the extension at compile time already
 (eval-when
       (compile load eval expand)
-      (load-extension "libgnc-module" "scm_init_sw_gnc_module_module"))
-
+      (load-extension "libgnucash-guile" "gnc_guile_bindings_init"))
 (use-modules (sw_gnc_module))
 
-(define gnc:module-system-init gnc-module-system-init)
-(define gnc:module-system-refresh gnc-module-system-refresh)
-(define gnc:module-load gnc-module-load)
-(define gnc:module-load-optional gnc-module-load-optional)
-(define gnc:module-unload gnc-module-unload)
+; Export the swig-wrapped symbols in the public interface of this module
+(let ((i (module-public-interface (current-module))))
+     (module-use! i (resolve-interface '(sw_gnc_module))))
 
-(export gnc:module-system-init)
-(export gnc:module-system-refresh)
-(export gnc:module-load)
-(export gnc:module-load-optional)
-(export gnc:module-unload)
-(export gnc:module-begin-syntax)
+(define-public gnc:module-system-init gnc-module-system-init)
+(define-public gnc:module-system-refresh gnc-module-system-refresh)
+(define-public gnc:module-load gnc-module-load)
+(define-public gnc:module-load-optional gnc-module-load-optional)
+(define-public gnc:module-unload gnc-module-unload)
 
 ;; Guile 2 needs to load external modules at compile time
 (define-syntax-rule (gnc:module-begin-syntax form ...)
       (eval-when (load compile eval expand) (begin form ...)))
+(export gnc:module-begin-syntax)
diff --git a/libgnucash/gnc-module/CMakeLists.txt b/libgnucash/gnc-module/CMakeLists.txt
index 01d0b2cb7..072c91de0 100644
--- a/libgnucash/gnc-module/CMakeLists.txt
+++ b/libgnucash/gnc-module/CMakeLists.txt
@@ -2,12 +2,6 @@
 add_subdirectory(test)
 add_subdirectory(example)
 
-# Command to generate the swig-gnc-module.c wrapper file
-gnc_add_swig_guile_command (swig-gnc-module-c
-    SWIG_GNC_MODULE_C swig-gnc-module.c
-    ${CMAKE_CURRENT_SOURCE_DIR}/gnc-module.i ""
-)
-
 set (gnc_module_SOURCES gnc-module.c)
 
 # Add dependency on config.h
@@ -21,7 +15,6 @@ set (gnc_module_HEADERS
 add_library	(gnc-module
   ${gnc_module_SOURCES}
   ${gnc_module_HEADERS}
-  ${SWIG_GNC_MODULE_C}
 )
 
 target_link_libraries(gnc-module ${GUILE_LDFLAGS} ${GMODULE_LDFLAGS} ${GLIB2_LDFLAGS})
@@ -43,20 +36,6 @@ install(TARGETS gnc-module
 
 install(FILES ${gnc_module_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gnucash)
 
-# --- Compile Scheme file(s) ---
-
-set (gnc_module_SCHEME gnc-module.scm)
-
-set(GUILE_OUTPUT_DIR   gnucash)
-set(GUILE_DEPENDS      gnc-module)
-
-gnc_add_scheme_targets(scm-gnc-module
-  "${gnc_module_SCHEME}"
-  ${GUILE_OUTPUT_DIR}
-  "${GUILE_DEPENDS}"
-  FALSE
-)
-
 set_local_dist(gnc_module_DIST_local CMakeLists.txt ${gnc_module_SOURCES} ${gnc_module_HEADERS}
-        gnc-module.i gnc-module.scm README)
+        README)
 set(gnc_module_DIST ${gnc_module_DIST_local} ${test_gnc_module_DIST} ${example_DIST} PARENT_SCOPE)
diff --git a/libgnucash/gnc-module/test/CMakeLists.txt b/libgnucash/gnc-module/test/CMakeLists.txt
index 01a852b1c..4a96c09eb 100644
--- a/libgnucash/gnc-module/test/CMakeLists.txt
+++ b/libgnucash/gnc-module/test/CMakeLists.txt
@@ -56,7 +56,7 @@ set(test_gnc_module_SCHEME
   )
 
 set(CORE_GUILE_DEPENDS
-  gnc-module
+  scm-gnc-module
   scm-test-core
   scm-mod-foo
   gncmod-bar
diff --git a/po/POTFILES.in b/po/POTFILES.in
index dcd38babc..78524f0f0 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -10,6 +10,7 @@ bindings/guile/gnc-engine-guile.c
 bindings/guile/gnc-guile-bindings.c
 bindings/guile/gnc-guile-utils.c
 bindings/guile/gnc-kvp-guile.cpp
+bindings/guile/gnc-module.scm
 bindings/guile/gnc-numeric.scm
 bindings/guile/price-quotes.scm
 bindings/guile/utilities.scm
@@ -688,7 +689,6 @@ libgnucash/engine/Transaction.c
 libgnucash/engine/TransLog.c
 libgnucash/gnc-module/example/gncmod-example.c
 libgnucash/gnc-module/gnc-module.c
-libgnucash/gnc-module/gnc-module.scm
 libgnucash/tax/de_DE/tax.scm
 libgnucash/tax/de_DE/txf-help.scm
 libgnucash/tax/de_DE/txf.scm

commit 096a515154446720bbf1e5bc8fc92971ad7e5f2c
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Fri Dec 6 18:17:05 2019 +0100

    bindings/guile - fix typos in error messages
    
    These were imported verbatim from libgnucash/app-utils/guile-util.c

diff --git a/bindings/guile/glib-guile.c b/bindings/guile/glib-guile.c
index cab6c91a8..31936cbab 100644
--- a/bindings/guile/glib-guile.c
+++ b/bindings/guile/glib-guile.c
@@ -293,7 +293,7 @@ gnc_process_get_fd (const Process *proc, const gint std_fd)
         g_return_val_if_reached (-1);
 
     if (*retptr == -1)
-        g_warning ("Pipe to childs file descriptor %d is -1", std_fd);
+        g_warning ("Pipe to child's file descriptor %d is -1", std_fd);
     return *retptr;
 }
 
@@ -306,21 +306,21 @@ gnc_detach_process (Process *proc, const gboolean kill_it)
     close (proc->fd_stdin);
     if (errno)
     {
-        g_message ("Close of childs stdin (%d) failed: %s", proc->fd_stdin,
+        g_message ("Close of child's stdin (%d) failed: %s", proc->fd_stdin,
                    g_strerror (errno));
         errno = 0;
     }
     close (proc->fd_stdout);
     if (errno)
     {
-        g_message ("Close of childs stdout (%d) failed: %s", proc->fd_stdout,
+        g_message ("Close of child's stdout (%d) failed: %s", proc->fd_stdout,
                    g_strerror(errno));
         errno = 0;
     }
     close (proc->fd_stderr);
     if (errno)
     {
-        g_message ("Close of childs stderr (%d) failed: %s", proc->fd_stderr,
+        g_message ("Close of child's stderr (%d) failed: %s", proc->fd_stderr,
                    g_strerror(errno));
         errno = 0;
     }

commit 6a3505d01f3275435d93d3519aae4a8c968f67a3
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sun Nov 17 18:59:36 2019 +0100

    app-utils - move price-quotes support functions directly into bindings
    
    - wrappers for glib functions go into glib-guile
    - engine convenience functions go into gnc-engine-guile

diff --git a/bindings/engine.i b/bindings/engine.i
index 91d60c4c1..c7635d952 100644
--- a/bindings/engine.i
+++ b/bindings/engine.i
@@ -440,3 +440,27 @@ void qof_book_set_string_option(QofBook* book, const char* opt_name, const char*
 #endif
 
 %include business-core.i
+
+%typemap(in) GList * {
+    SCM path_scm = $input;
+    GList *path = NULL;
+    while (!scm_is_null (path_scm))
+    {
+        SCM key_scm = SCM_CAR (path_scm);
+        char *key;
+        gchar* gkey;
+        if (!scm_is_string (key_scm))
+            break;
+        key = scm_to_locale_string (key_scm);
+        gkey = g_strdup (key);
+        free (key);
+        path = g_list_prepend (path, gkey);
+        path_scm = SCM_CDR (path_scm);
+    }
+    $1 = g_list_reverse (path);
+}
+Process *gnc_spawn_process_async(GList *argl, const gboolean search_path);
+%clear GList *;
+
+gint gnc_process_get_fd(const Process *proc, const guint std_fd);
+void gnc_detach_process(Process *proc, const gboolean kill_it);
diff --git a/bindings/guile/glib-guile.c b/bindings/guile/glib-guile.c
index 943494cbc..cab6c91a8 100644
--- a/bindings/guile/glib-guile.c
+++ b/bindings/guile/glib-guile.c
@@ -24,14 +24,45 @@
 
 #include <config.h>
 
+#include <errno.h>
 #include <string.h>
 #include <glib.h>
+
+#ifdef __MINGW32__
+#define _GL_UNISTD_H //Deflect poisonous define of close in Guile's GnuLib
+#endif
+#include <libguile.h>
+#ifdef HAVE_UNISTD_H
+# ifdef close
+#  undef close
+# endif
+# include <unistd.h>
+#else
+# include <io.h>
+# define close _close
+#endif
+
 #include <libguile.h>
 #include "swig-runtime.h"
 #include "guile-mappings.h"
+#include "gnc-glib-utils.h"
 #include "gnc-guile-utils.h"
 #include "glib-guile.h"
 
+#include <platform.h>
+#if PLATFORM(WINDOWS)
+#include <winsock.h>
+#include <windows.h>
+#endif
+
+#include "qof.h"
+#include "gnc-engine-guile.h"
+
+
+#define UNUSED_VAR     __attribute__ ((unused))
+
+/* This static indicates the debugging module this .o belongs to.  */
+static QofLogModule UNUSED_VAR log_module = GNC_MOD_GUILE;
 
 static SCM
 glist_to_scm_list_helper(GList *glist, swig_type_info *wct)
@@ -173,3 +204,139 @@ gnc_glist_string_p(SCM list)
 {
     return scm_is_list(list);
 }
+
+struct _Process
+{
+    GPid pid;
+    gint fd_stdin;
+    gint fd_stdout;
+    gint fd_stderr;
+    gboolean dead;
+    gboolean detached;
+};
+
+static void
+on_child_exit (GPid pid, gint status, gpointer data)
+{
+    Process *proc = data;
+    g_return_if_fail (proc && proc->pid == pid);
+
+    g_spawn_close_pid (proc->pid);
+
+    /* free if the process is both dead and detached */
+    if (!proc->detached)
+        proc->dead = TRUE;
+    else
+        g_free (proc);
+}
+
+Process *
+gnc_spawn_process_async (GList *argl, const gboolean search_path)
+{
+    gboolean retval;
+    Process *proc;
+    GList *l_iter;
+    guint argc;
+    gchar **argv, **v_iter;
+    GSpawnFlags flags;
+    GError *error = NULL;
+
+    proc = g_new0 (Process, 1);
+
+    argc = g_list_length (argl);
+    argv = g_malloc ((argc + 1) * sizeof(gchar*));
+
+    for (l_iter = argl, v_iter = argv; l_iter; l_iter = l_iter->next, v_iter++)
+    {
+        *v_iter = (gchar*) l_iter->data;
+    }
+    *v_iter = NULL;
+    g_list_free (argl);
+
+    flags = G_SPAWN_DO_NOT_REAP_CHILD;
+    if (search_path)
+        flags |= G_SPAWN_SEARCH_PATH;
+
+    retval = g_spawn_async_with_pipes (
+        NULL, argv, NULL, flags, NULL, NULL, &proc->pid,
+        &proc->fd_stdin, &proc->fd_stdout, &proc->fd_stderr, &error);
+
+    if (retval)
+    {
+        g_child_watch_add (proc->pid, on_child_exit, proc);
+    }
+    else
+    {
+        g_warning ("Could not spawn %s: %s", *argv ? *argv : "(null)",
+                   error->message ? error->message : "(null)");
+        g_free (proc);
+        proc = NULL;
+    }
+    g_strfreev (argv);
+
+    return proc;
+}
+
+gint
+gnc_process_get_fd (const Process *proc, const gint std_fd)
+{
+    const gint *retptr = NULL;
+    g_return_val_if_fail (proc, -1);
+
+    if (std_fd == 0)
+        retptr = &proc->fd_stdin;
+    else if (std_fd == 1)
+        retptr = &proc->fd_stdout;
+    else if (std_fd == 2)
+        retptr = &proc->fd_stderr;
+    else
+        g_return_val_if_reached (-1);
+
+    if (*retptr == -1)
+        g_warning ("Pipe to childs file descriptor %d is -1", std_fd);
+    return *retptr;
+}
+
+void
+gnc_detach_process (Process *proc, const gboolean kill_it)
+{
+    g_return_if_fail (proc && proc->pid);
+
+    errno = 0;
+    close (proc->fd_stdin);
+    if (errno)
+    {
+        g_message ("Close of childs stdin (%d) failed: %s", proc->fd_stdin,
+                   g_strerror (errno));
+        errno = 0;
+    }
+    close (proc->fd_stdout);
+    if (errno)
+    {
+        g_message ("Close of childs stdout (%d) failed: %s", proc->fd_stdout,
+                   g_strerror(errno));
+        errno = 0;
+    }
+    close (proc->fd_stderr);
+    if (errno)
+    {
+        g_message ("Close of childs stderr (%d) failed: %s", proc->fd_stderr,
+                   g_strerror(errno));
+        errno = 0;
+    }
+
+    if (kill_it && !proc->dead)
+    {
+        /* give it a chance to die */
+        while (g_main_context_iteration (NULL, FALSE) && !proc->dead)
+            ;
+        if (!proc->dead)
+            gnc_gpid_kill (proc->pid);
+    }
+
+    /* free if the process is both dead and detached */
+    if (!proc->dead)
+        proc->detached = TRUE;
+    else
+        g_free (proc);
+}
diff --git a/bindings/guile/glib-guile.h b/bindings/guile/glib-guile.h
index f2f69f194..2b1e6d047 100644
--- a/bindings/guile/glib-guile.h
+++ b/bindings/guile/glib-guile.h
@@ -37,6 +37,40 @@ int     gnc_glist_string_p(SCM list);
 
 GSList * gnc_scm_to_gslist_string(SCM list);
 
+/** An opaque process structure returned by gnc_spawn_process_async. */
+typedef struct _Process Process;
 
+/** Wraps g_spawn_async_with_pipes minimally.  Use gnc_process_get_fd to access
+ *  the file descriptors to the child.  To close them and free the memory
+ *  allocated for the process once it has exited, call gnc_detach_process.
+ *
+ *  @param argl A list of null-terminated strings used as arguments for spawning,
+ *  i.e. "perl" "-w" "my-perl-script".  Will be freed inside.
+ *
+ *  @param search_path Determines whether the first element of argl will be
+ *  looked for in the user's PATH.
+ *
+ *  @return A pointer to a structure representing the process or NULL on failure.
+ */
+Process *gnc_spawn_process_async(GList *argl, const gboolean search_path);
+
+/** Accesses a given process structure and returns the file descriptor connected
+ *  to the childs stdin, stdout or stderr.
+ *
+ *  @param proc A process structure returned by gnc_spawn_process_async.
+ *
+ *  @param std_fd 0, 1 or 2.
+ *
+ *  @return The file descriptor to write to the child on 0, or read from the
+ *  childs output or error on 1 or 2, resp. */
+gint gnc_process_get_fd(const Process *proc, const gint std_fd);
+
+/** Close the file descriptors to a given process and declare it as detached.  If
+ *  it is both dead and detached, the allocated memory will be freed.
+ *
+ *  @param proc A process structure returned by gnc_spawn_process_async.
+ *
+ *  @param kill_it If TRUE, kill the process. */
+void gnc_detach_process(Process *proc, const gboolean kill_it);
 
 #endif
diff --git a/bindings/guile/gnc-engine-guile.c b/bindings/guile/gnc-engine-guile.c
index c047fa6d4..06daad9e2 100644
--- a/bindings/guile/gnc-engine-guile.c
+++ b/bindings/guile/gnc-engine-guile.c
@@ -40,6 +40,11 @@
 #include <qof.h>
 #include <qofbookslots.h>
 
+
+#ifndef HAVE_STRPTIME
+#    include "strptime.h"
+#endif
+
 /** \todo Code dependent on the private query headers
 qofquery-p.h and qofquerycore-p.h may need to be modified.
 These files are temporarily exported for QOF 0.6.0 but
@@ -1887,3 +1892,17 @@ gnc_hook_add_scm_dangler (const gchar *name, SCM proc)
                          (GDestroyNotify) delete_scm_hook, scm);
     LEAVE("");
 }
+
+time64
+gnc_parse_time_to_time64 (const gchar *s, const gchar *format)
+{
+    struct tm tm;
+
+    g_return_val_if_fail(s && format, -1);
+
+    if (!strptime(s, format, &tm))
+        return -1;
+
+    return gnc_mktime(&tm);
+}
+
diff --git a/bindings/guile/gnc-engine-guile.h b/bindings/guile/gnc-engine-guile.h
index 3f7397219..ed9b0b232 100644
--- a/bindings/guile/gnc-engine-guile.h
+++ b/bindings/guile/gnc-engine-guile.h
@@ -63,4 +63,14 @@ SCM gnc_account_value_ptr_to_scm (GncAccountValue *);
  * add Scheme-style danglers from a hook
  */
 void gnc_hook_add_scm_dangler(const gchar *name, SCM proc);
+
+/** Convert a time string to calendar time representation.  Combine strptime and
+ *  mktime into a single function to avoid the need to wrap struct tm *.
+ *
+ *  @param s String representation of time.
+ *
+ *  @param format Format specification.
+ *
+ *  @return The time in seconds since unix epoch, or -1 on error */
+time64 gnc_parse_time_to_time64 (const gchar *s, const gchar *format);
 #endif
diff --git a/bindings/guile/price-quotes.scm b/bindings/guile/price-quotes.scm
index 8a8bbc044..37b7292bc 100644
--- a/bindings/guile/price-quotes.scm
+++ b/bindings/guile/price-quotes.scm
@@ -33,7 +33,6 @@
              (srfi srfi-1))
 
 (gnc:module-load "gnucash/gnome-utils" 0) ;; for gnucash-ui-is-running
-(gnc:module-load "gnucash/app-utils" 0)
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
diff --git a/gnucash/gnome-utils/dialog-options.c b/gnucash/gnome-utils/dialog-options.c
index cb16e15a5..13aa234cf 100644
--- a/gnucash/gnome-utils/dialog-options.c
+++ b/gnucash/gnome-utils/dialog-options.c
@@ -50,7 +50,6 @@
 #include "gnc-gui-query.h"
 #include "gnc-session.h"
 #include "gnc-ui.h"
-#include "guile-util.h"
 #include "gnc-guile-utils.h"
 #include "option-util.h"
 #include "guile-mappings.h"
diff --git a/gnucash/gnome-utils/dialog-utils.c b/gnucash/gnome-utils/dialog-utils.c
index d5d7c2dd4..a5dffd35a 100644
--- a/gnucash/gnome-utils/dialog-utils.c
+++ b/gnucash/gnome-utils/dialog-utils.c
@@ -43,7 +43,6 @@
 #include "gnc-ui-util.h"
 #include "gnc-prefs.h"
 #include "gnc-combott.h"
-#include "guile-util.h"
 #include "gnc-main-window.h"
 
 /* This static indicates the debugging module that this .o belongs to. */
diff --git a/gnucash/gnome-utils/gnc-menu-extensions.c b/gnucash/gnome-utils/gnc-menu-extensions.c
index e9527dad3..eea7b7241 100644
--- a/gnucash/gnome-utils/gnc-menu-extensions.c
+++ b/gnucash/gnome-utils/gnc-menu-extensions.c
@@ -26,7 +26,7 @@
 #include <glib/gi18n.h>
 #include <ctype.h>
 
-#include "guile-util.h"
+#include "gnc-guile-utils.h"
 #include "gnc-engine.h"
 #include "gnc-menu-extensions.h"
 #include "gnc-ui.h"
diff --git a/gnucash/gnome-utils/gnc-plugin-menu-additions.c b/gnucash/gnome-utils/gnc-plugin-menu-additions.c
index c32c8f31d..18c87811c 100644
--- a/gnucash/gnome-utils/gnc-plugin-menu-additions.c
+++ b/gnucash/gnome-utils/gnc-plugin-menu-additions.c
@@ -40,7 +40,6 @@
 #include "swig-runtime.h"
 #include "guile-mappings.h"
 
-#include "guile-util.h"
 #include "gnc-engine.h"
 #include "gnc-plugin-menu-additions.h"
 #include "gnc-window.h"
diff --git a/gnucash/gnome/dialog-price-edit-db.c b/gnucash/gnome/dialog-price-edit-db.c
index 7f64d1673..937dfe792 100644
--- a/gnucash/gnome/dialog-price-edit-db.c
+++ b/gnucash/gnome/dialog-price-edit-db.c
@@ -48,7 +48,6 @@
 #include "gnc-warnings.h"
 #include "swig-runtime.h"
 #include "guile-mappings.h"
-#include "guile-util.h"
 #include "gnc-engine-guile.h"
 
 
diff --git a/gnucash/gnome/dialog-price-editor.c b/gnucash/gnome/dialog-price-editor.c
index 6f792fc14..3d9e62db2 100644
--- a/gnucash/gnome/dialog-price-editor.c
+++ b/gnucash/gnome/dialog-price-editor.c
@@ -45,7 +45,6 @@
 #include "gnc-ui.h"
 #include "gnc-ui-util.h"
 #include "gnc-warnings.h"
-#include "guile-util.h"
 #include "engine-helpers.h"
 
 
diff --git a/gnucash/gnome/dialog-tax-info.c b/gnucash/gnome/dialog-tax-info.c
index 2c00b6218..464c69395 100644
--- a/gnucash/gnome/dialog-tax-info.c
+++ b/gnucash/gnome/dialog-tax-info.c
@@ -30,7 +30,6 @@
 #include <glib/gi18n.h>
 #include <libguile.h>
 #include "guile-mappings.h"
-#include "guile-util.h"
 #include "gnc-guile-utils.h"
 #include "gnc-module.h"
 
diff --git a/gnucash/gnome/top-level.c b/gnucash/gnome/top-level.c
index 069c83db9..2d3023c86 100644
--- a/gnucash/gnome/top-level.c
+++ b/gnucash/gnome/top-level.c
@@ -70,7 +70,6 @@
 #include "gnucash-color.h"
 #include "gnucash-sheet.h"
 #include "gnucash-style.h"
-#include "guile-util.h"
 #include "search-core-type.h"
 #include "search-owner.h"
 #include "top-level.h"
diff --git a/gnucash/gnome/window-autoclear.c b/gnucash/gnome/window-autoclear.c
index 2b7b75042..608dc0e70 100644
--- a/gnucash/gnome/window-autoclear.c
+++ b/gnucash/gnome/window-autoclear.c
@@ -37,7 +37,6 @@
 #include "gnc-main-window.h"
 #include "gnc-plugin-page-register.h"
 #include "gnc-ui.h"
-#include "guile-util.h"
 #include "window-autoclear.h"
 
 #define WINDOW_AUTOCLEAR_CM_CLASS "window-autoclear"
diff --git a/gnucash/gnome/window-reconcile.c b/gnucash/gnome/window-reconcile.c
index 4b139d50f..29e847e96 100644
--- a/gnucash/gnome/window-reconcile.c
+++ b/gnucash/gnome/window-reconcile.c
@@ -55,7 +55,6 @@
 #include "gnc-ui.h"
 #include "gnc-ui-balances.h"
 #include "gnc-window.h"
-#include "guile-util.h"
 #include "reconcile-view.h"
 #include "window-reconcile.h"
 #ifdef MAC_INTEGRATION
diff --git a/gnucash/gnome/window-reconcile2.c b/gnucash/gnome/window-reconcile2.c
index ae08abd4f..66b6c7551 100644
--- a/gnucash/gnome/window-reconcile2.c
+++ b/gnucash/gnome/window-reconcile2.c
@@ -54,7 +54,6 @@
 #include "gnc-ui.h"
 #include "gnc-ui-balances.h"
 #include "gnc-window.h"
-#include "guile-util.h"
 #include "reconcile-view.h"
 #include "window-reconcile2.h"
 
diff --git a/gnucash/register/ledger-core/split-register.c b/gnucash/register/ledger-core/split-register.c
index 1f0cb5813..d18f1e638 100644
--- a/gnucash/register/ledger-core/split-register.c
+++ b/gnucash/register/ledger-core/split-register.c
@@ -38,7 +38,6 @@
 #include "gnc-prefs.h"
 #include "gnc-ui.h"
 #include "gnc-warnings.h"
-#include "guile-util.h"
 #include "split-register-copy-ops.h"
 #include "numcell.h"
 #include "pricecell.h"
diff --git a/libgnucash/app-utils/CMakeLists.txt b/libgnucash/app-utils/CMakeLists.txt
index 4a74d52ce..9e47e3a10 100644
--- a/libgnucash/app-utils/CMakeLists.txt
+++ b/libgnucash/app-utils/CMakeLists.txt
@@ -30,7 +30,6 @@ set (app_utils_HEADERS
   gnc-sx-instance-model.h
   gnc-ui-util.h
   gnc-ui-balances.h
-  guile-util.h
   option-util.h
 )
 
@@ -69,7 +68,6 @@ set (app_utils_SOURCES
   gnc-ui-util.c
   gnc-ui-balances.c
   gncmod-app-utils.c
-  guile-util.c
   option-util.c
 )
 
diff --git a/libgnucash/app-utils/app-utils.i b/libgnucash/app-utils/app-utils.i
index 15c3f4ed8..9b24346c0 100644
--- a/libgnucash/app-utils/app-utils.i
+++ b/libgnucash/app-utils/app-utils.i
@@ -31,7 +31,6 @@
 #include <gnc-accounting-period.h>
 #include <gnc-session.h>
 #include <gnc-component-manager.h>
-#include <guile-util.h>
 #include <gnc-sx-instance-model.h>
 
 #include "gnc-engine-guile.h"
@@ -120,32 +119,6 @@ time64 gnc_accounting_period_fiscal_end(void);
 
 void gnc_register_kvp_option_generator(QofIdType id_type, SCM generator);
 
-%typemap(in) GList * {
-  SCM path_scm = $input;
-  GList *path = NULL;
-  while (!scm_is_null (path_scm))
-  {
-    SCM key_scm = SCM_CAR (path_scm);
-    char *key;
-    gchar* gkey;
-    if (!scm_is_string (key_scm))
-      break;
-    key = scm_to_locale_string (key_scm);
-    gkey = g_strdup (key);
-    free (key);
-    path = g_list_prepend (path, gkey);
-    path_scm = SCM_CDR (path_scm);
-  }
-  $1 = g_list_reverse (path);
-}
-Process *gnc_spawn_process_async(GList *argl, const gboolean search_path);
-%clear GList *;
-
-gint gnc_process_get_fd(const Process *proc, const guint std_fd);
-void gnc_detach_process(Process *proc, const gboolean kill_it);
-
-time64 gnc_parse_time_to_time64(const gchar *s, const gchar *format);
-
 %typemap(out) GHashTable * {
   SCM table = scm_c_make_hash_table (g_hash_table_size($1) + 17);
   GHashTableIter iter;
diff --git a/libgnucash/app-utils/guile-util.c b/libgnucash/app-utils/guile-util.c
deleted file mode 100644
index 1142f9f96..000000000
--- a/libgnucash/app-utils/guile-util.c
+++ /dev/null
@@ -1,214 +0,0 @@
-/********************************************************************\
- * guile-util.c -- utility functions for using guile for GnuCash    *
- * Copyright (C) 1999 Linas Vepstas                                 *
- * Copyright (C) 2000 Dave Peticolas                                *
- * Copyright (C) 2017 Aaron Laws                                    *
- *                                                                  *
- * This program is free software; you can redistribute it and/or    *
- * modify it under the terms of the GNU General Public License as   *
- * published by the Free Software Foundation; either version 2 of   *
- * the License, or (at your option) any later version.              *
- *                                                                  *
- * This program is distributed in the hope that it will be useful,  *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
- * GNU General Public License for more details.                     *
- *                                                                  *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, write to the Free Software      *
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.        *
-\********************************************************************/
-
-#include <config.h>
-
-#include "swig-runtime.h"
-#include <platform.h>
-#if PLATFORM(WINDOWS)
-#include <winsock.h>
-#include <windows.h>
-#endif
-
-#include <glib.h>
-#include <glib/gi18n.h>
-#include <string.h>
-#ifdef __MINGW32__
-#define _GL_UNISTD_H //Deflect poisonous define of close in Guile's GnuLib
-#endif
-#include <libguile.h>
-#include <errno.h>
-#ifdef HAVE_UNISTD_H
-# ifdef close
-#  undef close
-# endif
-# include <unistd.h>
-#else
-# include <io.h>
-# define close _close
-#endif
-#ifndef HAVE_STRPTIME
-#    include "strptime.h"
-#endif
-
-#include "qof.h"
-#include "gnc-engine-guile.h"
-#include "glib-guile.h"
-#include "gnc-glib-utils.h"
-#include "gnc-guile-utils.h"
-#include "gnc-prefs.h"
-#include "guile-util.h"
-#include "guile-mappings.h"
-
-#define UNUSED_VAR     __attribute__ ((unused))
-
-/* This static indicates the debugging module this .o belongs to.  */
-static QofLogModule UNUSED_VAR log_module = GNC_MOD_GUILE;
-
-struct _Process
-{
-    GPid pid;
-    gint fd_stdin;
-    gint fd_stdout;
-    gint fd_stderr;
-    gboolean dead;
-    gboolean detached;
-};
-
-static void
-on_child_exit (GPid pid, gint status, gpointer data)
-{
-    Process *proc = data;
-    g_return_if_fail (proc && proc->pid == pid);
-
-    g_spawn_close_pid (proc->pid);
-
-    /* free if the process is both dead and detached */
-    if (!proc->detached)
-        proc->dead = TRUE;
-    else
-        g_free (proc);
-}
-
-Process *
-gnc_spawn_process_async (GList *argl, const gboolean search_path)
-{
-    gboolean retval;
-    Process *proc;
-    GList *l_iter;
-    guint argc;
-    gchar **argv, **v_iter;
-    GSpawnFlags flags;
-    GError *error = NULL;
-
-    proc = g_new0 (Process, 1);
-
-    argc = g_list_length (argl);
-    argv = g_malloc ((argc + 1) * sizeof(gchar*));
-
-    for (l_iter = argl, v_iter = argv; l_iter; l_iter = l_iter->next, v_iter++)
-    {
-        *v_iter = (gchar*) l_iter->data;
-    }
-    *v_iter = NULL;
-    g_list_free (argl);
-
-    flags = G_SPAWN_DO_NOT_REAP_CHILD;
-    if (search_path)
-        flags |= G_SPAWN_SEARCH_PATH;
-
-    retval = g_spawn_async_with_pipes (
-                 NULL, argv, NULL, flags, NULL, NULL, &proc->pid,
-                 &proc->fd_stdin, &proc->fd_stdout, &proc->fd_stderr, &error);
-
-    if (retval)
-    {
-        g_child_watch_add (proc->pid, on_child_exit, proc);
-    }
-    else
-    {
-        g_warning ("Could not spawn %s: %s", *argv ? *argv : "(null)",
-                   error->message ? error->message : "(null)");
-        g_free (proc);
-        proc = NULL;
-    }
-    g_strfreev (argv);
-
-    return proc;
-}
-
-gint
-gnc_process_get_fd (const Process *proc, const gint std_fd)
-{
-    const gint *retptr = NULL;
-    g_return_val_if_fail (proc, -1);
-
-    if (std_fd == 0)
-        retptr = &proc->fd_stdin;
-    else if (std_fd == 1)
-        retptr = &proc->fd_stdout;
-    else if (std_fd == 2)
-        retptr = &proc->fd_stderr;
-    else
-        g_return_val_if_reached (-1);
-
-    if (*retptr == -1)
-        g_warning ("Pipe to childs file descriptor %d is -1", std_fd);
-    return *retptr;
-}
-
-void
-gnc_detach_process (Process *proc, const gboolean kill_it)
-{
-    g_return_if_fail (proc && proc->pid);
-
-    errno = 0;
-    close (proc->fd_stdin);
-    if (errno)
-    {
-        g_message ("Close of childs stdin (%d) failed: %s", proc->fd_stdin,
-                   g_strerror (errno));
-        errno = 0;
-    }
-    close (proc->fd_stdout);
-    if (errno)
-    {
-        g_message ("Close of childs stdout (%d) failed: %s", proc->fd_stdout,
-                   g_strerror(errno));
-        errno = 0;
-    }
-    close (proc->fd_stderr);
-    if (errno)
-    {
-        g_message ("Close of childs stderr (%d) failed: %s", proc->fd_stderr,
-                   g_strerror(errno));
-        errno = 0;
-    }
-
-    if (kill_it && !proc->dead)
-    {
-        /* give it a chance to die */
-        while (g_main_context_iteration (NULL, FALSE) && !proc->dead)
-            ;
-        if (!proc->dead)
-            gnc_gpid_kill (proc->pid);
-    }
-
-    /* free if the process is both dead and detached */
-    if (!proc->dead)
-        proc->detached = TRUE;
-    else
-        g_free (proc);
-}
-
-
-time64
-gnc_parse_time_to_time64 (const gchar *s, const gchar *format)
-{
-    struct tm tm;
-
-    g_return_val_if_fail(s && format, -1);
-
-    if (!strptime(s, format, &tm))
-        return -1;
-
-    return gnc_mktime(&tm);
-}
diff --git a/libgnucash/app-utils/guile-util.h b/libgnucash/app-utils/guile-util.h
deleted file mode 100644
index a0a3c94a1..000000000
--- a/libgnucash/app-utils/guile-util.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/********************************************************************\
- * guile-util.h -- utility functions for using guile for GnuCash    *
- * Copyright (C) 1999 Linas Vepstas                                 *
- * Copyright (C) 2017 Aaron Laws                                    *
- *                                                                  *
- * This program is free software; you can redistribute it and/or    *
- * modify it under the terms of the GNU General Public License as   *
- * published by the Free Software Foundation; either version 2 of   *
- * the License, or (at your option) any later version.              *
- *                                                                  *
- * This program is distributed in the hope that it will be useful,  *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
- * GNU General Public License for more details.                     *
- *                                                                  *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact:                        *
- *                                                                  *
- * Free Software Foundation           Voice:  +1-617-542-5942       *
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
- * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
- *                                                                  *
-\********************************************************************/
-
-#ifndef GUILE_UTIL_H
-#define GUILE_UTIL_H
-
-#include <glib.h>
-#include <libguile.h>
-
-#include "qof.h"
-#include "Account.h"
-#include "gnc-guile-utils.h"
-
-/** An opaque process structure returned by gnc_spawn_process_async. */
-typedef struct _Process Process;
-
-/** Wraps g_spawn_async_with_pipes minimally.  Use gnc_process_get_fd to access
- *  the file descriptors to the child.  To close them and free the memory
- *  allocated for the process once it has exited, call gnc_detach_process.
- *
- *  @param argl A list of null-terminated strings used as arguments for spawning,
- *  i.e. "perl" "-w" "my-perl-script".  Will be freed inside.
- *
- *  @param search_path Determines whether the first element of argl will be
- *  looked for in the user's PATH.
- *
- *  @return A pointer to a structure representing the process or NULL on failure.
- */
-Process *gnc_spawn_process_async(GList *argl, const gboolean search_path);
-
-/** Accesses a given process structure and returns the file descriptor connected
- *  to the childs stdin, stdout or stderr.
- *
- *  @param proc A process structure returned by gnc_spawn_process_async.
- *
- *  @param std_fd 0, 1 or 2.
- *
- *  @return The file descriptor to write to the child on 0, or read from the
- *  childs output or error on 1 or 2, resp. */
-gint gnc_process_get_fd(const Process *proc, const gint std_fd);
-
-/** Close the file descriptors to a given process and declare it as detached.  If
- *  it is both dead and detached, the allocated memory will be freed.
- *
- *  @param proc A process structure returned by gnc_spawn_process_async.
- *
- *  @param kill_it If TRUE, kill the process. */
-void gnc_detach_process(Process *proc, const gboolean kill_it);
-
-/** Convert a time string to calendar time representation.  Combine strptime and
- *  mktime into a single function to avoid the need to wrap struct tm *.
- *
- *  @param s String representation of time.
- *
- *  @param format Format specification.
- *
- *  @return The time in seconds since unix epoch, or -1 on error */
-time64 gnc_parse_time_to_time64 (const gchar *s, const gchar *format);
-
-#endif
diff --git a/libgnucash/app-utils/option-util.c b/libgnucash/app-utils/option-util.c
index 639cb212f..3ae27a74c 100644
--- a/libgnucash/app-utils/option-util.c
+++ b/libgnucash/app-utils/option-util.c
@@ -29,7 +29,6 @@
 
 #include "Account.h"
 #include "option-util.h"
-#include "glib-guile.h"
 #include "gnc-guile-utils.h"
 #include "qof.h"
 #include "swig-runtime.h"
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 7b4bd4ab2..dcd38babc 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -540,7 +540,6 @@ libgnucash/app-utils/gnc-state.c
 libgnucash/app-utils/gnc-sx-instance-model.c
 libgnucash/app-utils/gnc-ui-balances.c
 libgnucash/app-utils/gnc-ui-util.c
-libgnucash/app-utils/guile-util.c
 libgnucash/app-utils/options.scm
 libgnucash/app-utils/option-util.c
 libgnucash/app-utils/QuickFill.c

commit 9ed962136325698394cf16fb8d660abc3b8c5c6a
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sun Nov 17 18:15:09 2019 +0100

    app-utils - remove unused guile includes

diff --git a/libgnucash/app-utils/gnc-gsettings.c b/libgnucash/app-utils/gnc-gsettings.c
index d692f16fe..34ecd39cb 100644
--- a/libgnucash/app-utils/gnc-gsettings.c
+++ b/libgnucash/app-utils/gnc-gsettings.c
@@ -28,8 +28,6 @@
 #include <string.h>
 #include "gnc-gsettings.h"
 #include "gnc-path.h"
-#include "guile-mappings.h"
-#include <libguile.h>
 #include "qof.h"
 #include "gnc-prefs-p.h"
 

commit d777128e6f30be8528988bc1766226a00ba64add
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sun Nov 10 18:15:34 2019 +0100

    app-utils - simplify and move gettext wrappers
    
    1. Instead of creating a C wrapper around gettext to then wrap in
    guile, use guile's builtin gettext support directly.
    
    The code still defines the _ and N_ shorthands. However it doesn't
    really warant a separate module just for these two shorthands.
    Instead define them in core-utils. So all code wanting to use
    _ or N_ in guile should now use the (gnucash core-utils) module.
    
    The bulk of this commit is actually deleting the scm-gettext
    target and using (gnucash core-utils) instead of (gnucash gettext).
    
    2. As the definition of _ and N_ is removed from app-utils.scm,
    the app-utils test for a functional N_ macro has been moved to a
    new test file in the guile bindinds tests.
    
    3. The (gnucash gettext) module has been deprecated. Use
    (gnucash core-utils) from now on.

diff --git a/bindings/guile/core-utils.scm b/bindings/guile/core-utils.scm
index 82cb17c63..26ce6d40d 100644
--- a/bindings/guile/core-utils.scm
+++ b/bindings/guile/core-utils.scm
@@ -37,3 +37,9 @@
      (module-use! i (resolve-interface '(sw_core_utils))))
 
 (define-public gnc:version (gnc-version))
+;; gettext functions
+(define-public _ gettext)
+(define-syntax N_
+    (syntax-rules ()
+        ((_ x) x)))
+(export N_)
diff --git a/bindings/guile/test/CMakeLists.txt b/bindings/guile/test/CMakeLists.txt
index 8117b2288..f1ac9c6b6 100644
--- a/bindings/guile/test/CMakeLists.txt
+++ b/bindings/guile/test/CMakeLists.txt
@@ -24,7 +24,8 @@ gnc_add_test_with_guile(test-scm-query test-scm-query.cpp ENGINE_TEST_INCLUDE_DI
 # Scheme tests
 
 
-set(engine_test_SCHEME
+set(bindings_test_SCHEME
+    test-core-utils.scm
     test-create-account.scm
 )
 
@@ -33,6 +34,7 @@ set(engine_test_SCHEME
 set(GUILE_DEPENDS
     scm-gnc-module
     scm-app-utils
+    scm-core-utils
     scm-engine)
 
 gnc_add_scheme_test_targets(scm-test-engine-extras
@@ -46,7 +48,7 @@ gnc_add_scheme_test_targets(scm-test-engine-extras
 gnc_add_scheme_deprecated_module ("gnucash engine test test-extras" "tests test-engine-extras" "scm-test-engine-extras" "")
 
 gnc_add_scheme_test_targets(scm-test-engine
-    "${engine_test_SCHEME}"
+    "${bindings_test_SCHEME}"
     "tests"
     "${GUILE_DEPENDS};scm-test-engine-extras"
     FALSE
@@ -113,7 +115,7 @@ endif (HAVE_SRFI64)
 
 set(test_engine_SCHEME_DIST
     srfi64-extras.scm
-    test-create-account.scm
+    ${bindings_test_SCHEME}
     test-engine-extras.scm
     test-scm-query-import.scm
     test-business-core.scm
diff --git a/bindings/guile/test/test-core-utils.scm b/bindings/guile/test/test-core-utils.scm
new file mode 100644
index 000000000..bad12914e
--- /dev/null
+++ b/bindings/guile/test/test-core-utils.scm
@@ -0,0 +1,17 @@
+(define exit-code 0)
+(setenv "GNC_UNINSTALLED" "1")
+(use-modules (gnucash core-utils))
+
+(if (macro? (module-ref (current-module) 'N_))
+    (display "Macro N_ defined\n")
+    (begin
+      (display "Failed - macro N_ not defined\n")
+      (set! exit-code -1)))
+
+(if (string=? (N_ "foobar") "foobar")
+    (display "Macro N_ works properly\n")
+    (begin
+      (display "Failed - macro N_ doesn't work\n")
+      (set! exit-code -1)))
+
+(exit exit-code)
diff --git a/gnucash/gnome/CMakeLists.txt b/gnucash/gnome/CMakeLists.txt
index 7c4707d4b..e6a62c9a7 100644
--- a/gnucash/gnome/CMakeLists.txt
+++ b/gnucash/gnome/CMakeLists.txt
@@ -229,7 +229,7 @@ set(GUILE_OUTPUT_DIR   gnucash)
 set(GUILE_DEPENDS
     gncmod-gnome-utils
     scm-engine
-    scm-gettext
+    scm-core-utils
     scm-gnome-utils
     scm-gnc-module
     scm-report
diff --git a/gnucash/gnome/report-menus.scm b/gnucash/gnome/report-menus.scm
index 6a2e4513b..50f52aa2d 100644
--- a/gnucash/gnome/report-menus.scm
+++ b/gnucash/gnome/report-menus.scm
@@ -30,7 +30,6 @@
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gnome-utils))
-(use-modules (gnucash gettext))
 (use-modules (gnucash reports standard dashboard))
 
 (eval-when (compile load eval expand)
diff --git a/gnucash/import-export/qif-imp/test/CMakeLists.txt b/gnucash/import-export/qif-imp/test/CMakeLists.txt
index a6c2d209d..e44f88539 100644
--- a/gnucash/import-export/qif-imp/test/CMakeLists.txt
+++ b/gnucash/import-export/qif-imp/test/CMakeLists.txt
@@ -14,7 +14,7 @@ set (GUILE_DEPENDS
   scm-app-utils
   scm-engine
   scm-test-engine
-  scm-gettext
+  scm-core-utils
   scm-qif-import
 )
 gnc_add_test(test-link-qif-imp test-link.c QIF_IMP_TEST_INCLUDE_DIRS QIF_IMP_TEST_LIBS)
diff --git a/gnucash/report/html-fonts.scm b/gnucash/report/html-fonts.scm
index c74b8550a..f044d7d04 100644
--- a/gnucash/report/html-fonts.scm
+++ b/gnucash/report/html-fonts.scm
@@ -25,7 +25,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (define (string-strip s1 s2)
   (let ((idx (string-contains-ci s1 s2)))
diff --git a/gnucash/report/html-style-sheet.scm b/gnucash/report/html-style-sheet.scm
index cab11af6e..9a05c3116 100644
--- a/gnucash/report/html-style-sheet.scm
+++ b/gnucash/report/html-style-sheet.scm
@@ -22,7 +22,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (use-modules (ice-9 match))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (define *gnc:_style-sheet-templates_* (make-hash-table 23))
 (define *gnc:_style-sheets_* (make-hash-table 23))
diff --git a/gnucash/report/options-utilities.scm b/gnucash/report/options-utilities.scm
index e909e01b8..dfef6dc1b 100644
--- a/gnucash/report/options-utilities.scm
+++ b/gnucash/report/options-utilities.scm
@@ -21,7 +21,7 @@
 ;; Boston, MA  02110-1301,  USA       gnu at gnu.org
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 ;; These are just a bunch of options which were useful in several
 ;; reports and hence they got defined in a separate function.
diff --git a/gnucash/report/report-core.scm b/gnucash/report/report-core.scm
index a3a3c71db..0ac575012 100644
--- a/gnucash/report/report-core.scm
+++ b/gnucash/report/report-core.scm
@@ -23,7 +23,7 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash app-utils))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 (eval-when (compile load eval expand)
   (load-extension "libgncmod-report" "scm_init_sw_report_module"))
 (use-modules (sw_report))
diff --git a/gnucash/report/report-utilities.scm b/gnucash/report/report-utilities.scm
index 387de06a4..10ce7e55e 100644
--- a/gnucash/report/report-utilities.scm
+++ b/gnucash/report/report-utilities.scm
@@ -609,15 +609,15 @@
 (define (gnc:report-starting report-name)
   (gnc-window-show-progress (format #f
 				     (_ "Building '~a' report ...")
-				     (gnc:gettext report-name))
+				     (_ report-name))
 			    0))
 
 (define (gnc:report-render-starting report-name)
   (gnc-window-show-progress (format #f
 				     (_ "Rendering '~a' report ...")
 				     (if (string-null? report-name)
-					 (gnc:gettext "Untitled")
-					 (gnc:gettext report-name)))
+					 (_ "Untitled")
+					 (_ report-name)))
 			    0))
 
 (define (gnc:report-percent-done percent)
diff --git a/gnucash/report/reports/CMakeLists.txt b/gnucash/report/reports/CMakeLists.txt
index 18f6144db..aba85f16d 100644
--- a/gnucash/report/reports/CMakeLists.txt
+++ b/gnucash/report/reports/CMakeLists.txt
@@ -75,7 +75,7 @@ set(scm_rpts_GUILE_DEPENDS
   gncmod-html
   scm-core-utils
   scm-engine
-  scm-gettext
+  scm-core-utils
   scm-gnome-utils
   scm-report
   )
@@ -84,7 +84,7 @@ set(scm_rpt_example_GUILE_DEPENDS
   gncmod-html
   scm-app-utils
   scm-core-utils
-  scm-gettext
+  scm-core-utils
   scm-gnc-module
   scm-engine
   scm-reports-example-links
@@ -95,7 +95,7 @@ set(scm_rpt_example_GUILE_DEPENDS
 set(scm_rpt_locale_specific_GUILE_DEPENDS
   gncmod-html
   scm-core-utils
-  scm-gettext
+  scm-core-utils
   scm-gnc-module
   scm-engine
   scm-test-core
diff --git a/gnucash/report/reports/aging.scm b/gnucash/report/reports/aging.scm
index afe9311c8..1104312e2 100644
--- a/gnucash/report/reports/aging.scm
+++ b/gnucash/report/reports/aging.scm
@@ -29,7 +29,7 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 (eval-when (compile load eval expand)
   (load-extension "libgncmod-gnome-utils" "scm_init_sw_gnome_utils_module"))
 (use-modules (sw_gnome_utils))
diff --git a/gnucash/report/reports/example/average-balance.scm b/gnucash/report/reports/example/average-balance.scm
index 80b492b6f..c7b6f9a01 100644
--- a/gnucash/report/reports/example/average-balance.scm
+++ b/gnucash/report/reports/example/average-balance.scm
@@ -31,7 +31,7 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 (gnc:module-load "gnucash/report" 0)
 
 (define reportname (N_ "Average Balance"))
diff --git a/gnucash/report/reports/example/daily-reports.scm b/gnucash/report/reports/example/daily-reports.scm
index 27acaed6d..affbc4261 100644
--- a/gnucash/report/reports/example/daily-reports.scm
+++ b/gnucash/report/reports/example/daily-reports.scm
@@ -31,7 +31,7 @@
 (use-modules (gnucash utilities))
 (use-modules (srfi srfi-1))
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (gnc:module-load "gnucash/report" 0)
 
diff --git a/gnucash/report/reports/example/hello-world.scm b/gnucash/report/reports/example/hello-world.scm
index ca41b6be7..54be41636 100644
--- a/gnucash/report/reports/example/hello-world.scm
+++ b/gnucash/report/reports/example/hello-world.scm
@@ -27,7 +27,7 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (debug-enable 'backtrace)
 
diff --git a/gnucash/report/reports/example/sample-graphs.scm b/gnucash/report/reports/example/sample-graphs.scm
index ba44b8ce9..f168adcab 100644
--- a/gnucash/report/reports/example/sample-graphs.scm
+++ b/gnucash/report/reports/example/sample-graphs.scm
@@ -31,7 +31,7 @@
 ;; Add this module to enable translatable strings
 ;; Use (N_ string) to mark string for translation (it won't be translated on the spot)
 ;; Use (_ string) to use a translation of this string if it exists.
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (gnc:module-load "gnucash/report" 0)
 (gnc:module-load "gnucash/gnome-utils" 0) ;for gnc-build-url
diff --git a/gnucash/report/reports/example/welcome-to-gnucash.scm b/gnucash/report/reports/example/welcome-to-gnucash.scm
index a0044424c..7181ff865 100644
--- a/gnucash/report/reports/example/welcome-to-gnucash.scm
+++ b/gnucash/report/reports/example/welcome-to-gnucash.scm
@@ -25,8 +25,7 @@
 
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
-(use-modules (gnucash core-utils)) ; for gnc:version
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils)) ; for gnc:version and (_ ...)
 (use-modules (gnucash gnc-module))
 (eval-when
       (compile load eval expand)
diff --git a/gnucash/report/reports/locale-specific/de_DE/taxtxf.scm b/gnucash/report/reports/locale-specific/de_DE/taxtxf.scm
index 01d007a0e..88ac95a33 100644
--- a/gnucash/report/reports/locale-specific/de_DE/taxtxf.scm
+++ b/gnucash/report/reports/locale-specific/de_DE/taxtxf.scm
@@ -70,8 +70,7 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
 (use-modules (srfi srfi-1))
-(use-modules (gnucash core-utils)) ; for gnc:version
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils)) ; for gnc:version and (_ ...)
 (use-modules (gnucash locale de_DE tax))
 
 (use-modules (gnucash gnc-module))
diff --git a/gnucash/report/reports/locale-specific/us/taxtxf.scm b/gnucash/report/reports/locale-specific/us/taxtxf.scm
index 819298fe9..682e0f27f 100644
--- a/gnucash/report/reports/locale-specific/us/taxtxf.scm
+++ b/gnucash/report/reports/locale-specific/us/taxtxf.scm
@@ -103,7 +103,7 @@
 (use-modules (gnucash utilities))
 (use-modules (srfi srfi-1))
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils)) ; for gnc:version and (_ ...)
 (use-modules (gnucash locale us tax))
 
 (eval-when
@@ -111,7 +111,6 @@
       (load-extension "libgncmod-gnome-utils" "scm_init_sw_gnome_utils_module"))
 (use-modules (sw_gnome_utils)) ;; to get to gnc-error-dialog
 
-(use-modules (gnucash core-utils)) ; for gnc:version
 
 (gnc:module-load "gnucash/html" 0)
 (gnc:module-load "gnucash/report" 0)
diff --git a/gnucash/report/reports/standard/account-piecharts.scm b/gnucash/report/reports/standard/account-piecharts.scm
index caad76f16..4677911dd 100644
--- a/gnucash/report/reports/standard/account-piecharts.scm
+++ b/gnucash/report/reports/standard/account-piecharts.scm
@@ -29,7 +29,7 @@
 (use-modules (gnucash utilities))
 (use-modules (srfi srfi-1))
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (gnc:module-load "gnucash/report" 0)
 
diff --git a/gnucash/report/reports/standard/account-summary.scm b/gnucash/report/reports/standard/account-summary.scm
index 33d2f127f..22bb746ce 100644
--- a/gnucash/report/reports/standard/account-summary.scm
+++ b/gnucash/report/reports/standard/account-summary.scm
@@ -59,7 +59,7 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (gnc:module-load "gnucash/report" 0)
 
diff --git a/gnucash/report/reports/standard/advanced-portfolio.scm b/gnucash/report/reports/standard/advanced-portfolio.scm
index 60e6a1680..3e10fb070 100644
--- a/gnucash/report/reports/standard/advanced-portfolio.scm
+++ b/gnucash/report/reports/standard/advanced-portfolio.scm
@@ -31,7 +31,7 @@
 (use-modules (gnucash utilities)) 
 (use-modules (srfi srfi-1))
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (gnc:module-load "gnucash/report" 0)
 
diff --git a/gnucash/report/reports/standard/balance-forecast.scm b/gnucash/report/reports/standard/balance-forecast.scm
index f9649a48c..6f9a61e26 100644
--- a/gnucash/report/reports/standard/balance-forecast.scm
+++ b/gnucash/report/reports/standard/balance-forecast.scm
@@ -27,7 +27,7 @@
 
 (use-modules (gnucash engine))
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 (use-modules (srfi srfi-1))
 
 (gnc:module-load "gnucash/report" 0)
diff --git a/gnucash/report/reports/standard/balance-sheet.scm b/gnucash/report/reports/standard/balance-sheet.scm
index b31a4cb25..bd75d6c46 100644
--- a/gnucash/report/reports/standard/balance-sheet.scm
+++ b/gnucash/report/reports/standard/balance-sheet.scm
@@ -66,7 +66,7 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (gnc:module-load "gnucash/report" 0)
 
diff --git a/gnucash/report/reports/standard/balsheet-eg.scm b/gnucash/report/reports/standard/balsheet-eg.scm
index 3145f38f0..8ac94edcb 100644
--- a/gnucash/report/reports/standard/balsheet-eg.scm
+++ b/gnucash/report/reports/standard/balsheet-eg.scm
@@ -35,7 +35,7 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 (use-modules (gnucash eguile))
 
 (use-modules (ice-9 local-eval))  ; for the-environment
diff --git a/gnucash/report/reports/standard/balsheet-pnl.scm b/gnucash/report/reports/standard/balsheet-pnl.scm
index ef0fcd47d..106057997 100644
--- a/gnucash/report/reports/standard/balsheet-pnl.scm
+++ b/gnucash/report/reports/standard/balsheet-pnl.scm
@@ -29,7 +29,7 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 (use-modules (srfi srfi-1))
 (use-modules (srfi srfi-2))
 (use-modules (srfi srfi-9))
diff --git a/gnucash/report/reports/standard/budget-balance-sheet.scm b/gnucash/report/reports/standard/budget-balance-sheet.scm
index bb503d77a..a15ac0930 100644
--- a/gnucash/report/reports/standard/budget-balance-sheet.scm
+++ b/gnucash/report/reports/standard/budget-balance-sheet.scm
@@ -32,7 +32,7 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (gnc:module-load "gnucash/report" 0)
 
diff --git a/gnucash/report/reports/standard/budget-barchart.scm b/gnucash/report/reports/standard/budget-barchart.scm
index 8faf3d7f6..3737e486b 100644
--- a/gnucash/report/reports/standard/budget-barchart.scm
+++ b/gnucash/report/reports/standard/budget-barchart.scm
@@ -30,7 +30,7 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (gnc:module-load "gnucash/report" 0)
 
diff --git a/gnucash/report/reports/standard/budget-flow.scm b/gnucash/report/reports/standard/budget-flow.scm
index 319bce919..0e68ed35e 100644
--- a/gnucash/report/reports/standard/budget-flow.scm
+++ b/gnucash/report/reports/standard/budget-flow.scm
@@ -29,7 +29,7 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (gnc:module-load "gnucash/report" 0)
 (gnc:module-load "gnucash/gnome-utils" 0) ;for gnc-build-url
diff --git a/gnucash/report/reports/standard/budget-income-statement.scm b/gnucash/report/reports/standard/budget-income-statement.scm
index 7a61c7c7d..9292b2819 100644
--- a/gnucash/report/reports/standard/budget-income-statement.scm
+++ b/gnucash/report/reports/standard/budget-income-statement.scm
@@ -44,7 +44,7 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (gnc:module-load "gnucash/report" 0)
 
diff --git a/gnucash/report/reports/standard/budget.scm b/gnucash/report/reports/standard/budget.scm
index 71d69ded5..1dac3a0be 100644
--- a/gnucash/report/reports/standard/budget.scm
+++ b/gnucash/report/reports/standard/budget.scm
@@ -30,7 +30,7 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (use-modules (srfi srfi-1))
 (use-modules (ice-9 match))
diff --git a/gnucash/report/reports/standard/cash-flow.scm b/gnucash/report/reports/standard/cash-flow.scm
index 477aa524f..d35c6ad75 100644
--- a/gnucash/report/reports/standard/cash-flow.scm
+++ b/gnucash/report/reports/standard/cash-flow.scm
@@ -31,7 +31,7 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (gnc:module-load "gnucash/report" 0)
 (gnc:module-load "gnucash/gnome-utils" 0) ;for gnc-build-url
diff --git a/gnucash/report/reports/standard/cashflow-barchart.scm b/gnucash/report/reports/standard/cashflow-barchart.scm
index af09c9115..af048c31f 100644
--- a/gnucash/report/reports/standard/cashflow-barchart.scm
+++ b/gnucash/report/reports/standard/cashflow-barchart.scm
@@ -32,7 +32,7 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 (use-modules (gnucash reports standard cash-flow))
 
 (gnc:module-load "gnucash/report" 0)
diff --git a/gnucash/report/reports/standard/category-barchart.scm b/gnucash/report/reports/standard/category-barchart.scm
index 405e9c53b..e2923ca1b 100644
--- a/gnucash/report/reports/standard/category-barchart.scm
+++ b/gnucash/report/reports/standard/category-barchart.scm
@@ -29,7 +29,7 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (gnc:module-load "gnucash/report" 0)
 
diff --git a/gnucash/report/reports/standard/customer-summary.scm b/gnucash/report/reports/standard/customer-summary.scm
index 59a1d71ff..4377c7e8e 100644
--- a/gnucash/report/reports/standard/customer-summary.scm
+++ b/gnucash/report/reports/standard/customer-summary.scm
@@ -32,7 +32,7 @@
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))                ; for gnc:debug
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 (use-modules (gnucash reports))
 
 (gnc:module-load "gnucash/report" 0)
diff --git a/gnucash/report/reports/standard/dashboard.scm b/gnucash/report/reports/standard/dashboard.scm
index 6e61c77db..f58b489fa 100644
--- a/gnucash/report/reports/standard/dashboard.scm
+++ b/gnucash/report/reports/standard/dashboard.scm
@@ -27,8 +27,7 @@
 
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
-(use-modules (gnucash core-utils)) ; for gnc:version
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils)) ; for gnc:version and (_ ...)
 (use-modules (gnucash gnc-module))
 (eval-when
       (compile load eval expand)
diff --git a/gnucash/report/reports/standard/equity-statement.scm b/gnucash/report/reports/standard/equity-statement.scm
index 5d1498fa2..ef232454f 100644
--- a/gnucash/report/reports/standard/equity-statement.scm
+++ b/gnucash/report/reports/standard/equity-statement.scm
@@ -49,7 +49,7 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (gnc:module-load "gnucash/report" 0)
 
diff --git a/gnucash/report/reports/standard/general-journal.scm b/gnucash/report/reports/standard/general-journal.scm
index c050bb01a..afc86a366 100644
--- a/gnucash/report/reports/standard/general-journal.scm
+++ b/gnucash/report/reports/standard/general-journal.scm
@@ -30,7 +30,7 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (gnc:module-load "gnucash/report" 0)
 
diff --git a/gnucash/report/reports/standard/general-ledger.scm b/gnucash/report/reports/standard/general-ledger.scm
index 14ac85d37..5d1226062 100644
--- a/gnucash/report/reports/standard/general-ledger.scm
+++ b/gnucash/report/reports/standard/general-ledger.scm
@@ -33,7 +33,7 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (gnc:module-load "gnucash/report" 0)
 
diff --git a/gnucash/report/reports/standard/income-gst-statement.scm b/gnucash/report/reports/standard/income-gst-statement.scm
index 9cd28c59e..b48f8790d 100644
--- a/gnucash/report/reports/standard/income-gst-statement.scm
+++ b/gnucash/report/reports/standard/income-gst-statement.scm
@@ -31,7 +31,7 @@
 (use-modules (gnucash utilities)) 
 (use-modules (srfi srfi-1))
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 (gnc:module-load "gnucash/report" 0)
 
 ;; Define the strings here to avoid typos and make changes easier.
diff --git a/gnucash/report/reports/standard/income-statement.scm b/gnucash/report/reports/standard/income-statement.scm
index 10ac37db5..92e62326a 100644
--- a/gnucash/report/reports/standard/income-statement.scm
+++ b/gnucash/report/reports/standard/income-statement.scm
@@ -45,7 +45,7 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (gnc:module-load "gnucash/report" 0)
 
diff --git a/gnucash/report/reports/standard/invoice.scm b/gnucash/report/reports/standard/invoice.scm
index b2fefc249..5e88cc193 100644
--- a/gnucash/report/reports/standard/invoice.scm
+++ b/gnucash/report/reports/standard/invoice.scm
@@ -27,7 +27,7 @@
 (use-modules (gnucash engine))
 (use-modules (srfi srfi-1))
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 (use-modules (gnucash utilities))
 
 (gnc:module-load "gnucash/report" 0)
diff --git a/gnucash/report/reports/standard/job-report.scm b/gnucash/report/reports/standard/job-report.scm
index b28d7f0c7..3a93abca1 100644
--- a/gnucash/report/reports/standard/job-report.scm
+++ b/gnucash/report/reports/standard/job-report.scm
@@ -30,7 +30,7 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash utilities))		; for gnc:debug
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (gnc:module-load "gnucash/report" 0)
 
diff --git a/gnucash/report/reports/standard/net-charts.scm b/gnucash/report/reports/standard/net-charts.scm
index 715c0a7a8..0ed8eb978 100644
--- a/gnucash/report/reports/standard/net-charts.scm
+++ b/gnucash/report/reports/standard/net-charts.scm
@@ -32,7 +32,7 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (gnc:module-load "gnucash/report" 0)
 
diff --git a/gnucash/report/reports/standard/new-aging.scm b/gnucash/report/reports/standard/new-aging.scm
index 3f7cca454..eec78d9a6 100644
--- a/gnucash/report/reports/standard/new-aging.scm
+++ b/gnucash/report/reports/standard/new-aging.scm
@@ -32,7 +32,7 @@
 (use-modules (gnucash utilities))
 (use-modules (gnucash engine))
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (gnc:module-load "gnucash/report" 0)
 
diff --git a/gnucash/report/reports/standard/new-owner-report.scm b/gnucash/report/reports/standard/new-owner-report.scm
index 82ab49362..da8faa8ee 100644
--- a/gnucash/report/reports/standard/new-owner-report.scm
+++ b/gnucash/report/reports/standard/new-owner-report.scm
@@ -34,7 +34,7 @@
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))        ; for gnc:debug
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (gnc:module-load "gnucash/report" 0)
 (use-modules (gnucash reports))
diff --git a/gnucash/report/reports/standard/owner-report.scm b/gnucash/report/reports/standard/owner-report.scm
index 708a09292..7a5057cb1 100644
--- a/gnucash/report/reports/standard/owner-report.scm
+++ b/gnucash/report/reports/standard/owner-report.scm
@@ -32,7 +32,7 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash utilities))        ; for gnc:debug
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (gnc:module-load "gnucash/report" 0)
 
diff --git a/gnucash/report/reports/standard/payables.scm b/gnucash/report/reports/standard/payables.scm
index 5b7499ad4..9eaa36aa2 100644
--- a/gnucash/report/reports/standard/payables.scm
+++ b/gnucash/report/reports/standard/payables.scm
@@ -28,7 +28,7 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (gnc:module-load "gnucash/report" 0)
 
diff --git a/gnucash/report/reports/standard/portfolio.scm b/gnucash/report/reports/standard/portfolio.scm
index 9ac552143..939d178f2 100644
--- a/gnucash/report/reports/standard/portfolio.scm
+++ b/gnucash/report/reports/standard/portfolio.scm
@@ -27,7 +27,7 @@
 (use-modules (gnucash utilities)) 
 (use-modules (srfi srfi-1))
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (gnc:module-load "gnucash/report" 0)
 
diff --git a/gnucash/report/reports/standard/price-scatter.scm b/gnucash/report/reports/standard/price-scatter.scm
index 4d934e3e4..2f9cf33e3 100644
--- a/gnucash/report/reports/standard/price-scatter.scm
+++ b/gnucash/report/reports/standard/price-scatter.scm
@@ -29,7 +29,6 @@
 (use-modules (srfi srfi-1))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils))
-(use-modules (gnucash gettext))
 
 (gnc:module-load "gnucash/report" 0)
 
diff --git a/gnucash/report/reports/standard/receipt.scm b/gnucash/report/reports/standard/receipt.scm
index bda6b4425..b3c5c66f4 100644
--- a/gnucash/report/reports/standard/receipt.scm
+++ b/gnucash/report/reports/standard/receipt.scm
@@ -19,7 +19,7 @@
 (use-modules (ice-9 local-eval))  ; for the-environment
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (use-modules (gnucash gnc-module))
 (gnc:module-load "gnucash/report" 0)
diff --git a/gnucash/report/reports/standard/receivables.scm b/gnucash/report/reports/standard/receivables.scm
index ee7e5dff7..9c16201a4 100644
--- a/gnucash/report/reports/standard/receivables.scm
+++ b/gnucash/report/reports/standard/receivables.scm
@@ -28,7 +28,7 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (gnc:module-load "gnucash/report" 0)
 
diff --git a/gnucash/report/reports/standard/reconcile-report.scm b/gnucash/report/reports/standard/reconcile-report.scm
index ffd690f33..456dae00d 100644
--- a/gnucash/report/reports/standard/reconcile-report.scm
+++ b/gnucash/report/reports/standard/reconcile-report.scm
@@ -27,7 +27,7 @@
 (define-module (gnucash reports standard reconcile-report))
 
 (use-modules (gnucash engine))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 (use-modules (gnucash gnc-module))
 (gnc:module-load "gnucash/report" 0)
 
diff --git a/gnucash/report/reports/standard/register.scm b/gnucash/report/reports/standard/register.scm
index 862940473..2ce1dfdb0 100644
--- a/gnucash/report/reports/standard/register.scm
+++ b/gnucash/report/reports/standard/register.scm
@@ -26,7 +26,7 @@
 (use-modules (gnucash utilities))
 (use-modules (srfi srfi-1))
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (gnc:module-load "gnucash/report" 0)
 
diff --git a/gnucash/report/reports/standard/taxinvoice.scm b/gnucash/report/reports/standard/taxinvoice.scm
index 13878575a..d25efb9f7 100644
--- a/gnucash/report/reports/standard/taxinvoice.scm
+++ b/gnucash/report/reports/standard/taxinvoice.scm
@@ -27,7 +27,7 @@
 (use-modules (ice-9 local-eval))  ; for the-environment
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (use-modules (gnucash gnc-module))
 (gnc:module-load "gnucash/report" 0)
diff --git a/gnucash/report/reports/standard/test/CMakeLists.txt b/gnucash/report/reports/standard/test/CMakeLists.txt
index af01f05b6..77c6ea94c 100644
--- a/gnucash/report/reports/standard/test/CMakeLists.txt
+++ b/gnucash/report/reports/standard/test/CMakeLists.txt
@@ -31,7 +31,7 @@ set(GUILE_DEPENDS
   scm-app-utils
   scm-engine
   scm-test-engine
-  scm-gettext
+  scm-core-utils
   scm-test-report
   scm-reports
   scm-report-stylesheets
diff --git a/gnucash/report/reports/standard/transaction.scm b/gnucash/report/reports/standard/transaction.scm
index 25d33e213..cf79e5e28 100644
--- a/gnucash/report/reports/standard/transaction.scm
+++ b/gnucash/report/reports/standard/transaction.scm
@@ -25,7 +25,7 @@
 (define-module (gnucash reports standard transaction))
 
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 (gnc:module-load "gnucash/report" 0)
 
 (gnc:define-report
diff --git a/gnucash/report/reports/standard/trial-balance.scm b/gnucash/report/reports/standard/trial-balance.scm
index ab0c3c09b..2368ba48c 100644
--- a/gnucash/report/reports/standard/trial-balance.scm
+++ b/gnucash/report/reports/standard/trial-balance.scm
@@ -55,7 +55,7 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (gnc:module-load "gnucash/report" 0)
 
diff --git a/gnucash/report/reports/standard/view-column.scm b/gnucash/report/reports/standard/view-column.scm
index 38caa8fcb..17b0585a3 100644
--- a/gnucash/report/reports/standard/view-column.scm
+++ b/gnucash/report/reports/standard/view-column.scm
@@ -31,7 +31,7 @@
 (use-modules (gnucash utilities)) 
 (use-modules (gnucash app-utils))
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 (eval-when
       (compile load eval expand)
       (load-extension "libgncmod-report" "scm_init_sw_report_module"))
diff --git a/gnucash/report/stylesheets/CMakeLists.txt b/gnucash/report/stylesheets/CMakeLists.txt
index f423374bf..b52a66aab 100644
--- a/gnucash/report/stylesheets/CMakeLists.txt
+++ b/gnucash/report/stylesheets/CMakeLists.txt
@@ -9,7 +9,7 @@ set(GUILE_OUTPUT_DIR gnucash/report/stylesheets)
 set(GUILE_DEPENDS
   scm-gnc-module
   scm-core-utils
-  scm-gettext
+  scm-core-utils
   scm-engine
   gncmod-html
   scm-report
diff --git a/gnucash/report/stylesheets/footer.scm b/gnucash/report/stylesheets/footer.scm
index 15df6a652..1ebfd160a 100644
--- a/gnucash/report/stylesheets/footer.scm
+++ b/gnucash/report/stylesheets/footer.scm
@@ -39,7 +39,7 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (gnc:module-load "gnucash/html" 0)
 (gnc:module-load "gnucash/report" 0)
diff --git a/gnucash/report/stylesheets/head-or-tail.scm b/gnucash/report/stylesheets/head-or-tail.scm
index cf84a88fe..3e5acd507 100644
--- a/gnucash/report/stylesheets/head-or-tail.scm
+++ b/gnucash/report/stylesheets/head-or-tail.scm
@@ -38,8 +38,7 @@
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
-(use-modules (gnucash core-utils)) ; for gnc:version
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils)) ; for gnc:version and (_ ...)
 
 (gnc:module-load "gnucash/html" 0)
 (gnc:module-load "gnucash/report" 0)
diff --git a/gnucash/report/stylesheets/plain.scm b/gnucash/report/stylesheets/plain.scm
index be0ea67db..5b9cec06c 100644
--- a/gnucash/report/stylesheets/plain.scm
+++ b/gnucash/report/stylesheets/plain.scm
@@ -28,7 +28,6 @@
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils))
-(use-modules (gnucash gettext))
 (use-modules (srfi srfi-13))
 (use-modules (srfi srfi-14))
 
diff --git a/gnucash/report/test/CMakeLists.txt b/gnucash/report/test/CMakeLists.txt
index f996cc631..f26142bc6 100644
--- a/gnucash/report/test/CMakeLists.txt
+++ b/gnucash/report/test/CMakeLists.txt
@@ -28,7 +28,7 @@ set(GUILE_DEPENDS
   scm-gnc-module
   scm-app-utils
   scm-core-utils
-  scm-gettext
+  scm-core-utils
   scm-engine
   scm-test-engine
   scm-report-2
diff --git a/gnucash/report/trep-engine.scm b/gnucash/report/trep-engine.scm
index 11be8271b..87ba8cfd6 100644
--- a/gnucash/report/trep-engine.scm
+++ b/gnucash/report/trep-engine.scm
@@ -39,7 +39,7 @@
 ;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 (use-modules (srfi srfi-11))
 (use-modules (srfi srfi-1))
 
diff --git a/libgnucash/app-utils/CMakeLists.txt b/libgnucash/app-utils/CMakeLists.txt
index 45d1cdfa5..4a74d52ce 100644
--- a/libgnucash/app-utils/CMakeLists.txt
+++ b/libgnucash/app-utils/CMakeLists.txt
@@ -22,7 +22,6 @@ set (app_utils_HEADERS
   gnc-entry-quickfill.h
   gnc-euro.h
   gnc-exp-parser.h
-  gnc-gettext-util.h
   gnc-gsettings.h
   gnc-help-utils.h
   gnc-helpers.h
@@ -62,7 +61,6 @@ set (app_utils_SOURCES
   gnc-entry-quickfill.c
   gnc-euro.c
   gnc-exp-parser.c
-  gnc-gettext-util.c
   gnc-gsettings.c
   gnc-helpers.c
   gnc-prefs-utils.c
@@ -180,17 +178,10 @@ set(GUILE_DEPENDS
   scm-gnc-module
   )
 
-gnc_add_scheme_targets(scm-gettext
-  gettext.scm
-  gnucash
-  gncmod-app-utils
-  TRUE
-)
-
 gnc_add_scheme_targets(scm-app-utils-1
   "${app_utils_SCHEME_1}"
   "gnucash/app-utils"
-  "scm-gettext;${GUILE_DEPENDS}"
+  "${GUILE_DEPENDS}"
   TRUE
 )
 
@@ -204,10 +195,11 @@ gnc_add_scheme_targets(scm-app-utils-2
 # Module interfaces deprecated in 4.x, will be removed for 5.x
 gnc_add_scheme_deprecated_module ("migrate-prefs" "" "" "")
 gnc_add_scheme_deprecated_module ("migrate-prefs-user" "" "" "")
+gnc_add_scheme_deprecated_module ("gnucash gettext" "gnucash core-utils" "scm-core-utils" "")
 
-add_custom_target(scm-app-utils ALL DEPENDS scm-app-utils-2 scm-app-utils-1 scm-gettext)
+add_custom_target(scm-app-utils ALL DEPENDS scm-app-utils-2 scm-app-utils-1)
 
 set_local_dist(app_utils_DIST_local
-        ${app_utils_ALL_SOURCES} gettext.scm ${app_utils_SCHEME_1} ${app_utils_SCHEME_2} ${app_utils_SCHEME_3}
+        ${app_utils_ALL_SOURCES} ${app_utils_SCHEME_1} ${app_utils_SCHEME_2} ${app_utils_SCHEME_3}
         app-utils.i CMakeLists.txt gnc-help-utils.c README)
 set(app_utils_DIST ${app_utils_DIST_local} ${test_app_utils_DIST} PARENT_SCOPE)
diff --git a/libgnucash/app-utils/app-utils.i b/libgnucash/app-utils/app-utils.i
index 583b8e90e..15c3f4ed8 100644
--- a/libgnucash/app-utils/app-utils.i
+++ b/libgnucash/app-utils/app-utils.i
@@ -26,7 +26,6 @@
 #include <gnc-euro.h>
 #include <gnc-exp-parser.h>
 #include <gnc-ui-util.h>
-#include <gnc-gettext-util.h>
 #include <gnc-prefs-utils.h>
 #include <gnc-helpers.h>
 #include <gnc-accounting-period.h>
@@ -66,9 +65,6 @@ const gchar * gnc_get_current_book_tax_name (void);
 const gchar * gnc_get_current_book_tax_type (void);
 Account * gnc_get_current_root_account (void);
 
-%newobject gnc_gettext_helper;
-char * gnc_gettext_helper(const char *string);
-
 GNCOptionDB * gnc_option_db_new(SCM guile_options);
 void gnc_option_db_destroy(GNCOptionDB *odb);
 
diff --git a/libgnucash/app-utils/app-utils.scm b/libgnucash/app-utils/app-utils.scm
index 4c86ddd91..068c31f2e 100644
--- a/libgnucash/app-utils/app-utils.scm
+++ b/libgnucash/app-utils/app-utils.scm
@@ -23,12 +23,7 @@
 (use-modules (srfi srfi-1))
 (use-modules (gnucash utilities))
 (use-modules (gnucash engine))
-(use-modules (gnucash gettext))
-
-;; gettext.scm
-(re-export gnc:gettext)
-(re-export _)
-(re-export N_)
+(use-modules (gnucash core-utils))
 
 ;; c-interface.scm
 (export gnc:apply-with-error-handling)
diff --git a/libgnucash/app-utils/business-prefs.scm b/libgnucash/app-utils/business-prefs.scm
index 1e3b7c6d3..f90584e13 100644
--- a/libgnucash/app-utils/business-prefs.scm
+++ b/libgnucash/app-utils/business-prefs.scm
@@ -19,7 +19,7 @@
 ;; 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652
 ;; Boston, MA  02110-1301,  USA       gnu at gnu.org
 
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (define gnc:*option-section-counters* (N_ "Counters"))
 
diff --git a/libgnucash/app-utils/date-utilities.scm b/libgnucash/app-utils/date-utilities.scm
index bc6907bc9..e899c157d 100644
--- a/libgnucash/app-utils/date-utilities.scm
+++ b/libgnucash/app-utils/date-utilities.scm
@@ -21,8 +21,7 @@
 ;; Boston, MA  02110-1301,  USA       gnu at gnu.org
 
 
-(use-modules (gnucash core-utils)
-             (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 ;; get stuff from localtime date vector
 (define (gnc:date-get-year datevec)
diff --git a/libgnucash/app-utils/gettext.scm b/libgnucash/app-utils/gettext.scm
deleted file mode 100644
index 46e965a72..000000000
--- a/libgnucash/app-utils/gettext.scm
+++ /dev/null
@@ -1,37 +0,0 @@
-;; This program is free software; you can redistribute it and/or    
-;; modify it under the terms of the GNU General Public License as   
-;; published by the Free Software Foundation; either version 2 of   
-;; the License, or (at your option) any later version.              
-;;                                                                  
-;; This program is distributed in the hope that it will be useful,  
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of   
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    
-;; GNU General Public License for more details.                     
-;;                                                                  
-;; You should have received a copy of the GNU General Public License
-;; along with this program; if not, contact:
-;;
-;; Free Software Foundation           Voice:  +1-617-542-5942
-;; 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652
-;; Boston, MA  02110-1301,  USA       gnu at gnu.org
-
-(define-module (gnucash gettext))
-
-;; Load a few different modules depending on the version of guile
-;; Our app-utils gnc module must be evaluated at compile time
-;; Without it sw_app_utils can't be evaluated below
-(eval-when
-      (compile load eval expand)
-      (load-extension "libgncmod-app-utils" "scm_init_sw_app_utils_module"))
-(use-modules (sw_app_utils))
-
-;; gettext functions
-(define gnc:gettext gnc-gettext-helper)
-(define _ gnc:gettext)
-(define-syntax N_
-  (syntax-rules ()
-    ((_ x) x)))
-
-(export gnc:gettext)
-(export _)
-(export N_)
diff --git a/libgnucash/app-utils/gnc-gettext-util.c b/libgnucash/app-utils/gnc-gettext-util.c
deleted file mode 100644
index 9c47f4b12..000000000
--- a/libgnucash/app-utils/gnc-gettext-util.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/********************************************************************\
- * File: core-utils.c
- *
- * Copyright (C) 2001 Linux Developers Group
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
-\********************************************************************/
-
-#include <config.h>
-
-#include <glib.h>
-#include <glib/gi18n.h>
-#include <string.h>
-
-#include "gnc-gettext-util.h"
-
-/* ============================================================== */
-
-char *
-gnc_gettext_helper(const char *string)
-{
-    return strdup(string && *string ? _(string) : "");
-}
-
diff --git a/libgnucash/app-utils/gnc-gettext-util.h b/libgnucash/app-utils/gnc-gettext-util.h
deleted file mode 100644
index 7a80956a2..000000000
--- a/libgnucash/app-utils/gnc-gettext-util.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/********************************************************************\
- * File: core-utils.c
- *
- * Copyright (C) 2001 Linux Developers Group
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
-\********************************************************************/
-
-#ifndef GNC_GETTEXT_UTIL_H
-#define GNC_GETTEXT_UTIL_H
-
-char * gnc_gettext_helper(const char * str);
-
-#endif
-
diff --git a/libgnucash/app-utils/options.scm b/libgnucash/app-utils/options.scm
index 8ea2ea1a3..7ec149bd6 100644
--- a/libgnucash/app-utils/options.scm
+++ b/libgnucash/app-utils/options.scm
@@ -17,7 +17,7 @@
 ;; 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652
 ;; Boston, MA  02110-1301,  USA       gnu at gnu.org
 (use-modules (ice-9 regex))
-(use-modules (gnucash gettext))
+(use-modules (gnucash core-utils))
 
 (define (rpterror-earlier type newoption fallback)
   ;; Translators: the 3 ~a below refer to (1) option type (2) unknown
diff --git a/libgnucash/app-utils/test/CMakeLists.txt b/libgnucash/app-utils/test/CMakeLists.txt
index 93a5fd5b8..dedc266de 100644
--- a/libgnucash/app-utils/test/CMakeLists.txt
+++ b/libgnucash/app-utils/test/CMakeLists.txt
@@ -35,7 +35,7 @@ set(GUILE_DEPENDS
   scm-core-utils
   scm-gnc-module
   scm-engine
-  scm-gettext
+  scm-core-utils
   gncmod-backend-xml
 )
 
diff --git a/libgnucash/app-utils/test/test-load-app-utils-module.scm b/libgnucash/app-utils/test/test-load-app-utils-module.scm
index b9fac7310..2524bbb80 100755
--- a/libgnucash/app-utils/test/test-load-app-utils-module.scm
+++ b/libgnucash/app-utils/test/test-load-app-utils-module.scm
@@ -3,14 +3,7 @@
 (use-modules (gnucash gnc-module))
 (gnc:module-system-init)
 
-;; Guile 2 needs to load external modules at compile time
-;; otherwise the N_ syntax-rule won't be found at compile time
-;; causing the test to fail
-;; That's what the wrapper below is meant for:
-(define-syntax-rule (begin-for-syntax form ...)
-      (eval-when (load compile eval) (begin form ...)))
-
-(begin-for-syntax (define loaded-module (gnc:module-load "gnucash/app-utils" 0)))
+(gnc:module-begin-syntax (define loaded-module (gnc:module-load "gnucash/app-utils" 0)))
 (if loaded-module
     (display "Module gnucash/app-utils loaded successfully\n")
     (begin
@@ -29,16 +22,4 @@
       (display "Failed - procedure gnc-default-currency not found\n")
       (set! exit-code -1)))
 
-(if (macro? (module-ref (current-module) 'N_))
-    (display "Macro N_ defined\n")
-    (begin
-      (display "Failed - macro N_ not defined\n")
-      (set! exit-code -1)))
-
-(if (string=? (N_ "foobar") "foobar")
-    (display "Macro N_ works properly\n")
-    (begin
-      (display "Failed - macro N_ doesn't work\n")
-      (set! exit-code -1)))
-
 (exit exit-code)
diff --git a/po/POTFILES.in b/po/POTFILES.in
index eb86ce92c..7b4bd4ab2 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -523,7 +523,6 @@ libgnucash/app-utils/c-interface.scm
 libgnucash/app-utils/date-utilities.scm
 libgnucash/app-utils/file-utils.c
 libgnucash/app-utils/fin.scm
-libgnucash/app-utils/gettext.scm
 libgnucash/app-utils/gfec.c
 libgnucash/app-utils/gnc-accounting-period.c
 libgnucash/app-utils/gnc-account-merge.c
@@ -532,7 +531,6 @@ libgnucash/app-utils/gnc-component-manager.c
 libgnucash/app-utils/gnc-entry-quickfill.c
 libgnucash/app-utils/gnc-euro.c
 libgnucash/app-utils/gnc-exp-parser.c
-libgnucash/app-utils/gnc-gettext-util.c
 libgnucash/app-utils/gnc-gsettings.c
 libgnucash/app-utils/gnc-helpers.c
 libgnucash/app-utils/gnc-help-utils.c

commit 759bbe1da012ada9dbabc2178a307d601d02fe74
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Thu Oct 10 22:51:57 2019 +0200

    app-utils - move gnc_get_debit/credit_str functions to Account
    
    Eliminates another scm file (prefs.scm).
    The old scm functions are declared deprecated.

diff --git a/gnucash/gnome/window-reconcile.c b/gnucash/gnome/window-reconcile.c
index b4c0ca6d7..4b139d50f 100644
--- a/gnucash/gnome/window-reconcile.c
+++ b/gnucash/gnome/window-reconcile.c
@@ -1104,30 +1104,13 @@ gnc_reconcile_key_press_cb (GtkWidget *widget, GdkEventKey *event,
 static void
 gnc_reconcile_window_set_titles(RecnWindow *recnData)
 {
-    gboolean formal;
-    gchar *title;
-
-    formal = gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL, GNC_PREF_ACCOUNTING_LABELS);
-
-    if (formal)
-        title = _("Debits");
-    else
-        title = gnc_get_debit_string(ACCT_TYPE_NONE);
+    const gchar *title;
 
+    title = gnc_account_get_debit_string(ACCT_TYPE_NONE);
     gtk_frame_set_label(GTK_FRAME(recnData->debit_frame), title);
 
-    if (!formal)
-        g_free(title);
-
-    if (formal)
-        title = _("Credits");
-    else
-        title = gnc_get_credit_string(ACCT_TYPE_NONE);
-
+    title = gnc_account_get_credit_string(ACCT_TYPE_NONE);
     gtk_frame_set_label(GTK_FRAME(recnData->credit_frame), title);
-
-    if (!formal)
-        g_free(title);
 }
 
 
diff --git a/gnucash/gnome/window-reconcile2.c b/gnucash/gnome/window-reconcile2.c
index abb6ecef5..ae08abd4f 100644
--- a/gnucash/gnome/window-reconcile2.c
+++ b/gnucash/gnome/window-reconcile2.c
@@ -1063,30 +1063,13 @@ gnc_reconcile_key_press_cb (GtkWidget *widget, GdkEventKey *event,
 static void
 gnc_reconcile_window_set_titles (RecnWindow2 *recnData)
 {
-    gboolean formal;
-    gchar *title;
-
-    formal = gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL, GNC_PREF_ACCOUNTING_LABELS);
-
-    if (formal)
-        title = _("Debits");
-    else
-        title = gnc_get_debit_string (ACCT_TYPE_NONE);
+    const gchar *title;
 
+    title = gnc_account_get_debit_string (ACCT_TYPE_NONE);
     gtk_frame_set_label (GTK_FRAME (recnData->debit_frame), title);
 
-    if (!formal)
-        g_free(title);
-
-    if (formal)
-        title = _("Credits");
-    else
-        title = gnc_get_credit_string (ACCT_TYPE_NONE);
-
+    title = gnc_account_get_credit_string (ACCT_TYPE_NONE);
     gtk_frame_set_label (GTK_FRAME (recnData->credit_frame), title);
-
-    if (!formal)
-        g_free(title);
 }
 
 
diff --git a/gnucash/register/ledger-core/split-register-p.h b/gnucash/register/ledger-core/split-register-p.h
index 3d53ccec7..e4081e83f 100644
--- a/gnucash/register/ledger-core/split-register-p.h
+++ b/gnucash/register/ledger-core/split-register-p.h
@@ -126,8 +126,8 @@ struct sr_info
     GncGUID template_account;
 
     /** configured strings for debit/credit headers */
-    char *debit_str;
-    char *credit_str;
+    const char *debit_str;
+    const char *credit_str;
     char *tdebit_str;
     char *tcredit_str;
 
diff --git a/gnucash/register/ledger-core/split-register.c b/gnucash/register/ledger-core/split-register.c
index 3bb9dc990..1f0cb5813 100644
--- a/gnucash/register/ledger-core/split-register.c
+++ b/gnucash/register/ledger-core/split-register.c
@@ -2500,7 +2500,7 @@ gnc_split_register_get_debit_string (SplitRegister *reg)
         return info->debit_str;
 
     info->debit_str =
-        gnc_get_debit_string
+        gnc_account_get_debit_string
         (gnc_split_register_type_to_account_type (reg->type));
 
     if (info->debit_str)
@@ -2523,7 +2523,7 @@ gnc_split_register_get_credit_string (SplitRegister *reg)
         return info->credit_str;
 
     info->credit_str =
-        gnc_get_credit_string
+        gnc_account_get_credit_string
         (gnc_split_register_type_to_account_type (reg->type));
 
     if (info->credit_str)
@@ -2798,9 +2798,7 @@ split_register_pref_changed (gpointer prefs, gchar *pref, gpointer user_data)
     if (g_str_has_suffix(pref, GNC_PREF_ACCOUNTING_LABELS))
     {
         /* Release current strings. Will be reloaded at next reference. */
-        g_free (info->debit_str);
         g_free (info->tdebit_str);
-        g_free (info->credit_str);
         g_free (info->tcredit_str);
 
         info->debit_str = NULL;
@@ -3033,9 +3031,7 @@ gnc_split_register_destroy_info (SplitRegister *reg)
     if (!info)
         return;
 
-    g_free (info->debit_str);
     g_free (info->tdebit_str);
-    g_free (info->credit_str);
     g_free (info->tcredit_str);
 
     info->debit_str = NULL;
diff --git a/gnucash/report/trep-engine.scm b/gnucash/report/trep-engine.scm
index 5e83d506d..11be8271b 100644
--- a/gnucash/report/trep-engine.scm
+++ b/gnucash/report/trep-engine.scm
@@ -1264,8 +1264,8 @@ be excluded from periodic reporting.")
            (row-currency (lambda (s) (if (column-uses? 'common-currency)
                                          (opt-val gnc:pagename-general optname-currency)
                                          (split-currency s))))
-           (friendly-debit (lambda (a) (gnc:get-debit-string (xaccAccountGetType a))))
-           (friendly-credit (lambda (a) (gnc:get-credit-string (xaccAccountGetType a))))
+           (friendly-debit (lambda (a) (gnc-account-get-debit-string (xaccAccountGetType a))))
+           (friendly-credit (lambda (a) (gnc-account-get-credit-string (xaccAccountGetType a))))
            (header-commodity (lambda (str)
                                (string-append
                                 str
diff --git a/libgnucash/app-utils/CMakeLists.txt b/libgnucash/app-utils/CMakeLists.txt
index e23a6a412..45d1cdfa5 100644
--- a/libgnucash/app-utils/CMakeLists.txt
+++ b/libgnucash/app-utils/CMakeLists.txt
@@ -166,7 +166,6 @@ set (app_utils_SCHEME_1
     c-interface.scm
     date-utilities.scm
     options.scm
-    prefs.scm
     fin.scm
 )
 
diff --git a/libgnucash/app-utils/app-utils.scm b/libgnucash/app-utils/app-utils.scm
index bc535b1f2..4c86ddd91 100644
--- a/libgnucash/app-utils/app-utils.scm
+++ b/libgnucash/app-utils/app-utils.scm
@@ -152,11 +152,6 @@
                            (list category key))))
 (export gnc:option-get-value)
 
-;; prefs.scm
-(export gnc:get-debit-string)
-(export gnc:get-credit-string)
-(export gnc:config-file-format-version)
-
 ;; gw-engine-spec.scm
 (re-export HOOK-SAVE-OPTIONS)
 
@@ -256,7 +251,6 @@
 
 (load-from-path "gnucash/app-utils/c-interface")
 (load-from-path "gnucash/app-utils/options")
-(load-from-path "gnucash/app-utils/prefs")
 (load-from-path "gnucash/app-utils/date-utilities")
 
 ;; Business options
@@ -311,3 +305,15 @@
 
 (load-from-path "gnucash/app-utils/business-options")
 (load-from-path "gnucash/app-utils/business-prefs")
+
+
+;; Symbols deprecated in 4.x, to remove for 5.x
+(define-public (gnc:get-debit-string acct-type)
+    (issue-deprecation-warning "gnc:get-debit-string is deprecated. Please use (gnucash engine)'s gnc-account-get-debit-string instead.")
+    (gnc-account-get-debit-string acct-type))
+(define-public (gnc:get-credit-string acct-type)
+    (issue-deprecation-warning "gnc:get-credit-string is deprecated. Please use (gnucash engine)'s gnc-account-get-credit-string instead.")
+    (gnc-account-get-debit-string acct-type))
+(define-public (gnc:config-file-format-version version)
+    (issue-deprecation-warning "gnc:config-file-format-version is deprecated and will be removed from a future version.")
+    #t)
diff --git a/libgnucash/app-utils/guile-util.c b/libgnucash/app-utils/guile-util.c
index 10edb6730..1142f9f96 100644
--- a/libgnucash/app-utils/guile-util.c
+++ b/libgnucash/app-utils/guile-util.c
@@ -63,12 +63,6 @@
 /* This static indicates the debugging module this .o belongs to.  */
 static QofLogModule UNUSED_VAR log_module = GNC_MOD_GUILE;
 
-struct _getters
-{
-    SCM debit_string;
-    SCM credit_string;
-} getters;
-
 struct _Process
 {
     GPid pid;
@@ -79,83 +73,6 @@ struct _Process
     gboolean detached;
 };
 
-static void
-initialize_scm_functions()
-{
-    static gboolean scm_funcs_inited = FALSE;
-
-    if (scm_funcs_inited)
-        return;
-
-    getters.debit_string = scm_c_eval_string("gnc:get-debit-string");
-    getters.credit_string = scm_c_eval_string("gnc:get-credit-string");
-
-    scm_funcs_inited = TRUE;
-}
-
-
-/********************************************************************\
- * gnc_get_debit_string                                             *
- *   return a debit string for a given account type                 *
- *                                                                  *
- * Args: account_type - type of account to get debit string for     *
- * Return: g_malloc'd debit string or NULL                          *
-\********************************************************************/
-char *
-gnc_get_debit_string(GNCAccountType account_type)
-{
-    SCM result;
-    SCM arg;
-
-    initialize_scm_functions();
-
-    if (gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL, GNC_PREF_ACCOUNTING_LABELS))
-        return g_strdup(_("Debit"));
-
-    if ((account_type < ACCT_TYPE_NONE) || (account_type >= NUM_ACCOUNT_TYPES))
-        account_type = ACCT_TYPE_NONE;
-
-    arg = scm_from_long (account_type);
-
-    result = scm_call_1(getters.debit_string, arg);
-    if (!scm_is_string(result))
-        return NULL;
-
-    return scm_to_utf8_string(result);
-}
-
-
-/************************************************************************\
- * gnc_get_credit_string                                                *
- *   return a credit string for a given account type                    *
- *                                                                      *
- * Args: account_type - type of account to get credit string for        *
- * Return: g_malloc'd credit string or NULL, must be freed with g_free  *
-\************************************************************************/
-char *
-gnc_get_credit_string(GNCAccountType account_type)
-{
-    SCM result;
-    SCM arg;
-
-    initialize_scm_functions();
-
-    if (gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL, GNC_PREF_ACCOUNTING_LABELS))
-        return g_strdup(_("Credit"));
-
-    if ((account_type < ACCT_TYPE_NONE) || (account_type >= NUM_ACCOUNT_TYPES))
-        account_type = ACCT_TYPE_NONE;
-
-    arg = scm_from_long (account_type);
-
-    result = scm_call_1(getters.credit_string, arg);
-    if (!scm_is_string(result))
-        return NULL;
-
-    return gnc_scm_to_utf8_string(result);
-}
-
-
 static void
 on_child_exit (GPid pid, gint status, gpointer data)
 {
diff --git a/libgnucash/app-utils/guile-util.h b/libgnucash/app-utils/guile-util.h
index d8740a25c..a0a3c94a1 100644
--- a/libgnucash/app-utils/guile-util.h
+++ b/libgnucash/app-utils/guile-util.h
@@ -32,13 +32,6 @@
 #include "Account.h"
 #include "gnc-guile-utils.h"
 
-
-/* Two functions that return string synonyms for the terms 'debit' and
- * 'credit' as appropriate for the given account type and user preferences.
- * They should be g_freed when no longer needed. */
-char * gnc_get_debit_string(GNCAccountType account_type);
-char * gnc_get_credit_string(GNCAccountType account_type);
-
 /** An opaque process structure returned by gnc_spawn_process_async. */
 typedef struct _Process Process;
 
diff --git a/libgnucash/app-utils/prefs.scm b/libgnucash/app-utils/prefs.scm
deleted file mode 100644
index d3f1ea683..000000000
--- a/libgnucash/app-utils/prefs.scm
+++ /dev/null
@@ -1,100 +0,0 @@
-;; Preferences
-;;
-;; This program is free software; you can redistribute it and/or    
-;; modify it under the terms of the GNU General Public License as   
-;; published by the Free Software Foundation; either version 2 of   
-;; the License, or (at your option) any later version.              
-;;                                                                  
-;; This program is distributed in the hope that it will be useful,  
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of   
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    
-;; GNU General Public License for more details.                     
-;;                                                                  
-;; You should have received a copy of the GNU General Public License
-;; along with this program; if not, contact:
-;;
-;; Free Software Foundation           Voice:  +1-617-542-5942
-;; 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652
-;; Boston, MA  02110-1301,  USA       gnu at gnu.org
-
-;; (define gnc:*double-entry-restriction*
-;;   (gnc:make-config-var
-;;    "Determines how the splits in a transaction will be balanced. 
-;;  The following values have significance:
-;; 
-;;    #f        anything goes
-;; 
-;;    'force    The sum of all splits in a transaction will be
-;;              forced to be zero, even if this requires the
-;;              creation of additional splits.  Note that a split
-;;              whose value is zero (e.g. a stock price) can exist
-;;              by itself. Otherwise, all splits must come in at 
-;;              least pairs.
-;; 
-;;    'collect  splits without parents will be forced into a
-;;              lost & found account.  (Not implemented)"
-;;    (lambda (var value)
-;;      (cond
-;;       ((eq? value #f)
-;;        (_gnc_set_force_double_entry_ 0)
-;;        (list value))
-;;       ((eq? value 'force)
-;;        (_gnc_set_force_double_entry_ 1)
-;;        (list value))
-;;       ((eq? value 'collect)
-;;        (gnc:warn
-;;         "gnc:*double-entry-restriction* -- 'collect not supported yet.  "
-;;         "Ignoring.")
-;;        #f)
-;;       (else
-;;        (gnc:warn
-;;         "gnc:*double-entry-restriction* -- " value " not supported.  Ignoring.")
-;;        #f)))
-;;    eq?
-;;    #f))
-(use-modules (gnucash gettext))
-
-;; Old-school config files depend on this API
- (define (gnc:config-file-format-version version) #t)
-
-;;;;;; Create config vars
-
-(define gnc:*debit-strings*
-  (list (cons ACCT-TYPE-NONE       (N_ "Funds In"))
-        (cons ACCT-TYPE-BANK       (N_ "Deposit"))
-        (cons ACCT-TYPE-CASH       (N_ "Receive"))
-        (cons ACCT-TYPE-CREDIT     (N_ "Payment"))
-        (cons ACCT-TYPE-ASSET      (N_ "Increase"))
-        (cons ACCT-TYPE-LIABILITY  (N_ "Decrease"))
-        (cons ACCT-TYPE-STOCK      (N_ "Buy"))
-        (cons ACCT-TYPE-MUTUAL     (N_ "Buy"))
-        (cons ACCT-TYPE-CURRENCY   (N_ "Buy"))
-        (cons ACCT-TYPE-INCOME     (N_ "Charge"))
-        (cons ACCT-TYPE-EXPENSE    (N_ "Expense"))
-        (cons ACCT-TYPE-PAYABLE    (N_ "Payment"))
-        (cons ACCT-TYPE-RECEIVABLE (N_ "Invoice"))
-        (cons ACCT-TYPE-TRADING    (N_ "Decrease"))
-        (cons ACCT-TYPE-EQUITY     (N_ "Decrease"))))
-
-(define gnc:*credit-strings*
-  (list (cons ACCT-TYPE-NONE       (N_ "Funds Out"))
-        (cons ACCT-TYPE-BANK       (N_ "Withdrawal"))
-        (cons ACCT-TYPE-CASH       (N_ "Spend"))
-        (cons ACCT-TYPE-CREDIT     (N_ "Charge"))
-        (cons ACCT-TYPE-ASSET      (N_ "Decrease"))
-        (cons ACCT-TYPE-LIABILITY  (N_ "Increase"))
-        (cons ACCT-TYPE-STOCK      (N_ "Sell"))
-        (cons ACCT-TYPE-MUTUAL     (N_ "Sell"))
-        (cons ACCT-TYPE-CURRENCY   (N_ "Sell"))
-        (cons ACCT-TYPE-INCOME     (N_ "Income"))
-        (cons ACCT-TYPE-EXPENSE    (N_ "Rebate"))
-        (cons ACCT-TYPE-PAYABLE    (N_ "Bill"))
-        (cons ACCT-TYPE-RECEIVABLE (N_ "Payment"))
-        (cons ACCT-TYPE-TRADING    (N_ "Increase"))
-        (cons ACCT-TYPE-EQUITY     (N_ "Increase"))))
-
-(define (gnc:get-debit-string type)
-  (_ (assoc-ref gnc:*debit-strings* type)))
-
-(define (gnc:get-credit-string type)
-  (_ (assoc-ref gnc:*credit-strings* type)))
diff --git a/libgnucash/engine/Account.cpp b/libgnucash/engine/Account.cpp
index fcacf1862..f6888e74d 100644
--- a/libgnucash/engine/Account.cpp
+++ b/libgnucash/engine/Account.cpp
@@ -25,6 +25,10 @@
 
 #include <config.h>
 
+extern "C" {
+#include "gnc-prefs.h"
+}
+
 #include <glib.h>
 #include <glib/gi18n.h>
 #include <stdlib.h>
@@ -44,6 +48,7 @@
 #include "guid.hpp"
 
 #include <numeric>
+#include <map>
 
 static QofLogModule log_module = GNC_MOD_ACCOUNT;
 
@@ -127,6 +132,46 @@ enum
 #define GET_PRIVATE(o)  \
     ((AccountPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_ACCOUNT))
 
+/* This map contains a set of strings representing the different column types. */
+std::map<GNCAccountType, const char*> gnc_acct_debit_strs = {
+    { ACCT_TYPE_NONE,       _("Funds In") },
+    { ACCT_TYPE_BANK,       _("Deposit") },
+    { ACCT_TYPE_CASH,       _("Receive") },
+    { ACCT_TYPE_CREDIT,     _("Payment") },
+    { ACCT_TYPE_ASSET,      _("Increase") },
+    { ACCT_TYPE_LIABILITY,  _("Decrease") },
+    { ACCT_TYPE_STOCK,      _("Buy") },
+    { ACCT_TYPE_MUTUAL,     _("Buy") },
+    { ACCT_TYPE_CURRENCY,   _("Buy") },
+    { ACCT_TYPE_INCOME,     _("Charge") },
+    { ACCT_TYPE_EXPENSE,    _("Expense") },
+    { ACCT_TYPE_PAYABLE,    _("Payment") },
+    { ACCT_TYPE_RECEIVABLE, _("Invoice") },
+    { ACCT_TYPE_TRADING,    _("Decrease") },
+    { ACCT_TYPE_EQUITY,     _("Decrease") },
+};
+const char* dflt_acct_debit_str = _("Debit");
+
+/* This map contains a set of strings representing the different column types. */
+std::map<GNCAccountType, const char*> gnc_acct_credit_strs = {
+    { ACCT_TYPE_NONE,       _("Funds Out") },
+    { ACCT_TYPE_BANK,       _("Withdrawal") },
+    { ACCT_TYPE_CASH,       _("Spend") },
+    { ACCT_TYPE_CREDIT,     _("Charge") },
+    { ACCT_TYPE_ASSET,      _("Decrease") },
+    { ACCT_TYPE_LIABILITY,  _("Increase") },
+    { ACCT_TYPE_STOCK,      _("Sell") },
+    { ACCT_TYPE_MUTUAL,     _("Sell") },
+    { ACCT_TYPE_CURRENCY,   _("Sell") },
+    { ACCT_TYPE_INCOME,     _("Income") },
+    { ACCT_TYPE_EXPENSE,    _("Rebate") },
+    { ACCT_TYPE_PAYABLE,    _("Bill") },
+    { ACCT_TYPE_RECEIVABLE, _("Payment") },
+    { ACCT_TYPE_TRADING,    _("Increase") },
+    { ACCT_TYPE_EQUITY,     _("Increase") },
+};
+const char* dflt_acct_credit_str = _("Credit");
+
 /********************************************************************\
  * Because I can't use C++ for this project, doesn't mean that I    *
  * can't pretend to!  These functions perform actions on the        *
@@ -4024,6 +4069,34 @@ xaccAccountSetTaxUSCopyNumber (Account *acc, gint64 copy_number)
     xaccAccountCommitEdit (acc);
 }
 
+/*********************************************************************\
+\ ********************************************************************/
+
+
+const char *gnc_account_get_debit_string (GNCAccountType acct_type)
+{
+    if (gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL, GNC_PREF_ACCOUNTING_LABELS))
+        return dflt_acct_debit_str;
+
+    auto result = gnc_acct_debit_strs.find(acct_type);
+    if (result != gnc_acct_debit_strs.end())
+        return result->second;
+    else
+        return dflt_acct_debit_str;
+}
+
+const char *gnc_account_get_credit_string (GNCAccountType acct_type)
+{
+    if (gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL, GNC_PREF_ACCOUNTING_LABELS))
+        return dflt_acct_credit_str;
+
+    auto result = gnc_acct_credit_strs.find(acct_type);
+    if (result != gnc_acct_credit_strs.end())
+        return result->second;
+    else
+        return dflt_acct_credit_str;
+}
+
 /********************************************************************\
 \********************************************************************/
 
diff --git a/libgnucash/engine/Account.h b/libgnucash/engine/Account.h
index 92ee17ab5..8a326471a 100644
--- a/libgnucash/engine/Account.h
+++ b/libgnucash/engine/Account.h
@@ -1238,6 +1238,17 @@ gint64 xaccAccountGetTaxUSCopyNumber (const Account *account);
 void xaccAccountSetTaxUSCopyNumber (Account *account, gint64 copy_number);
 /** @} */
 
+/** @name Account type debit/credit string getters
+ @ {      *
+ */
+
+/** Get the debit string associated with this account type */
+const char *gnc_account_get_debit_string (GNCAccountType acct_type);
+/** Get the credit string associated with this account type */
+const char *gnc_account_get_credit_string (GNCAccountType acct_type);
+
+/** @} */
+
 
 /** @name Account marking
 @{
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 96b91a996..eb86ce92c 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -545,7 +545,6 @@ libgnucash/app-utils/gnc-ui-util.c
 libgnucash/app-utils/guile-util.c
 libgnucash/app-utils/options.scm
 libgnucash/app-utils/option-util.c
-libgnucash/app-utils/prefs.scm
 libgnucash/app-utils/QuickFill.c
 libgnucash/backend/dbi/gnc-backend-dbi.cpp
 libgnucash/backend/dbi/gnc-dbisqlconnection.cpp

commit 9b803428ef673099e4522c7e50b0ee8753ff95aa
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Fri Dec 6 17:36:16 2019 +0100

    split register - add tests for copy operations

diff --git a/gnucash/register/ledger-core/test/CMakeLists.txt b/gnucash/register/ledger-core/test/CMakeLists.txt
index 31dd6b376..576974cb8 100644
--- a/gnucash/register/ledger-core/test/CMakeLists.txt
+++ b/gnucash/register/ledger-core/test/CMakeLists.txt
@@ -6,4 +6,28 @@ gnc_add_test(test-link-module-ledger-core test-link-module.c
   LEDGER_CORE_TEST_INCLUDE_DIRS LEDGER_CORE_TEST_LIBS
 )
 
-set_dist_list(test_ledger_core_DIST CMakeLists.txt test-link-module.c)
\ No newline at end of file
+set(SPLIT_REG_TEST_SOURCES
+    test-split-register.c
+    utest-split-register-copy-ops.c
+)
+
+set(SPLIT_REG_TEST_INCLUDE_DIRS
+    ${CMAKE_SOURCE_DIR}/libgnucash/engine
+    ${CMAKE_SOURCE_DIR}/gnucash/register/ledger-core
+    ${CMAKE_BINARY_DIR}/common # for config.h
+    ${CMAKE_SOURCE_DIR}/common/test-core  # for unittest-support.h
+    ${GLIB2_INCLUDE_DIRS}
+)
+
+set(SPLIT_REG_TEST_LIBS
+    gnc-engine
+    gncmod-ledger-core
+)
+
+gnc_add_test(test-split-register-copy-ops
+    "${SPLIT_REG_TEST_SOURCES};${CMAKE_SOURCE_DIR}/common/test-core/unittest-support.c"
+    SPLIT_REG_TEST_INCLUDE_DIRS
+    SPLIT_REG_TEST_LIBS
+)
+
+set_dist_list(test_ledger_core_DIST CMakeLists.txt test-link-module.c ${SPLIT_REG_TEST_SOURCES})
diff --git a/gnucash/register/ledger-core/test/test-split-register.c b/gnucash/register/ledger-core/test/test-split-register.c
new file mode 100644
index 000000000..117834818
--- /dev/null
+++ b/gnucash/register/ledger-core/test/test-split-register.c
@@ -0,0 +1,46 @@
+/********************************************************************
+ * test-split-register.c: Main test for split register. 	    *
+ * Copyright 2019 Geert Janssens <geert at kobaltwit.be>		    *
+ *                                                                  *
+ * This program is free software; you can redistribute it and/or    *
+ * modify it under the terms of the GNU General Public License as   *
+ * published by the Free Software Foundation; either version 2 of   *
+ * the License, or (at your option) any later version.              *
+ *                                                                  *
+ * This program is distributed in the hope that it will be useful,  *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
+ * GNU General Public License for more details.                     *
+ *                                                                  *
+ * You should have received a copy of the GNU General Public License*
+ * along with this program; if not, contact:                        *
+ *                                                                  *
+ * Free Software Foundation           Voice:  +1-617-542-5942       *
+ * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
+ * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
+ * \********************************************************************/
+
+
+#include <config.h>
+#include <glib.h>
+#include <qof.h>
+#include <TransLog.h>
+
+extern void test_suite_split_register_copy_ops();
+
+int
+main (int   argc,
+      char *argv[])
+{
+    qof_init(); 			/* Initialize the GObject system */
+    qof_log_init_filename_special("stderr"); /* Init the log system */
+    g_test_init ( &argc, &argv, NULL ); 	/* initialize test program */
+    //qof_log_set_level("gnc", G_LOG_LEVEL_DEBUG);
+    g_test_bug_base("https://bugs.gnucash.org/show_bug.cgi?id="); /* init the bugzilla URL */
+    /* Disable the transaction log */
+    xaccLogDisable();
+
+    test_suite_split_register_copy_ops();
+
+    return g_test_run( );
+}
diff --git a/gnucash/register/ledger-core/test/utest-split-register-copy-ops.c b/gnucash/register/ledger-core/test/utest-split-register-copy-ops.c
new file mode 100644
index 000000000..95db38d13
--- /dev/null
+++ b/gnucash/register/ledger-core/test/utest-split-register-copy-ops.c
@@ -0,0 +1,621 @@
+/********************************************************************
+ * utest-split-register-copy-ops.c: GLib g_test test suite for split-register-copy-ops.c.		    *
+ * Copyright 2019 Geert Janssens <geert at kobaltwit.be>		    *
+ *                                                                  *
+ * This program is free software; you can redistribute it and/or    *
+ * modify it under the terms of the GNU General Public License as   *
+ * published by the Free Software Foundation; either version 2 of   *
+ * the License, or (at your option) any later version.              *
+ *                                                                  *
+ * This program is distributed in the hope that it will be useful,  *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
+ * GNU General Public License for more details.                     *
+ *                                                                  *
+ * You should have received a copy of the GNU General Public License*
+ * along with this program; if not, you can retrieve it from        *
+ * https://www.gnu.org/licenses/old-licenses/gpl-2.0.html            *
+ * or contact:                                                      *
+ *                                                                  *
+ * Free Software Foundation           Voice:  +1-617-542-5942       *
+ * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
+ * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
+ ********************************************************************/
+#include <config.h>
+#include <string.h>
+#include <glib.h>
+#include <unittest-support.h>
+/* Add specific headers for this class */
+#include "split-register-copy-ops.h"
+#include <stdint.h>
+
+static const gchar *suitename = "/register/ledger-core/split-register-copy-ops";
+void test_suite_split_register_copy_ops ( void );
+
+typedef struct
+{
+    gboolean swap_accts;
+    gboolean docommit;
+} SwapCommitPrefs;
+
+typedef struct
+{
+    QofBook *book;
+    Account *acc1;
+    Account *acc2;
+    gnc_commodity *curr;
+
+    Transaction *txn;
+} Fixture;
+
+typedef struct
+{
+    QofBook *book;
+    Account *acc1;
+    Account *acc2;
+    gnc_commodity *curr;
+
+    FloatingTxn ft;
+    FloatingSplit fs1, fs2;
+} FlFixture;
+
+static void
+setup( Fixture *fixture, gconstpointer pData )
+{
+    time64 entered = gnc_dmy2time64 (20, 4, 2012);
+    time64 posted = gnc_dmy2time64 (21, 4, 2012);
+
+    Split *split1 = NULL;
+    Split *split2 = NULL;
+
+    fixture->book = qof_book_new();
+
+    split1 = xaccMallocSplit (fixture->book);
+    split2 = xaccMallocSplit (fixture->book);
+    fixture->acc1 = xaccMallocAccount(fixture->book);
+    fixture->acc2 = xaccMallocAccount(fixture->book);
+    fixture->curr = gnc_commodity_new(fixture->book, "Gnu Rand", "CURRENCY", "GNR", "", 100);
+    xaccAccountSetCommodity(fixture->acc1, fixture->curr);
+    xaccAccountSetCommodity(fixture->acc2, fixture->curr);
+
+    fixture->txn = xaccMallocTransaction (fixture->book);
+
+    xaccSplitSetMemo (split1, CACHE_INSERT ("foo"));
+    xaccSplitSetAction (split1, CACHE_INSERT ("bar"));
+    xaccSplitSetAmount (split1, gnc_numeric_create (3200, 100));
+    xaccSplitSetValue (split1, gnc_numeric_create (3200, 100));
+    xaccSplitSetAccount (split1, fixture->acc1);
+
+    xaccSplitSetAmount (split2, gnc_numeric_create (-3200, 100));
+    xaccSplitSetValue (split2, gnc_numeric_create (-3200, 100));
+    xaccSplitSetAccount (split2, fixture->acc2);
+
+    xaccTransBeginEdit (fixture->txn);
+    {
+        xaccTransSetNum (fixture->txn, CACHE_INSERT ("123"));
+        xaccTransSetDescription (fixture->txn, CACHE_INSERT ("Waldo Pepper"));
+        xaccTransSetDatePostedSecs (fixture->txn, posted);
+        xaccTransSetDateEnteredSecs (fixture->txn, entered);
+        xaccTransSetCurrency (fixture->txn, fixture->curr);
+        xaccSplitSetParent (split1, fixture->txn);
+        xaccSplitSetParent (split2, fixture->txn);
+        xaccTransSetNotes (fixture->txn, "Salt pork sausage");
+    }
+    xaccTransCommitEdit (fixture->txn);
+    xaccAccountSortSplits(fixture->acc1, FALSE);
+    xaccAccountSortSplits(fixture->acc2, FALSE);
+    xaccAccountRecomputeBalance(fixture->acc1);
+    xaccAccountRecomputeBalance(fixture->acc2);
+}
+
+static void
+teardown( Fixture *fixture, gconstpointer pData )
+{
+    xaccTransDestroy (fixture->txn);
+    xaccAccountBeginEdit(fixture->acc1);
+    xaccAccountDestroy(fixture->acc1);
+    xaccAccountBeginEdit(fixture->acc2);
+    xaccAccountDestroy(fixture->acc2);
+    gnc_commodity_destroy(fixture->curr);
+    qof_book_destroy( fixture->book );
+};
+
+static void
+flsetup( FlFixture *fixture, gconstpointer pData )
+{
+    time64 entered = gnc_dmy2time64 (20, 4, 2012);
+    time64 posted = gnc_dmy2time64 (21, 4, 2012);
+    time64 reconciled = gnc_dmy2time64 (22, 4, 2012);
+
+    fixture->book = qof_book_new();
+    fixture->acc1 = xaccMallocAccount(fixture->book);
+    fixture->acc2 = xaccMallocAccount(fixture->book);
+    fixture->curr = gnc_commodity_new(fixture->book, "Gnu Rand", "CURRENCY", "GNR", "", 100);
+    xaccAccountSetCommodity(fixture->acc1, fixture->curr);
+    xaccAccountSetCommodity(fixture->acc2, fixture->curr);
+
+    fixture->ft.m_txn = NULL;
+    fixture->ft.m_currency = fixture->curr;
+    fixture->ft.m_date_entered = entered;
+    fixture->ft.m_date_posted = posted;
+    fixture->ft.m_num = CACHE_INSERT ("FtNum");
+    fixture->ft.m_description = CACHE_INSERT ("FtDescription");
+    fixture->ft.m_notes = CACHE_INSERT ("FtNotes");
+    fixture->ft.m_association = CACHE_INSERT ("FtAssociation");
+
+    fixture->fs1.m_split = NULL;
+    fixture->fs1.m_account = fixture->acc1;
+    fixture->fs1.m_transaction = NULL;
+    fixture->fs1.m_memo = CACHE_INSERT ("Fs1Memo");
+    fixture->fs1.m_action = CACHE_INSERT ("Fs1Action");
+    fixture->fs1.m_reconcile_date = INT64_MAX;
+    fixture->fs1.m_reconcile_state = NREC;
+    fixture->fs1.m_value = gnc_numeric_create (4500, 100);
+    fixture->fs1.m_amount = gnc_numeric_create (4500, 100);
+
+    fixture->fs2.m_split = NULL;
+    fixture->fs2.m_account = fixture->acc2;
+    fixture->fs2.m_transaction = NULL;
+    fixture->fs2.m_memo = CACHE_INSERT ("Fs2Memo");
+    fixture->fs2.m_action = CACHE_INSERT ("Fs2Action");
+    fixture->fs2.m_reconcile_date = reconciled;
+    fixture->fs2.m_reconcile_state = YREC;
+    fixture->fs2.m_value = gnc_numeric_create (-4500, 100);
+    fixture->fs2.m_amount = gnc_numeric_create (-4500, 100);
+
+    fixture->ft.m_splits = NULL;
+    fixture->ft.m_splits = g_list_append (NULL, &fixture->fs1);
+    fixture->ft.m_splits = g_list_append (fixture->ft.m_splits, &fixture->fs2);
+}
+
+static void
+flteardown( FlFixture *fixture, gconstpointer pData )
+{
+    g_list_free (fixture->ft.m_splits);
+    xaccAccountBeginEdit(fixture->acc1);
+    xaccAccountDestroy(fixture->acc1);
+    xaccAccountBeginEdit(fixture->acc2);
+    xaccAccountDestroy(fixture->acc2);
+    gnc_commodity_destroy(fixture->curr);
+    qof_book_destroy( fixture->book );
+};
+
+// Not Used
+/* gnc_float_split_get_reconcile_state - trivial getter, skipping
+char gnc_float_split_get_reconcile_state (const FloatingSplit *fs)// Local: 0:0:0
+*/
+// Not Used
+/* gnc_float_split_get_reconcile_date - trivial getter, skipping
+time64 gnc_float_split_get_reconcile_date (const FloatingSplit *fs)// Local: 0:0:0
+*/
+/* gnc_float_split_get_amount - trivial getter, skipping
+gnc_numeric gnc_float_split_get_amount (const FloatingSplit *fs)// C: 1  Local: 0:0:0
+*/
+/* static void
+test_gnc_float_split_get_amount (Fixture *fixture, gconstpointer pData)
+{
+}*/
+/* gnc_float_split_get_value - trivial getter, skipping
+gnc_numeric gnc_float_split_get_value (const FloatingSplit *fs)// C: 1  Local: 0:0:0
+*/
+/* static void
+test_gnc_float_split_get_value (Fixture *fixture, gconstpointer pData)
+{
+}*/
+// Not Used
+/* gnc_float_split_set_split - trivial getter, skipping
+void gnc_float_split_set_split(FloatingSplit *fs, Split *split)// Local: 0:0:0
+*/
+/* gnc_float_split_set_account - trivial setter, skipping
+void gnc_float_split_set_account (FloatingSplit *fs, Account *account) // C: 2 in 1  Local: 0:0:0
+*/
+/* static void
+test_gnc_float_split_set_account (Fixture *fixture, gconstpointer pData)
+{
+}*/
+// Not Used
+/* gnc_float_split_set_transaction - trivial setter, skipping
+void gnc_float_split_set_transaction (FloatingSplit *fs, Transaction *transaction) // Local: 0:0:0
+*/
+/* gnc_float_split_set_memo
+void gnc_float_split_set_memo (FloatingSplit *fs, const char *memo)// C: 1  Local: 0:0:0
+*/
+/* static void
+test_gnc_float_split_set_memo (Fixture *fixture, gconstpointer pData)
+{
+}*/
+/* gnc_float_split_set_action - trivial setter, skipping
+void gnc_float_split_set_action (FloatingSplit *fs, const char *action)// C: 1  Local: 0:0:0
+*/
+/* static void
+test_gnc_float_split_set_action (Fixture *fixture, gconstpointer pData)
+{
+}*/
+/* gnc_float_split_set_reconcile_state - trivial setter, skipping
+void gnc_float_split_set_reconcile_state (FloatingSplit *fs, char reconcile_state)// C: 1  Local: 0:0:0
+*/
+/* static void
+test_gnc_float_split_set_reconcile_state (Fixture *fixture, gconstpointer pData)
+{
+}*/
+// Not Used
+/* gnc_float_split_set_reconcile_date - trivial setter, skipping
+void gnc_float_split_set_reconcile_date (FloatingSplit *fs, time64 reconcile_date)// Local: 0:0:0
+*/
+/* gnc_float_split_set_amount - trivial setter, skipping
+void gnc_float_split_set_amount (FloatingSplit *fs, const gnc_numeric amount)// C: 2 in 1  Local: 0:0:0
+*/
+/* static void
+test_gnc_float_split_set_amount (Fixture *fixture, gconstpointer pData)
+{
+}*/
+/* gnc_float_split_set_value - trivial setter, skipping
+void gnc_float_split_set_value (FloatingSplit *fs, const gnc_numeric value)// C: 2 in 1  Local: 0:0:0
+*/
+/* static void
+test_gnc_float_split_set_value (Fixture *fixture, gconstpointer pData)
+{
+}*/
+/* gnc_split_to_float_split
+FloatingSplit *gnc_split_to_float_split (Split *split)// C: 3 in 1  Local: 1:0:0
+*/
+static void
+test_gnc_split_to_float_split (Fixture *fixture, gconstpointer pData)
+{
+    FloatingSplit *fs = NULL;
+    Split *s = xaccTransFindSplitByAccount (fixture->txn, fixture->acc1);
+
+    g_assert_nonnull (s);
+
+    fs = gnc_split_to_float_split (s);
+    g_assert_true (fs->m_split == s);
+    g_assert_true (fs->m_account == xaccSplitGetAccount (s));
+    g_assert_true (fs->m_transaction == xaccSplitGetParent (s));
+    g_assert_cmpstr (fs->m_memo, ==, xaccSplitGetMemo (s));
+    g_assert_cmpstr (fs->m_action, ==, xaccSplitGetAction (s));
+    g_assert_true (gnc_numeric_equal(fs->m_value, xaccSplitGetValue (s)));
+    g_assert_true (gnc_numeric_equal(fs->m_amount, xaccSplitGetAmount (s)));
+
+    g_free (fs);
+}
+/* gnc_float_split_to_split
+void gnc_float_split_to_split (const FloatingSplit *fs, Split *split)// C: 2 in 1  Local: 1:0:0
+*/
+static void
+test_gnc_float_split_to_split (Fixture *fixture, gconstpointer pData)
+{
+    gnc_numeric amt = gnc_numeric_create (500, 100);
+    FloatingSplit fs = { NULL, fixture->acc1, NULL, "Memo1", "Action1", INT64_MAX, 'u', amt, amt };
+    Split *s = xaccMallocSplit(fixture->book);
+    Transaction *txn = xaccMallocTransaction (fixture->book);
+
+    gnc_float_split_to_split (&fs, s);
+    g_assert_true (fixture->acc1 == xaccSplitGetAccount (s));
+    g_assert_cmpstr ("Memo1", ==, xaccSplitGetMemo (s));
+    g_assert_cmpstr ("Action1", ==, xaccSplitGetAction (s));
+    g_assert_true (gnc_numeric_equal(amt, xaccSplitGetValue (s)));
+    g_assert_true (gnc_numeric_equal(amt, xaccSplitGetAmount (s)));
+
+
+    xaccTransBeginEdit (txn);
+    xaccTransSetCurrency (txn, fixture->curr);
+    xaccSplitSetParent (s, txn);
+    xaccTransCommitEdit (txn);
+    xaccTransDestroy (txn);
+}
+// Not Used
+/* gnc_float_txn_get_date_entered - trivial getter, skipping
+time64 gnc_float_txn_get_date_entered (const FloatingTxn *ft)// Local: 0:0:0
+*/
+// Not Used
+/* gnc_float_txn_get_date_posted - trivial getter, skipping
+time64 gnc_float_txn_get_date_posted (const FloatingTxn *ft)// Local: 0:0:0
+*/
+// Not Used
+/* gnc_float_txn_set_txn - trivial setter, skipping
+void gnc_float_txn_set_txn (FloatingTxn *ft, Transaction *txn)// Local: 0:0:0
+*/
+// Not Used
+/* gnc_float_txn_set_currency - trivial setter, skipping
+void gnc_float_txn_set_currency (FloatingTxn *ft, gnc_commodity *currency)// Local: 0:0:0
+*/
+// Not Used
+/* gnc_float_txn_set_date_entered - trivial setter, skipping
+void gnc_float_txn_set_date_entered (FloatingTxn *ft, time64 date_entered)// Local: 0:0:0
+*/
+// Not Used
+/* gnc_float_txn_set_date_posted - trivial setter, skipping
+void gnc_float_txn_set_date_posted (FloatingTxn *ft, time64 date_posted)// Local: 0:0:0
+*/
+// Not Used
+/* gnc_float_txn_set_num - trivial setter, skipping
+void gnc_float_txn_set_num (FloatingTxn *ft, const char *num)// Local: 0:0:0
+*/
+// Not Used
+/* gnc_float_txn_set_description - trivial setter, skipping
+void gnc_float_txn_set_description (FloatingTxn *ft, const char *description)// Local: 0:0:0
+*/
+// Not Used
+/* gnc_float_txn_set_notes - trivial setter, skipping
+void gnc_float_txn_set_notes (FloatingTxn *ft, const char *notes)// Local: 0:0:0
+*/
+// Not Used
+/* gnc_float_txn_set_association - trivial setter, skipping
+void gnc_float_txn_set_association (FloatingTxn *ft, const char *association)// Local: 0:0:0
+*/
+// Not Used
+/* gnc_float_txn_set_splits - trivial setter, skipping
+void gnc_float_txn_set_splits (FloatingTxn *ft, SplitList *splits)// Local: 0:0:0
+*/
+/* gnc_float_txn_append_float_split
+void gnc_float_txn_append_float_split (FloatingTxn *ft, FloatingSplit *fs)// C: 1  Local: 0:0:0
+*/
+/* static void
+test_gnc_float_txn_append_float_split (Fixture *fixture, gconstpointer pData)
+{
+}*/
+/* gnc_txn_to_float_txn
+FloatingTxn *gnc_txn_to_float_txn (Transaction *txn, gboolean use_cut_semantics)// C: 3 in 1  Local: 0:0:0
+*/
+static void
+test_gnc_txn_to_float_txn (Fixture *fixture, gconstpointer pData)
+{
+    FloatingTxn *ft = NULL;
+    SplitList *sl = xaccTransGetSplitList(fixture->txn), *siter;
+    SplitList *fsl, *fsiter;
+    FloatingSplit *fs;
+    Split *s;
+
+    ft = gnc_txn_to_float_txn (fixture->txn, FALSE);
+
+    /* Check transaction fields */
+    g_assert_true (ft->m_txn == fixture->txn);
+    g_assert_true (ft->m_currency == xaccTransGetCurrency (fixture->txn));
+    g_assert_cmpint (ft->m_date_entered, ==, xaccTransGetDateEntered (fixture->txn));
+    g_assert_cmpint (ft->m_date_posted, ==, 0);
+    g_assert_null (ft->m_num);
+    g_assert_cmpstr (ft->m_description, ==, xaccTransGetDescription (fixture->txn));
+    g_assert_cmpstr (ft->m_notes, ==, xaccTransGetNotes (fixture->txn));
+    g_assert_cmpstr (ft->m_association, ==, xaccTransGetAssociation (fixture->txn));
+
+    /* Check split fields of first split */
+    siter = sl;
+    s = siter->data;
+
+    fsiter = ft->m_splits;
+    fs = fsiter->data;
+
+    g_assert_nonnull (fs);
+    g_assert_true (fs->m_split == s);
+    g_assert_true (fs->m_account == xaccSplitGetAccount (s));
+    g_assert_true (fs->m_transaction == xaccSplitGetParent (s));
+    g_assert_cmpstr (fs->m_memo, ==, xaccSplitGetMemo (s));
+    g_assert_cmpstr (fs->m_action, ==, xaccSplitGetAction (s));
+    g_assert_true (gnc_numeric_equal(fs->m_value, xaccSplitGetValue (s)));
+    g_assert_true (gnc_numeric_equal(fs->m_amount, xaccSplitGetAmount (s)));
+
+    /* Check split fields of second split */
+    siter = siter->next;
+    s = siter->data;
+
+    fsiter = fsiter->next;
+    fs = fsiter->data;
+
+    g_assert_nonnull (fs);
+    g_assert_true (fs->m_split == s);
+    g_assert_true (fs->m_account == xaccSplitGetAccount (s));
+    g_assert_true (fs->m_transaction == xaccSplitGetParent (s));
+    g_assert_cmpstr (fs->m_memo, ==, xaccSplitGetMemo (s));
+    g_assert_cmpstr (fs->m_action, ==, xaccSplitGetAction (s));
+    g_assert_true (gnc_numeric_equal(fs->m_value, xaccSplitGetValue (s)));
+    g_assert_true (gnc_numeric_equal(fs->m_amount, xaccSplitGetAmount (s)));
+
+    g_assert_null (fsiter->next);
+
+    g_list_free_full(ft->m_splits, g_free);
+    ft->m_splits = NULL;
+    g_free (ft);
+}
+static void
+test_gnc_txn_to_float_txn_cut_semantics (Fixture *fixture, gconstpointer pData)
+{
+    FloatingTxn *ft = NULL;
+    SplitList *sl = xaccTransGetSplitList(fixture->txn), *siter;
+    SplitList *fsl, *fsiter;
+    FloatingSplit *fs;
+    Split *s;
+
+    ft = gnc_txn_to_float_txn (fixture->txn, TRUE);
+
+    /* Check transaction fields */
+    g_assert_true (ft->m_txn == fixture->txn);
+    g_assert_true (ft->m_currency == xaccTransGetCurrency (fixture->txn));
+    g_assert_cmpint (ft->m_date_entered, ==, xaccTransGetDateEntered (fixture->txn));
+    g_assert_cmpint (ft->m_date_posted, ==, xaccTransGetDate (fixture->txn));
+    g_assert_cmpstr (ft->m_num, ==, xaccTransGetNum (fixture->txn));
+    g_assert_cmpstr (ft->m_description, ==, xaccTransGetDescription (fixture->txn));
+    g_assert_cmpstr (ft->m_notes, ==, xaccTransGetNotes (fixture->txn));
+    g_assert_cmpstr (ft->m_association, ==, xaccTransGetAssociation (fixture->txn));
+
+    /* Check split fields of first split */
+    siter = sl;
+    s = siter->data;
+
+    fsiter = ft->m_splits;
+    fs = fsiter->data;
+
+    g_assert_nonnull (fs);
+    g_assert_true (fs->m_split == s);
+    g_assert_true (fs->m_account == xaccSplitGetAccount (s));
+    g_assert_true (fs->m_transaction == xaccSplitGetParent (s));
+    g_assert_cmpstr (fs->m_memo, ==, xaccSplitGetMemo (s));
+    g_assert_cmpstr (fs->m_action, ==, xaccSplitGetAction (s));
+    g_assert_true (gnc_numeric_equal(fs->m_value, xaccSplitGetValue (s)));
+    g_assert_true (gnc_numeric_equal(fs->m_amount, xaccSplitGetAmount (s)));
+
+    /* Check split fields of second split */
+    siter = siter->next;
+    s = siter->data;
+
+    fsiter = fsiter->next;
+    fs = fsiter->data;
+
+    g_assert_nonnull (fs);
+    g_assert_true (fs->m_split == s);
+    g_assert_true (fs->m_account == xaccSplitGetAccount (s));
+    g_assert_true (fs->m_transaction == xaccSplitGetParent (s));
+    g_assert_cmpstr (fs->m_memo, ==, xaccSplitGetMemo (s));
+    g_assert_cmpstr (fs->m_action, ==, xaccSplitGetAction (s));
+    g_assert_true (gnc_numeric_equal(fs->m_value, xaccSplitGetValue (s)));
+    g_assert_true (gnc_numeric_equal(fs->m_amount, xaccSplitGetAmount (s)));
+
+    g_assert_null (fsiter->next);
+
+    g_list_free_full(ft->m_splits, g_free);
+    ft->m_splits = NULL;
+    g_free (ft);
+}
+
+
+/* gnc_float_txn_get_float_split
+FloatingSplit *gnc_float_txn_get_float_split (const FloatingTxn *ft, guint index)// C: 1 in 1  Local: 0:0:0
+*/
+static void
+test_gnc_float_txn_get_float_split (FlFixture *fixture, gconstpointer pData)
+{
+    FloatingSplit *fs = gnc_float_txn_get_float_split(&fixture->ft, 0);
+
+    g_assert_nonnull (fs);
+    g_assert_true (fs->m_account == fixture->acc1);
+    g_assert_cmpstr (fs->m_memo, ==, "Fs1Memo");
+    g_assert_cmpstr (fs->m_action, ==, "Fs1Action");
+    g_assert_true (gnc_numeric_equal(fs->m_value, gnc_numeric_create (4500, 100)));
+    g_assert_true (gnc_numeric_equal(fs->m_amount, gnc_numeric_create (4500, 100)));
+
+    fs = gnc_float_txn_get_float_split(&fixture->ft, 1);
+
+    g_assert_nonnull (fs);
+    g_assert_true (fs->m_account == fixture->acc2);
+    g_assert_cmpstr (fs->m_memo, ==, "Fs2Memo");
+    g_assert_cmpstr (fs->m_action, ==, "Fs2Action");
+    g_assert_true (gnc_numeric_equal(fs->m_value, gnc_numeric_create (-4500, 100)));
+    g_assert_true (gnc_numeric_equal(fs->m_amount, gnc_numeric_create (-4500, 100)));
+}
+
+/* gnc_float_txn_get_other_float_split
+FloatingSplit *gnc_float_txn_get_other_float_split (const FloatingTxn *ft, FloatingSplit *fs)// C: 2 in 1  Local: 0:0:0
+*/
+static void
+test_gnc_float_txn_get_other_float_split (FlFixture *fixture, gconstpointer pData)
+{
+    FloatingSplit *first = gnc_float_txn_get_float_split(&fixture->ft, 0);
+    FloatingSplit *other = gnc_float_txn_get_other_float_split(&fixture->ft, first);
+
+    g_assert_nonnull (other);
+    g_assert_true (other->m_account == fixture->acc2);
+    g_assert_cmpstr (other->m_memo, ==, "Fs2Memo");
+    g_assert_cmpstr (other->m_action, ==, "Fs2Action");
+    g_assert_true (gnc_numeric_equal(other->m_value, gnc_numeric_create (-4500, 100)));
+    g_assert_true (gnc_numeric_equal(other->m_amount, gnc_numeric_create (-4500, 100)));
+
+    first = gnc_float_txn_get_float_split(&fixture->ft, 1);
+    other = gnc_float_txn_get_other_float_split(&fixture->ft, first);
+
+    g_assert_nonnull (other);
+    g_assert_true (other->m_account == fixture->acc1);
+    g_assert_cmpstr (other->m_memo, ==, "Fs1Memo");
+    g_assert_cmpstr (other->m_action, ==, "Fs1Action");
+    g_assert_true (gnc_numeric_equal(other->m_value, gnc_numeric_create (4500, 100)));
+    g_assert_true (gnc_numeric_equal(other->m_amount, gnc_numeric_create (4500, 100)));
+}
+/* gnc_float_txn_to_txn_swap_accounts
+void gnc_float_txn_to_txn_swap_accounts (const FloatingTxn *ft, Transaction *txn, Account *acct1, Account *acct2, gboolean do_commit)// C: 1  Local: 1:0:0
+*/
+static void
+test_gnc_float_txn_to_txn_swap_accounts (FlFixture *fixture, gconstpointer pData)
+{
+    SwapCommitPrefs *prefs = (SwapCommitPrefs*)pData;
+    Transaction *txn = xaccMallocTransaction (fixture->book);
+    Account *sw_acct1 = NULL, *sw_acct2 = NULL;
+    Account *exp_acct1 = fixture->acc1, *exp_acct2 = fixture->acc2;
+    SplitList *siter;
+    Split *s;
+    gnc_numeric amt;
+
+    if (prefs->swap_accts)
+    {
+        sw_acct1 = fixture->acc1;
+        sw_acct2 = fixture->acc2;
+        exp_acct1 = fixture->acc2;
+        exp_acct2 = fixture->acc1;
+    }
+
+    gnc_float_txn_to_txn_swap_accounts (&fixture->ft, txn, sw_acct1, sw_acct2, prefs->docommit);
+
+    /* First compare transaction values */
+    g_assert_true (fixture->ft.m_currency == xaccTransGetCurrency (txn));
+    g_assert_cmpstr (fixture->ft.m_description, ==, "FtDescription");
+    g_assert_cmpstr (fixture->ft.m_num, ==, "FtNum");
+    g_assert_cmpstr (fixture->ft.m_notes, ==, "FtNotes");
+    g_assert_cmpstr (fixture->ft.m_association, ==, "FtAssociation");
+    g_assert_cmpint (fixture->ft.m_date_posted, ==, xaccTransGetDate (txn));
+
+    /* Next compare values for first split */
+    siter = xaccTransGetSplitList (txn);
+    g_assert_nonnull (siter);
+
+    s = siter->data;
+    g_assert_nonnull (s);
+
+    g_assert_true (exp_acct1 == xaccSplitGetAccount (s));
+    g_assert_cmpstr (fixture->fs1.m_memo, ==, xaccSplitGetMemo (s));
+    g_assert_cmpstr (fixture->fs1.m_action, ==, xaccSplitGetAction (s));
+    g_assert_true (gnc_numeric_equal(fixture->fs1.m_value, xaccSplitGetValue (s)));
+    g_assert_true (gnc_numeric_equal(fixture->fs1.m_value, xaccSplitGetAmount (s)));
+
+    /* Next compare values for second split */
+    siter = siter->next;
+    g_assert_nonnull (siter);
+
+    s = siter->data;
+    g_assert_nonnull (s);
+
+    g_assert_true (exp_acct2 == xaccSplitGetAccount (s));
+    g_assert_cmpstr (fixture->fs2.m_memo, ==, xaccSplitGetMemo (s));
+    g_assert_cmpstr (fixture->fs2.m_action, ==, xaccSplitGetAction (s));
+    g_assert_true (gnc_numeric_equal(fixture->fs2.m_value, xaccSplitGetValue (s)));
+    g_assert_true (gnc_numeric_equal(fixture->fs2.m_value, xaccSplitGetAmount (s)));
+
+    /* Test there are only two splits */
+    siter = siter->next;
+    g_assert_null (siter);
+
+    /* Verify whether transaction is still open or not  based on input value */
+    g_assert_true (xaccTransIsOpen (txn) != prefs->docommit);
+
+    xaccTransDestroy (txn);
+}
+
+
+void
+test_suite_split_register_copy_ops (void)
+{
+    SwapCommitPrefs prefs;
+    GNC_TEST_ADD (suitename, "gnc split to float split", Fixture, NULL, setup, test_gnc_split_to_float_split, teardown);
+    GNC_TEST_ADD (suitename, "gnc float split to split", Fixture, NULL, setup, test_gnc_float_split_to_split, teardown);
+    GNC_TEST_ADD (suitename, "gnc float txn to float txn", Fixture, NULL, setup, test_gnc_txn_to_float_txn, teardown);
+    GNC_TEST_ADD (suitename, "gnc float txn to float txn cut semantics", Fixture, NULL, setup, test_gnc_txn_to_float_txn, teardown);
+    GNC_TEST_ADD (suitename, "gnc float txn get float split", FlFixture, NULL, flsetup, test_gnc_float_txn_get_float_split, flteardown);
+    GNC_TEST_ADD (suitename, "gnc float txn get other float split", FlFixture, NULL, flsetup, test_gnc_float_txn_get_other_float_split, flteardown);
+
+    prefs.swap_accts = FALSE;
+    prefs.docommit = FALSE;
+    GNC_TEST_ADD (suitename, "gnc float txn to txn noswap nocommit", FlFixture, &prefs, flsetup, test_gnc_float_txn_to_txn_swap_accounts, flteardown);
+    prefs.docommit = TRUE;
+    GNC_TEST_ADD (suitename, "gnc float txn to txn noswap commit", FlFixture, &prefs, flsetup, test_gnc_float_txn_to_txn_swap_accounts, flteardown);
+    prefs.swap_accts = TRUE;
+    GNC_TEST_ADD (suitename, "gnc float txn to txn swap commit", FlFixture, &prefs, flsetup, test_gnc_float_txn_to_txn_swap_accounts, flteardown);
+    prefs.docommit = FALSE;
+    GNC_TEST_ADD (suitename, "gnc float txn to txn swap nocommit", FlFixture, &prefs, flsetup, test_gnc_float_txn_to_txn_swap_accounts, flteardown);
+
+}

commit 0a635fadee87dc119a97f309e151892a4a62349e
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Mon Oct 7 18:03:43 2019 +0200

    engine - cmake cleanups
    
    - drop no longer used GUILE_LDFLAGS and GUILE_INCLUDE_DIRS
    - use generator expressions where it makes sense

diff --git a/libgnucash/engine/CMakeLists.txt b/libgnucash/engine/CMakeLists.txt
index 06b4e2c59..1208f0193 100644
--- a/libgnucash/engine/CMakeLists.txt
+++ b/libgnucash/engine/CMakeLists.txt
@@ -191,12 +191,8 @@ set (engine_SOURCES
 )
 
 if (WIN32)
-  add_definitions (-DOS_WIN32)
-  set (engine_SOURCES ${engine_SOURCES}
-  qof-win32.cpp
-  ../../borrowed/libc/strptime.c
-  )
-endif (WIN32)
+    add_definitions ("-DOS_WIN32")
+endif()
 
 # Add dependency on config.h
 set_source_files_properties (${engine_SOURCES} PROPERTIES OBJECT_DEPENDS ${CONFIG_H})
@@ -204,21 +200,20 @@ set_source_files_properties (${engine_SOURCES} PROPERTIES OBJECT_DEPENDS ${CONFI
 # Add dependency on iso-4217-currencies.c
 set_source_files_properties (gnc-commodity.c PROPERTIES OBJECT_DEPENDS "${ISO_4217_C};${CONFIG_H}")
 
-
-
 add_library (gncmod-engine
   ${engine_SOURCES}
   ${engine_HEADERS}
   ${engine_noinst_HEADERS}
 )
 
-# Add dependency on swig-runtime.h and iso-4217-currencies.c
+target_sources(gncmod-engine
+    PRIVATE
+        $<$<BOOL:${WIN32}>:qof-win32.cpp>
+        $<$<BOOL:${WIN32}>:${CMAKE_SOURCE_DIR}/borrowed/libc/strptime.c>
+)
+
+# Add dependency on iso-4217-currencies.c
 add_dependencies (gncmod-engine iso-4217-c)
-if (WIN32)
-  set(BCRYPT "bcrypt.lib")
-else()
-  set(BCRYPT "")
-endif()
 
 target_link_libraries(gncmod-engine
     gnc-core-utils
@@ -226,19 +221,17 @@ target_link_libraries(gncmod-engine
     ${Boost_DATE_TIME_LIBRARIES}
     ${Boost_REGEX_LIBRARIES}
     ${ICU4C_I18N_LDFLAGS}
-    ${BCRYPT}
     ${REGEX_LDFLAGS}
     ${GMODULE_LDFLAGS}
     ${GLIB2_LDFLAGS}
     ${GOBJECT_LDFLAGS}
-    ${GUILE_LDFLAGS})
+    $<$<BOOL:${WIN32}>:bcrypt.lib>)
 
 target_compile_definitions (gncmod-engine PRIVATE -DG_LOG_DOMAIN=\"gnc.engine\")
 
 target_include_directories (gncmod-engine
     PRIVATE
         ${CMAKE_CURRENT_BINARY_DIR} # for iso-4217-currencies.c
-        ${GUILE_INCLUDE_DIRS}
     PUBLIC
         ${CMAKE_CURRENT_SOURCE_DIR}
         ${CMAKE_BINARY_DIR}/common # for config.h

commit 2e1b9f937b3e0e2f9752a03ae91b05954787b1f5
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Mon Oct 7 16:39:23 2019 +0200

    engine - drop guile wrappers for obsolete functions
    
    These were marked deprecated early in the 3.x release cycle.

diff --git a/bindings/engine.i b/bindings/engine.i
index 6ecfbdfc0..91d60c4c1 100644
--- a/bindings/engine.i
+++ b/bindings/engine.i
@@ -33,7 +33,6 @@
 #include "gnc-pricedb.h"
 #include "gnc-lot.h"
 #include "gnc-session.h"
-#include "engine-deprecated.h"
 #include "engine-helpers.h"
 #include "gnc-engine-guile.h"
 #include "policy.h"
@@ -80,7 +79,6 @@ engine-common.i */
 %newobject gnc_account_get_full_name;
 
 %include "engine-common.i"
-%include "engine-deprecated.h"
 
 #if defined(SWIGGUILE)
 %ignore QofLogModule;
diff --git a/libgnucash/engine/CMakeLists.txt b/libgnucash/engine/CMakeLists.txt
index 704777ca8..06b4e2c59 100644
--- a/libgnucash/engine/CMakeLists.txt
+++ b/libgnucash/engine/CMakeLists.txt
@@ -10,7 +10,6 @@ set(engine_noinst_HEADERS
   SX-book.h
   SX-ttinfo.h
   TransactionP.h
-  engine-deprecated.h
   gnc-backend-prov.hpp
   gnc-date-p.h
   gnc-int128.hpp
@@ -139,7 +138,6 @@ set (engine_SOURCES
   Transaction.c
   cap-gains.c
   cashobjects.c
-  engine-deprecated.c
   gnc-aqbanking-templates.cpp
   gnc-budget.c
   gnc-commodity.c
diff --git a/libgnucash/engine/engine-deprecated.c b/libgnucash/engine/engine-deprecated.c
deleted file mode 100644
index eba264121..000000000
--- a/libgnucash/engine/engine-deprecated.c
+++ /dev/null
@@ -1,208 +0,0 @@
-/********************************************************************\
- * engine-deprecated.i: Guile wrappers for deleted C functions.     *
- * Copyright 2018 John Ralls <jralls at ceridwen.us>                   *
- *                                                                  *
- * This program is free software; you can redistribute it and/or    *
- * modify it under the terms of the GNU General Public License as   *
- * published by the Free Software Foundation; either version 2 of   *
- * the License, or (at your option) any later version.              *
- *                                                                  *
- * This program is distributed in the hope that it will be useful,  *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
- * GNU General Public License for more details.                     *
- *                                                                  *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact:                        *
- *                                                                  *
- * Free Software Foundation           Voice:  +1-617-542-5942       *
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
- * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
- *                                                                  *
-\********************************************************************/
-
-/* The functions in this file have been removed from the C library and are
- * provided here for backward compatibility. They will be removed completely
- * from the next major release of GnuCash.
- */
-
-#include "engine-deprecated.h"
-
-#include <libguile/deprecation.h>
-
-void xaccSplitSetDateReconciledTS(Split* s, Timespec *ts)
-{
-    scm_c_issue_deprecation_warning("xaccSplitSetDateReconciled is deprecated. Use xaccSplitSetDateReconciledSecs instead.");
-    xaccSplitSetDateReconciledSecs (s, ts->tv_sec);
-}
-
-void xaccSplitGetDateReconciledTS(Split* s, Timespec *ts)
-{
-    scm_c_issue_deprecation_warning("xaccSplitGetDateReconciled is deprecated. Use xaccSplitGetDateReconciledSecs instead.");
-    ts->tv_sec = xaccSplitGetDateReconciled (s);
-    ts->tv_nsec = 0;
-}
-
-Timespec xaccSplitRetDateReconciledTS(Split* s)
-{
-    Timespec ts = {0, 0};
-    scm_c_issue_deprecation_warning("xaccSplitSetDateReconciled is deprecated. Use xaccSplitSetDateReconciledSecs instead.");
-    ts.tv_sec = xaccSplitGetDateReconciled (s);
-    return ts;
-}
-
-Timespec
-gnc_transaction_get_date_posted(const Transaction *t)
-{
-    Timespec ts = {0, 0};
-    scm_c_issue_deprecation_warning("gnc_transaction_get_date_posted is deprecated. Use xaccTransRetDatePosted instead.");
-    ts.tv_sec = xaccTransRetDatePosted(t);
-    return ts;
-}
-
-Timespec
-gnc_transaction_get_date_entered(const Transaction *t)
-{
-    Timespec ts = {0, 0};
-    scm_c_issue_deprecation_warning("gnc_transaction_get_date_entered is deprecated. Use xaccTransGetDateEntered instead.");
-    ts.tv_sec = xaccTransRetDateEntered(t);
-    return ts;
-}
-
-Timespec
-gnc_split_get_date_reconciled(const Split *s)
-{
-    Timespec ts = {0, 0};
-    scm_c_issue_deprecation_warning("gnc_split_get_date_reconciled is deprecated. Use xaccSplitGetDateReconciled instead.");
-    ts.tv_sec = xaccSplitGetDateReconciled(s);
-    return ts;
-}
-
-void
-gnc_transaction_set_date(Transaction *t, Timespec ts)
-{
-    scm_c_issue_deprecation_warning("gnc_transaction_set_date is deprecated. Use xaccTransSetDatePostedSecs instead.");
-    xaccTransSetDatePostedSecs(t, ts.tv_sec);
-}
-
-Timespec
-gncTaxTableLastModified (const GncTaxTable *table)
-{
-    Timespec t = {0, 0};
-    scm_c_issue_deprecation_warning("gncTaxTableLastModified is deprecated. Use gncTaxTableLastModifiedSecs instead.");
-    t.tv_sec = gncTaxTableLastModifiedSecs (table);
-    return t;
-}
-
-void
-gncOwnerApplyPayment (const GncOwner *owner, Transaction **preset_txn,
-                           GList *lots, Account *posted_acc, Account *xfer_acc,
-                           gnc_numeric amount, gnc_numeric exch, Timespec date,
-                           const char *memo, const char *num,
-                           gboolean auto_pay)
-{
-    scm_c_issue_deprecation_warning("gncOwnerApplyPayment is deprecated. Use gncOwnerApplyPaymentSecs instead.");
-    gncOwnerApplyPaymentSecs (owner, preset_txn, lots, posted_acc,
-                              xfer_acc, amount, exch, date.tv_sec,
-                              memo, num, auto_pay);
-}
-
-GNCLot*
-gncOwnerCreatePaymentLot (const GncOwner *owner,
-                                  Transaction **preset_txn, Account *posted_acc,
-                                  Account *xfer_acc, gnc_numeric amount,
-                                  gnc_numeric exch, Timespec date,
-                                  const char *memo, const char *num)
-{
-    GNCLot* lot = NULL;
-    scm_c_issue_deprecation_warning("gncOwnerCreatePaymentLot is deprecated. Use gncOwnerCreatePaymentLotSecs instead.");
-    lot = gncOwnerCreatePaymentLotSecs (owner, preset_txn, posted_acc,
-                                        xfer_acc, amount, exch, date.tv_sec,
-                                        memo, num);
-    return lot;
-}
-
-void
-gnc_price_set_time (GNCPrice *p, Timespec t)
-{
-    scm_c_issue_deprecation_warning("gnc_price_set_time is deprecated. Use gnc_price_set_time64 instead.");
-    gnc_price_set_time64(p, t.tv_sec);
-}
-
-Timespec
-gnc_price_get_time (GNCPrice *p)
-{
-    Timespec t = {0, 0};
-    scm_c_issue_deprecation_warning("gnc_price_get_time is deprecated. Use gnc_price_get_time64 instead.");
-    t.tv_sec = gnc_price_get_time64(p);
-    return t;
-}
-
-GNCPrice*
-gnc_pricedb_lookup_at_time(GNCPriceDB *db,
-                           const gnc_commodity *commodity,
-                           const gnc_commodity *currency,
-                           Timespec t)
-{
-    scm_c_issue_deprecation_warning("gnc_pricedb_lookup_at_time is deprecated. Use gnc_pricedb_lookup_at_time64 instead.");
-    return gnc_pricedb_lookup_at_time64(db, commodity, currency, t.tv_sec);
-}
-
-GNCPrice*
-gnc_pricedb_lookup_day(GNCPriceDB *db,
-                       const gnc_commodity *commodity,
-                       const gnc_commodity *currency,
-                       Timespec t)
-{
-    scm_c_issue_deprecation_warning("gnc_pricedb_lookup_day is deprecated. Use gnc_pricedb_lookup_day_t64 instead.");
-    return gnc_pricedb_lookup_day_t64(db, commodity, currency, t.tv_sec);
-}
-
-GNCPrice*
-gnc_pricedb_lookup_nearest_in_time(GNCPriceDB *db,
-                                   const gnc_commodity *c,
-                                   const gnc_commodity *currency,
-                                   Timespec t)
-{
-    scm_c_issue_deprecation_warning("gnc_pricedb_lookup_nearest_in_time is deprecated. Use gnc_pricedb_lookup_nearest_in_time64 instead.");
-    return gnc_pricedb_lookup_nearest_in_time64(db, c, currency, t.tv_sec);
-}
-
-PriceList*
-gnc_pricedb_lookup_nearest_in_time_any_currency(GNCPriceDB *db,
-                                                const gnc_commodity *c,
-                                                Timespec t)
-{
-    scm_c_issue_deprecation_warning("gnc_pricedb_lookup_nearest_in_time_any_currency is deprecated. Use gnc_pricedb_lookup_nearest_in_time_any_currency_t64 instead.");
-    return gnc_pricedb_lookup_nearest_in_time_any_currency_t64(db, c, t.tv_sec);
-}
-
-GNCPrice*
-gnc_pricedb_lookup_latest_before(GNCPriceDB *db,
-                                 gnc_commodity *c,
-                                 gnc_commodity *currency,
-                                 Timespec t)
-{
-    scm_c_issue_deprecation_warning("gnc_pricedb_lookup_latest_before is deprecated. Use gnc_pricedb_lookup_latest_before_t64 instead.");
-    return gnc_pricedb_lookup_latest_before_t64(db, c, currency, t.tv_sec);
-}
-
-PriceList*
-gnc_pricedb_lookup_latest_before_any_currency(GNCPriceDB *db,
-                                              const gnc_commodity *c,
-                                              Timespec t)
-{
-    scm_c_issue_deprecation_warning("gnc_pricedb_lookup_latest_before_any_currency is deprecated. Use gnc_pricedb_lookup_latest_before_any_currency_t64 instead.");
-    return gnc_pricedb_lookup_latest_before_any_currency_t64(db, c, t.tv_sec);
-}
-
-gnc_numeric
-gnc_pricedb_convert_balance_nearest_price(GNCPriceDB *pdb,
-                                          gnc_numeric balance,
-                                          const gnc_commodity *balance_currency,
-                                          const gnc_commodity *new_currency,
-                                          Timespec t)
-{
-    scm_c_issue_deprecation_warning("gnc_pricedb_convert_balance_nearest_price is deprecated. Use gnc_pricedb_convert_balance_nearest_price_t64 instead.");
-    return gnc_pricedb_convert_balance_nearest_price_t64(pdb, balance, balance_currency, new_currency, t.tv_sec);
-}
diff --git a/libgnucash/engine/engine-deprecated.h b/libgnucash/engine/engine-deprecated.h
deleted file mode 100644
index 90bd4a1ad..000000000
--- a/libgnucash/engine/engine-deprecated.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/********************************************************************\
- * engine-deprecated.h: Guile wrappers for deleted C functions.     *
- * Copyright 2018 John Ralls <jralls at ceridwen.us>                   *
- *                                                                  *
- * This program is free software; you can redistribute it and/or    *
- * modify it under the terms of the GNU General Public License as   *
- * published by the Free Software Foundation; either version 2 of   *
- * the License, or (at your option) any later version.              *
- *                                                                  *
- * This program is distributed in the hope that it will be useful,  *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
- * GNU General Public License for more details.                     *
- *                                                                  *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact:                        *
- *                                                                  *
- * Free Software Foundation           Voice:  +1-617-542-5942       *
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
- * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
- *                                                                  *
-\********************************************************************/
-
-#include "config.h"
-#include "Split.h"
-#include "Transaction.h"
-#include "gncTaxTable.h"
-#include "gncOwner.h"
-
-typedef struct
-{
-    time64 tv_sec;
-    time64 tv_nsec;
-} Timespec;
-
-
-void xaccSplitSetDateReconciledTS(Split* s, Timespec *ts);
-void xaccSplitGetDateReconciledTS(Split* s, Timespec *ts);
-Timespec xaccSplitRetDateReconciledTS(Split* s);
-
-Timespec gnc_transaction_get_date_posted(const Transaction *t);
-Timespec gnc_transaction_get_date_entered(const Transaction *t);
-Timespec gnc_split_get_date_reconciled(const Split *s);
-void gnc_transaction_set_date(Transaction *t, Timespec ts);
-
-Timespec gncTaxTableLastModified (const GncTaxTable *table);
-
-void gncOwnerApplyPayment (const GncOwner *owner, Transaction **preset_txn,
-                           GList *lots, Account *posted_acc, Account *xfer_acc,
-                           gnc_numeric amount, gnc_numeric exch, Timespec date,
-                           const char *memo, const char *num,
-                           gboolean auto_pay);
-
-GNCLot* gncOwnerCreatePaymentLot (const GncOwner *owner,
-                                  Transaction **preset_txn, Account *posted_acc,
-                                  Account *xfer_acc, gnc_numeric amount,
-                                  gnc_numeric exch, Timespec date,
-                                  const char *memo, const char *num);
-
-void gnc_price_set_time (GNCPrice *p, Timespec t);
-Timespec gnc_price_get_time (GNCPrice *p);
-GNCPrice* gnc_pricedb_lookup_at_time(GNCPriceDB *db,
-                                     const gnc_commodity *commodity,
-                                     const gnc_commodity *currency,
-                                     Timespec t);
-GNCPrice* gnc_pricedb_lookup_day(GNCPriceDB *db,
-                                 const gnc_commodity *commodity,
-                                 const gnc_commodity *currency,
-                                 Timespec t);
-GNCPrice* gnc_pricedb_lookup_nearest_in_time(GNCPriceDB *db,
-                                             const gnc_commodity *c,
-                                             const gnc_commodity *currency,
-                                             Timespec t);
-PriceList* gnc_pricedb_lookup_nearest_in_time_any_currency(GNCPriceDB *db,
-                                                           const gnc_commodity *c,
-                                                           Timespec t);
-GNCPrice* gnc_pricedb_lookup_latest_before(GNCPriceDB *db,
-                                           gnc_commodity *c,
-                                           gnc_commodity *currency,
-                                           Timespec t);
-PriceList* gnc_pricedb_lookup_latest_before_any_currency(GNCPriceDB *db,
-                                                         const gnc_commodity *c,
-                                                         Timespec t);
-gnc_numeric
-gnc_pricedb_convert_balance_nearest_price(GNCPriceDB *pdb,
-                                          gnc_numeric balance,
-                                          const gnc_commodity *balance_currency,
-                                          const gnc_commodity *new_currency,
-                                          Timespec t);
-
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 3134ba0bb..96b91a996 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -626,7 +626,6 @@ libgnucash/doc/doxygen_main_page.c
 libgnucash/engine/Account.cpp
 libgnucash/engine/cap-gains.c
 libgnucash/engine/cashobjects.c
-libgnucash/engine/engine-deprecated.c
 libgnucash/engine/engine-helpers.c
 libgnucash/engine/gncAddress.c
 libgnucash/engine/gnc-aqbanking-templates.cpp

commit 04f10d66fa3d6ea838fe51860608e99dd9519235
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat Oct 5 17:54:44 2019 +0200

    engine cosmetics - remove a few references to guile that are no longer relevant

diff --git a/libgnucash/engine/engine-helpers.c b/libgnucash/engine/engine-helpers.c
index 24bb5f077..e92f55459 100644
--- a/libgnucash/engine/engine-helpers.c
+++ b/libgnucash/engine/engine-helpers.c
@@ -103,8 +103,8 @@ gnc_get_action_num (const Transaction *trans, const Split *split)
   * sets split-action and, if 'tran' and 'action' are provided, 'action'
   * sets transaction-num; if book option is FALSE (tran-num is to be used for NUM)
   * then 'num' sets transaction-num and, if 'split' and 'action' are
-  * provided, 'action' sets 'split-action'. If any arguments are NULL (#f, for
-  * the guile version), no change is made to the field that would otherwise be
+  * provided, 'action' sets 'split-action'. If any arguments are NULL,
+  * no change is made to the field that would otherwise be
   * affected. If 'tran' and 'num' are passed with 'split and 'action' set to
   * NULL, it is xaccTransSetNum (trans, num). Likewise, if 'split and 'action'
   * are passed with 'tran' and 'num' set to NULL, it is xaccSplitSetAction (split,
diff --git a/libgnucash/engine/engine-helpers.h b/libgnucash/engine/engine-helpers.h
index 6fc38a307..4b3abe6ee 100644
--- a/libgnucash/engine/engine-helpers.h
+++ b/libgnucash/engine/engine-helpers.h
@@ -56,8 +56,8 @@ const char *  gnc_get_action_num (const Transaction *trans, const Split *split);
   * sets split-action and, if 'tran' and 'action' are provided, 'action'
   * sets transaction-num; if book option is FALSE (tran-num is to be used for NUM)
   * then 'num' sets transaction-num and, if 'split' and 'action' are
-  * provided, 'action' sets 'split-action'. If any arguments are NULL (#f, for
-  * the guile version), no change is made to the field that would otherwise be
+  * provided, 'action' sets 'split-action'. If any arguments are NULL,
+  * no change is made to the field that would otherwise be
   * affected. If 'tran' and 'num' are passed with 'split and 'action' set to
   * NULL, it is xaccTransSetNum (trans, num). Likewise, if 'split and 'action'
   * are passed with 'tran' and 'num' set to NULL, it is xaccSplitSetAction (split,
diff --git a/libgnucash/engine/test/test-business.c b/libgnucash/engine/test/test-business.c
index dfec918ca..d2cd08d21 100644
--- a/libgnucash/engine/test/test-business.c
+++ b/libgnucash/engine/test/test-business.c
@@ -25,7 +25,6 @@
 
 #include <config.h>
 #include <glib.h>
-#include <libguile.h>
 
 #include "qof.h"
 #include "gnc-module.h"
@@ -121,9 +120,9 @@ test_printable (const char *name, gpointer obj)
 }
 
 static void
-main_helper (void *closure, int argc, char **argv)
+main_helper (int argc, char **argv)
 {
-    gnc_module_load("gnucash/engine", 0);
+    gnc_engine_init(argc, argv);
     test_business();
     print_test_results();
     exit(get_rv());
@@ -134,6 +133,6 @@ int
 main (int argc, char **argv)
 {
     g_setenv ("GNC_UNINSTALLED", "1", TRUE);
-    //  scm_boot_guile (argc, argv, main_helper, NULL);
+    //main_helper (argc, argv);
     return get_rv();
 }
diff --git a/libgnucash/engine/test/test-customer.c b/libgnucash/engine/test/test-customer.c
index fd8472918..7856798ef 100644
--- a/libgnucash/engine/test/test-customer.c
+++ b/libgnucash/engine/test/test-customer.c
@@ -1,6 +1,6 @@
 /*********************************************************************
  * test-customer.c
- * Test the customer object (without Guile/Scheme)
+ * Test the customer object
  *
  * Copyright (c) 2001 Derek Atkins <warlord at MIT.EDU>
  * Copyright (c) 2005 Neil Williams <linux at codehelp.co.uk>
diff --git a/libgnucash/engine/test/test-employee.c b/libgnucash/engine/test/test-employee.c
index 3f3fdb3a7..e7f476da3 100644
--- a/libgnucash/engine/test/test-employee.c
+++ b/libgnucash/engine/test/test-employee.c
@@ -1,6 +1,6 @@
 /*********************************************************************
  * test-employee.c
- * Test the employee object (without Guile).
+ * Test the employee object.
  *
  * Copyright (c) 2001 Derek Atkins <warlord at MIT.EDU>
  * Copyright (c) 2005 Neil Williams <linux at codehelp.co.uk>
diff --git a/libgnucash/engine/test/test-transaction-reversal.cpp b/libgnucash/engine/test/test-transaction-reversal.cpp
index 94f01ce56..c8e918e4f 100644
--- a/libgnucash/engine/test/test-transaction-reversal.cpp
+++ b/libgnucash/engine/test/test-transaction-reversal.cpp
@@ -1,7 +1,6 @@
 /***************************************************************************
  *            test-transaction-reversal.c
  *
- *  Modified to run without Guile: Mon Aug 22 11:19:56 2005
  *  Copyright  2005  Neil Williams
  *  linux at codehelp.co.uk
  ****************************************************************************/
diff --git a/libgnucash/engine/test/test-transaction-voiding.cpp b/libgnucash/engine/test/test-transaction-voiding.cpp
index fcc86e166..f6037d178 100644
--- a/libgnucash/engine/test/test-transaction-voiding.cpp
+++ b/libgnucash/engine/test/test-transaction-voiding.cpp
@@ -1,7 +1,6 @@
 /***************************************************************************
  *            test-transaction-voiding.c
  *
- *  Modified to run without Guile: Mon Aug 22 11:24:44 2005
  *  Copyright  2005  Neil Williams
  *  linux at codehelp.co.uk
  ****************************************************************************/

commit c46c9682eb1400dad1796288f641246eb90e46ed
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat Oct 5 17:27:48 2019 +0200

    engine/test - move guile related tests to bindings

diff --git a/bindings/engine.i b/bindings/engine.i
index 84e80e2db..6ecfbdfc0 100644
--- a/bindings/engine.i
+++ b/bindings/engine.i
@@ -38,7 +38,7 @@
 #include "gnc-engine-guile.h"
 #include "policy.h"
 #include "SX-book.h"
-#include "gnc-kvm-guile.h"
+#include "gnc-kvp-guile.h"
 #include "glib-guile.h"
 
 #include "gncAddress.h"
diff --git a/bindings/guile/gnc-kvp-guile.cpp b/bindings/guile/gnc-kvp-guile.cpp
index 7a212b6af..e9748ebbf 100644
--- a/bindings/guile/gnc-kvp-guile.cpp
+++ b/bindings/guile/gnc-kvp-guile.cpp
@@ -11,7 +11,7 @@ extern "C"
 #include "guile-mappings.h"
 #include "gnc-engine-guile.h"
 #include "gnc-guile-utils.h"
-#include "gnc-kvm-guile.h"
+#include "gnc-kvp-guile.h"
 }
 
 /* NOTE: There are some problems with this approach. Currently,
diff --git a/bindings/guile/test/CMakeLists.txt b/bindings/guile/test/CMakeLists.txt
index 7fa1ca1ce..8117b2288 100644
--- a/bindings/guile/test/CMakeLists.txt
+++ b/bindings/guile/test/CMakeLists.txt
@@ -1,33 +1,130 @@
-set(scm_test_SCHEME
-  test-scm-utilities.scm
-  test-module-deprecation.scm
-  )
+# C(++) tests requiring a proper guile environment set up
+
+set(ENGINE_TEST_INCLUDE_DIRS
+    ${CMAKE_SOURCE_DIR}/libgnucash/backend/xml
+    ${CMAKE_SOURCE_DIR}/libgnucash/engine
+    ${CMAKE_SOURCE_DIR}/libgnucash/engine/test-core
+    ${CMAKE_BINARY_DIR}/common # for config.h
+    ${CMAKE_SOURCE_DIR}/common/test-core  # for unittest-support.h
+    ${CMAKE_SOURCE_DIR}/bindings/guile # for gnc-engine-guile.h
+    ${GLIB2_INCLUDE_DIRS}
+)
+
+set(ENGINE_TEST_LIBS
+    gncmod-engine
+    gncmod-test-engine
+    test-core
+    gnucash-guile
+    ${LIBXML2_LDFLAGS}
+    -lm)
+
+gnc_add_test_with_guile(test-scm-query test-scm-query.cpp ENGINE_TEST_INCLUDE_DIRS ENGINE_TEST_LIBS)
+
+
+# Scheme tests
+
+
+set(engine_test_SCHEME
+    test-create-account.scm
+)
+
+#list(APPEND engine_test_SCHEME  test-scm-query-import.scm) Fails
+
+set(GUILE_DEPENDS
+    scm-gnc-module
+    scm-app-utils
+    scm-engine)
+
+gnc_add_scheme_test_targets(scm-test-engine-extras
+    "test-engine-extras.scm"
+    "tests"
+    "${GUILE_DEPENDS}"
+    FALSE
+)
+
+# Module interfaces deprecated in 4.x, will be removed for 5.x
+gnc_add_scheme_deprecated_module ("gnucash engine test test-extras" "tests test-engine-extras" "scm-test-engine-extras" "")
+
+gnc_add_scheme_test_targets(scm-test-engine
+    "${engine_test_SCHEME}"
+    "tests"
+    "${GUILE_DEPENDS};scm-test-engine-extras"
+    FALSE
+)
+
+
+add_dependencies(check scm-test-engine)
+gnc_add_scheme_tests("${engine_test_SCHEME}")
+
+if (HAVE_SRFI64)
+    gnc_add_scheme_test_targets (scm-srfi64-extras
+        "srfi64-extras.scm"
+        "tests"
+        "${GUILE_DEPENDS};scm-test-engine-extras;scm-srfi64-extras"
+        FALSE
+    )
+
+    # Module interfaces deprecated in 4.x, will be removed for 5.x
+    gnc_add_scheme_deprecated_module ("gnucash engine test srfi64-extras" "tests srfi64-extras" "scm-srfi64-extras" "")
+
+    set (scm_tests_with_srfi64_SOURCES
+        test-business-core.scm
+        )
+
+    gnc_add_scheme_test_targets (scm-test-with-srfi64
+        "${scm_tests_with_srfi64_SOURCES}"
+        "tests"
+        "${GUILE_DEPENDS};scm-test-engine-extras;scm-srfi64-extras;gncmod-engine"
+        FALSE
+    )
+
+    gnc_add_scheme_tests("${scm_tests_with_srfi64_SOURCES}")
+    add_dependencies(check scm-srfi64-extras)
+endif (HAVE_SRFI64)
+
+
+set(test_scm_SCHEME
+    test-scm-utilities.scm
+    test-module-deprecation.scm
+)
 
 set(GUILE_DEPENDS
-  scm-gnc-module
-  scm-app-utils
-  scm-engine
-  scm-srfi64-extras
-  scm-deprecated-gnucash-deprecated-module
-  scm-deprecated-gnucash-superseded-module
-  )
+    scm-gnc-module
+    scm-app-utils
+    scm-engine
+    scm-srfi64-extras
+    scm-deprecated-gnucash-deprecated-module
+    scm-deprecated-gnucash-superseded-module
+)
 
 if (HAVE_SRFI64)
   gnc_add_scheme_test_targets(scm-test-scm
-    "${scm_test_SCHEME}"
+    "${test_scm_SCHEME}"
     "tests"
     "${GUILE_DEPENDS}"
     FALSE
     )
 
-  gnc_add_scheme_tests("${scm_test_SCHEME}")
+  gnc_add_scheme_tests("${test_scm_SCHEME}")
 
 endif (HAVE_SRFI64)
 
+
+
+set(test_engine_SCHEME_DIST
+    srfi64-extras.scm
+    test-create-account.scm
+    test-engine-extras.scm
+    test-scm-query-import.scm
+    test-business-core.scm
+)
+
 set_dist_list(test_guile_DIST
-  CMakeLists.txt
-  ${scm_test_SCHEME}
-  )
+    CMakeLists.txt
+    test-scm-query.cpp
+    ${test_engine_SCHEME_DIST}
+    ${test_scm_SCHEME}
+)
 
 # Define two imaginary deprecated guile modules to test the compat file generation code
 gnc_add_scheme_deprecated_module ("gnucash deprecated-module" "" "" "")
diff --git a/libgnucash/engine/test/srfi64-extras.scm b/bindings/guile/test/srfi64-extras.scm
similarity index 100%
rename from libgnucash/engine/test/srfi64-extras.scm
rename to bindings/guile/test/srfi64-extras.scm
diff --git a/libgnucash/engine/test/test-business-core.scm b/bindings/guile/test/test-business-core.scm
similarity index 100%
rename from libgnucash/engine/test/test-business-core.scm
rename to bindings/guile/test/test-business-core.scm
diff --git a/libgnucash/engine/test/test-create-account.scm b/bindings/guile/test/test-create-account.scm
similarity index 100%
rename from libgnucash/engine/test/test-create-account.scm
rename to bindings/guile/test/test-create-account.scm
diff --git a/libgnucash/engine/test/test-engine-extras.scm b/bindings/guile/test/test-engine-extras.scm
similarity index 100%
rename from libgnucash/engine/test/test-engine-extras.scm
rename to bindings/guile/test/test-engine-extras.scm
diff --git a/libgnucash/engine/test/test-scm-query-import.scm b/bindings/guile/test/test-scm-query-import.scm
similarity index 100%
rename from libgnucash/engine/test/test-scm-query-import.scm
rename to bindings/guile/test/test-scm-query-import.scm
diff --git a/libgnucash/engine/test/CMakeLists.txt b/libgnucash/engine/test/CMakeLists.txt
index 867adceaf..2aa68d317 100644
--- a/libgnucash/engine/test/CMakeLists.txt
+++ b/libgnucash/engine/test/CMakeLists.txt
@@ -6,11 +6,10 @@ set(ENGINE_TEST_INCLUDE_DIRS
   ${CMAKE_SOURCE_DIR}/libgnucash/engine/test-core
   ${CMAKE_BINARY_DIR}/common # for config.h
   ${CMAKE_SOURCE_DIR}/common/test-core  # for unittest-support.h
-  ${CMAKE_SOURCE_DIR}/bindings/guile # for gnc-engine-guile.h
   ${GLIB2_INCLUDE_DIRS}
 )
 
-set(ENGINE_TEST_LIBS gncmod-engine gncmod-test-engine test-core gnucash-guile ${LIBXML2_LDFLAGS} -lm)
+set(ENGINE_TEST_LIBS gncmod-engine gncmod-test-engine test-core ${LIBXML2_LDFLAGS} -lm)
 
 macro(add_engine_test _TARGET _SOURCE_FILES)
   gnc_add_test(${_TARGET} "${_SOURCE_FILES}" ENGINE_TEST_INCLUDE_DIRS ENGINE_TEST_LIBS)
@@ -202,66 +201,6 @@ gtest-qofquerycore.cpp)
 gnc_add_test(test-qofquerycore "${test_qofquerycore_SOURCES}"
   gtest_engine_INCLUDES gtest_old_engine_LIBS)
 
-############################
-# This is a C test that needs GUILE environment variables set.
-# It does not pass on Win32.
-gnc_add_test_with_guile(test-scm-query test-scm-query.cpp ENGINE_TEST_INCLUDE_DIRS ENGINE_TEST_LIBS)
-############################
-
-
-set(engine_test_SCHEME
-  test-create-account.scm
-  )
-
-#list(APPEND engine_test_SCHEME  test-scm-query-import.scm) Fails
-
-set(GUILE_DEPENDS      scm-gnc-module scm-app-utils scm-engine)
-
-gnc_add_scheme_test_targets(scm-test-engine-extras
-  "test-engine-extras.scm"
-  "tests"
-  "${GUILE_DEPENDS}"
-  FALSE
-  )
-
-if (HAVE_SRFI64)
-  gnc_add_scheme_test_targets (scm-srfi64-extras
-    "srfi64-extras.scm"
-    "tests"
-    "${GUILE_DEPENDS};scm-test-engine-extras;scm-srfi64-extras"
-    FALSE
-    )
-
-  gnc_add_scheme_deprecated_module ("gnucash engine test srfi64-extras" "tests srfi64-extras" "scm-srfi64-extras" "")
-
-  set (scm_tests_with_srfi64_SOURCES
-    test-business-core.scm
-    )
-
-  gnc_add_scheme_test_targets (scm-test-with-srfi64
-    "${scm_tests_with_srfi64_SOURCES}"
-    "tests"
-    "${GUILE_DEPENDS};scm-test-engine-extras;scm-srfi64-extras;gncmod-engine"
-    FALSE
-    )
-
-  gnc_add_scheme_tests("${scm_tests_with_srfi64_SOURCES}")
-  add_dependencies(check scm-srfi64-extras)
-endif (HAVE_SRFI64)
-
-gnc_add_scheme_test_targets(scm-test-engine
-  "${engine_test_SCHEME}"
-  "tests"
-  "${GUILE_DEPENDS};scm-test-engine-extras"
-  FALSE
-  )
-
-add_dependencies(check scm-test-engine)
-gnc_add_scheme_tests("${engine_test_SCHEME}")
-
-# Module interfaces deprecated in 4.x, will be removed for 5.x
-gnc_add_scheme_deprecated_module ("gnucash engine test test-extras" "tests test-engine-extras" "scm-test-engine-extras" "")
-
 
 set(test_engine_SOURCES_DIST
         dummy.cpp
@@ -302,7 +241,6 @@ set(test_engine_SOURCES_DIST
         test-query.cpp
         test-querynew.c
         test-recurrence.c
-        test-scm-query.cpp
         test-split-vs-account.cpp
         test-transaction-reversal.cpp
         test-transaction-voiding.cpp
@@ -316,17 +254,9 @@ set(test_engine_SOURCES_DIST
         utest-gnc-pricedb.c
 )
 
-set(test_engine_SCHEME_DIST
-        srfi64-extras.scm
-        test-create-account.scm
-        test-engine-extras.scm
-        test-scm-query-import.scm
-        test-business-core.scm
-)
-
 set(test_engine_EXTRA_DIST
         README
 )
 
 set_dist_list(test_engine_DIST CMakeLists.txt
-        ${test_engine_SOURCES_DIST} ${test_engine_SCHEME_DIST} ${test_engine_EXTRA_DIST})
+        ${test_engine_SOURCES_DIST} ${test_engine_EXTRA_DIST})

commit 02511401b7d72b0e23613db2d70469428b1772a1
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat Oct 5 16:48:37 2019 +0200

    bindings/guile cosmetic - rename source files for consistency

diff --git a/bindings/business-core.i b/bindings/business-core.i
index 81ae0552e..d4862251b 100644
--- a/bindings/business-core.i
+++ b/bindings/business-core.i
@@ -126,7 +126,7 @@ GLIST_HELPER_INOUT(OwnerList, SWIGTYPE_p__gncOwner);
 %include <gncTaxTable.h>
 %include <gncVendor.h>
 #if defined(SWIGGUILE)
-%include <engine-helpers-guile.h>
+%include <gnc-engine-guile.h>
 #endif
 /* Import query bindings for the below invoice query functions (but
  * don't generate bindings for them). */
diff --git a/bindings/engine.i b/bindings/engine.i
index c19f46c68..84e80e2db 100644
--- a/bindings/engine.i
+++ b/bindings/engine.i
@@ -35,11 +35,11 @@
 #include "gnc-session.h"
 #include "engine-deprecated.h"
 #include "engine-helpers.h"
-#include "engine-helpers-guile.h"
+#include "gnc-engine-guile.h"
 #include "policy.h"
 #include "SX-book.h"
-#include "kvp-scm.h"
-#include "glib-helpers.h"
+#include "gnc-kvm-guile.h"
+#include "glib-guile.h"
 
 #include "gncAddress.h"
 #include "gncBillTerm.h"
@@ -174,7 +174,7 @@ functions. */
 }
 
 %include <engine-helpers.h>
-%include <engine-helpers-guile.h>
+%include <gnc-engine-guile.h>
 %typemap(in) Transaction *trans;
 %typemap(in) Split *split;
 %typemap(in) char * num;
diff --git a/bindings/guile/CMakeLists.txt b/bindings/guile/CMakeLists.txt
index cdd83d21f..3810a423d 100644
--- a/bindings/guile/CMakeLists.txt
+++ b/bindings/guile/CMakeLists.txt
@@ -21,17 +21,17 @@ gnc_add_swig_guile_command (swig-engine-c
 )
 
 set(guile_HEADERS
-    engine-helpers-guile.h
-    glib-helpers.h
+    glib-guile.h
+    gnc-engine-guile.h
     gnc-guile-utils.h
-    kvp-scm.h)
+    gnc-kvp-guile.h)
 
 set(guile_SOURCES
-    engine-helpers-guile.c
-    glib-helpers.c
+    glib-guile.c
+    gnc-engine-guile.c
     gnc-guile-bindings.c
     gnc-guile-utils.c
-    kvp-scm.cpp)
+    gnc-kvp-guile.cpp)
 
 add_library(gnucash-guile SHARED
     ${guile_SOURCES}
diff --git a/bindings/guile/glib-helpers.c b/bindings/guile/glib-guile.c
similarity index 98%
rename from bindings/guile/glib-helpers.c
rename to bindings/guile/glib-guile.c
index 9651c6f09..943494cbc 100644
--- a/bindings/guile/glib-helpers.c
+++ b/bindings/guile/glib-guile.c
@@ -1,5 +1,5 @@
 /********************************************************************\
- * gnc-helpers.c -- gnucash glib helper functions                   *
+ * glib-guile.c -- glib helper functions for guile                  *
  * Copyright (C) 2000 Linas Vepstas                                 *
  * Copyright (C) 2006 Chris Shoemaker <c.shoemaker at cox.net>         *
  *                                                                  *
@@ -30,7 +30,7 @@
 #include "swig-runtime.h"
 #include "guile-mappings.h"
 #include "gnc-guile-utils.h"
-#include "glib-helpers.h"
+#include "glib-guile.h"
 
 
 static SCM
diff --git a/bindings/guile/glib-helpers.h b/bindings/guile/glib-guile.h
similarity index 94%
rename from bindings/guile/glib-helpers.h
rename to bindings/guile/glib-guile.h
index 1ac8ba85f..f2f69f194 100644
--- a/bindings/guile/glib-helpers.h
+++ b/bindings/guile/glib-guile.h
@@ -1,5 +1,5 @@
 /********************************************************************\
- * glib-helpers.h -- gnucash glib helper functions                  *
+ * glib-guile.h -- glib helper functions for guile                  *
  * Copyright (C) 2000 Linas Vepstas                                 *
  * Copyright (C) 2006 Chris Shoemaker <c.shoemaker at cox.net>         *
  *                                                                  *
@@ -22,8 +22,8 @@
  *                                                                  *
 \********************************************************************/
 
-#ifndef GLIB_HELPERS_H
-#define GLIB_HELPERS_H
+#ifndef GLIB_GUILE_H
+#define GLIB_GUILE_H
 
 #include <glib.h>
 #include <libguile.h>
diff --git a/bindings/guile/engine-helpers-guile.c b/bindings/guile/gnc-engine-guile.c
similarity index 99%
rename from bindings/guile/engine-helpers-guile.c
rename to bindings/guile/gnc-engine-guile.c
index f9ee52708..c047fa6d4 100644
--- a/bindings/guile/engine-helpers-guile.c
+++ b/bindings/guile/gnc-engine-guile.c
@@ -1,5 +1,5 @@
 /********************************************************************\
- * engine-helpers-guile.c -- engine helper functions for guile      *
+ * gnc-engine-guile.c -- engine helper functions for guile          *
  * Copyright (C) 2000 Linas Vepstas <linas at linas.org>               *
  * Copyright (C) 2001 Linux Developers Group, Inc.                  *
  *                                                                  *
@@ -30,8 +30,8 @@
 
 #include "Account.h"
 #include "engine-helpers.h"
-#include "engine-helpers-guile.h"
-#include "glib-helpers.h"
+#include "gnc-engine-guile.h"
+#include "glib-guile.h"
 #include "gnc-date.h"
 #include "gnc-engine.h"
 #include "gnc-session.h"
diff --git a/bindings/guile/engine-helpers-guile.h b/bindings/guile/gnc-engine-guile.h
similarity index 95%
rename from bindings/guile/engine-helpers-guile.h
rename to bindings/guile/gnc-engine-guile.h
index ff3e4edab..3f7397219 100644
--- a/bindings/guile/engine-helpers-guile.h
+++ b/bindings/guile/gnc-engine-guile.h
@@ -1,5 +1,5 @@
 /********************************************************************\
- * engine-helpers-guile.h -- engine helper functions for guile      *
+ * gnc-engine-guile.h -- engine helper functions for guile          *
  * Copyright (C) 2000 Linas Vepstas <linas at linas.org>               *
  * Copyright (C) 2001 Linux Developers Group, Inc.                  *
  *                                                                  *
@@ -22,8 +22,8 @@
  *                                                                  *
 \********************************************************************/
 
-#ifndef ENGINE_HELPERS_GUILE_H
-#define ENGINE_HELPERS_GUILE_H
+#ifndef GNC_ENGINE_GUILE_H
+#define GNC_ENGINE_GUILE_H
 
 #include <glib.h>
 #include <libguile.h>
diff --git a/bindings/guile/kvp-scm.cpp b/bindings/guile/gnc-kvp-guile.cpp
similarity index 98%
rename from bindings/guile/kvp-scm.cpp
rename to bindings/guile/gnc-kvp-guile.cpp
index 79d76372c..7a212b6af 100644
--- a/bindings/guile/kvp-scm.cpp
+++ b/bindings/guile/gnc-kvp-guile.cpp
@@ -9,9 +9,9 @@ extern "C"
 #include <qof.h>
 #include "swig-runtime.h"
 #include "guile-mappings.h"
-#include "engine-helpers-guile.h"
+#include "gnc-engine-guile.h"
 #include "gnc-guile-utils.h"
-#include "kvp-scm.h"
+#include "gnc-kvm-guile.h"
 }
 
 /* NOTE: There are some problems with this approach. Currently,
diff --git a/bindings/guile/kvp-scm.h b/bindings/guile/gnc-kvp-guile.h
similarity index 100%
rename from bindings/guile/kvp-scm.h
rename to bindings/guile/gnc-kvp-guile.h
diff --git a/libgnucash/engine/test/test-scm-query.cpp b/bindings/guile/test/test-scm-query.cpp
similarity index 98%
rename from libgnucash/engine/test/test-scm-query.cpp
rename to bindings/guile/test/test-scm-query.cpp
index 968824191..90f092623 100644
--- a/libgnucash/engine/test/test-scm-query.cpp
+++ b/bindings/guile/test/test-scm-query.cpp
@@ -25,7 +25,7 @@ extern "C"
 #include <config.h>
 #include <glib.h>
 
-#include "engine-helpers-guile.h"
+#include "gnc-engine-guile.h"
 #include "gnc-module.h"
 #include "test-engine-stuff.h"
 #include "test-stuff.h"
diff --git a/gnucash/gnome-utils/dialog-options.c b/gnucash/gnome-utils/dialog-options.c
index 9227e9056..cb16e15a5 100644
--- a/gnucash/gnome-utils/dialog-options.c
+++ b/gnucash/gnome-utils/dialog-options.c
@@ -34,8 +34,8 @@
 
 #include "dialog-options.h"
 #include "dialog-utils.h"
-#include "engine-helpers-guile.h"
-#include "glib-helpers.h"
+#include "gnc-engine-guile.h"
+#include "glib-guile.h"
 #include "gnc-account-sel.h"
 #include "gnc-tree-view-account.h"
 #include "gnc-tree-model-account.h"
diff --git a/gnucash/gnome-utils/dialog-transfer.c b/gnucash/gnome-utils/dialog-transfer.c
index 786b537ad..86edbd98f 100644
--- a/gnucash/gnome-utils/dialog-transfer.c
+++ b/gnucash/gnome-utils/dialog-transfer.c
@@ -47,7 +47,7 @@
 #include "swig-runtime.h"
 #include "guile-mappings.h"
 #include "engine-helpers.h"
-#include "engine-helpers-guile.h"
+#include "gnc-engine-guile.h"
 #include "QuickFill.h"
 #include <gnc-commodity.h>
 
diff --git a/gnucash/gnome/dialog-price-edit-db.c b/gnucash/gnome/dialog-price-edit-db.c
index d6ce1d1b8..7f64d1673 100644
--- a/gnucash/gnome/dialog-price-edit-db.c
+++ b/gnucash/gnome/dialog-price-edit-db.c
@@ -49,7 +49,7 @@
 #include "swig-runtime.h"
 #include "guile-mappings.h"
 #include "guile-util.h"
-#include "engine-helpers-guile.h"
+#include "gnc-engine-guile.h"
 
 
 #define DIALOG_PRICE_DB_CM_CLASS "dialog-price-edit-db"
diff --git a/gnucash/gnucash-bin.c b/gnucash/gnucash-bin.c
index 8e687e90c..f9b0614a3 100644
--- a/gnucash/gnucash-bin.c
+++ b/gnucash/gnucash-bin.c
@@ -54,7 +54,7 @@
 #include "gnc-plugin-report-system.h"
 #include "dialog-new-user.h"
 #include "gnc-session.h"
-#include "engine-helpers-guile.h"
+#include "gnc-engine-guile.h"
 #include "swig-runtime.h"
 #include "guile-mappings.h"
 #include "window-report.h"
diff --git a/libgnucash/app-utils/app-utils.i b/libgnucash/app-utils/app-utils.i
index d09b4ee10..583b8e90e 100644
--- a/libgnucash/app-utils/app-utils.i
+++ b/libgnucash/app-utils/app-utils.i
@@ -35,7 +35,7 @@
 #include <guile-util.h>
 #include <gnc-sx-instance-model.h>
 
-#include "engine-helpers-guile.h"
+#include "gnc-engine-guile.h"
 %}
 
 #if defined(SWIGGUILE)
diff --git a/libgnucash/app-utils/gnc-helpers.c b/libgnucash/app-utils/gnc-helpers.c
index 302f32cf3..b1db73683 100644
--- a/libgnucash/app-utils/gnc-helpers.c
+++ b/libgnucash/app-utils/gnc-helpers.c
@@ -29,7 +29,7 @@
 #include "guile-mappings.h"
 
 #include "gnc-engine.h"
-#include "engine-helpers-guile.h"
+#include "gnc-engine-guile.h"
 #include "gnc-helpers.h"
 #include "gnc-ui-util.h"
 
diff --git a/libgnucash/app-utils/guile-util.c b/libgnucash/app-utils/guile-util.c
index 8b0a95583..10edb6730 100644
--- a/libgnucash/app-utils/guile-util.c
+++ b/libgnucash/app-utils/guile-util.c
@@ -50,8 +50,8 @@
 #endif
 
 #include "qof.h"
-#include "engine-helpers-guile.h"
-#include "glib-helpers.h"
+#include "gnc-engine-guile.h"
+#include "glib-guile.h"
 #include "gnc-glib-utils.h"
 #include "gnc-guile-utils.h"
 #include "gnc-prefs.h"
diff --git a/libgnucash/app-utils/option-util.c b/libgnucash/app-utils/option-util.c
index 3daf522eb..639cb212f 100644
--- a/libgnucash/app-utils/option-util.c
+++ b/libgnucash/app-utils/option-util.c
@@ -29,7 +29,7 @@
 
 #include "Account.h"
 #include "option-util.h"
-#include "glib-helpers.h"
+#include "glib-guile.h"
 #include "gnc-guile-utils.h"
 #include "qof.h"
 #include "swig-runtime.h"
diff --git a/libgnucash/app-utils/option-util.h b/libgnucash/app-utils/option-util.h
index d35692c64..40de7b8a4 100644
--- a/libgnucash/app-utils/option-util.h
+++ b/libgnucash/app-utils/option-util.h
@@ -30,7 +30,7 @@
 #include "guile-mappings.h"
 
 #include "gnc-commodity.h"
-#include "engine-helpers-guile.h"
+#include "gnc-engine-guile.h"
 #include "qof.h"
 
 typedef struct gnc_option GNCOption;
diff --git a/libgnucash/app-utils/test/test-print-queries.cpp b/libgnucash/app-utils/test/test-print-queries.cpp
index 9457651f2..b541deb17 100644
--- a/libgnucash/app-utils/test/test-print-queries.cpp
+++ b/libgnucash/app-utils/test/test-print-queries.cpp
@@ -26,7 +26,7 @@ extern "C"
 #include <glib.h>
 #include "guile-mappings.h"
 
-#include "engine-helpers-guile.h"
+#include "gnc-engine-guile.h"
 #include "gnc-module.h"
 #include "test-engine-stuff.h"
 #include "test-stuff.h"
diff --git a/libgnucash/app-utils/test/test-scm-query-string.cpp b/libgnucash/app-utils/test/test-scm-query-string.cpp
index e7d381641..7772875bb 100644
--- a/libgnucash/app-utils/test/test-scm-query-string.cpp
+++ b/libgnucash/app-utils/test/test-scm-query-string.cpp
@@ -26,7 +26,7 @@ extern "C"
 #include <glib.h>
 #include "guile-mappings.h"
 
-#include "engine-helpers-guile.h"
+#include "gnc-engine-guile.h"
 #include "gnc-module.h"
 #include "gnc-guile-utils.h"
 #include "test-engine-stuff.h"
diff --git a/libgnucash/engine/test/CMakeLists.txt b/libgnucash/engine/test/CMakeLists.txt
index a9445c348..867adceaf 100644
--- a/libgnucash/engine/test/CMakeLists.txt
+++ b/libgnucash/engine/test/CMakeLists.txt
@@ -6,7 +6,7 @@ set(ENGINE_TEST_INCLUDE_DIRS
   ${CMAKE_SOURCE_DIR}/libgnucash/engine/test-core
   ${CMAKE_BINARY_DIR}/common # for config.h
   ${CMAKE_SOURCE_DIR}/common/test-core  # for unittest-support.h
-  ${CMAKE_SOURCE_DIR}/bindings/guile # for engine-helpers-guile.h
+  ${CMAKE_SOURCE_DIR}/bindings/guile # for gnc-engine-guile.h
   ${GLIB2_INCLUDE_DIRS}
 )
 
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 5a22d255e..3134ba0bb 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -3,14 +3,14 @@
 bindings/guile/business-core.scm
 bindings/guile/commodity-table.scm
 bindings/guile/core-utils.scm
-bindings/guile/engine-helpers-guile.c
 bindings/guile/engine.scm
 bindings/guile/engine-utilities.scm
-bindings/guile/glib-helpers.c
+bindings/guile/glib-guile.c
+bindings/guile/gnc-engine-guile.c
 bindings/guile/gnc-guile-bindings.c
 bindings/guile/gnc-guile-utils.c
+bindings/guile/gnc-kvp-guile.cpp
 bindings/guile/gnc-numeric.scm
-bindings/guile/kvp-scm.cpp
 bindings/guile/price-quotes.scm
 bindings/guile/utilities.scm
 borrowed/goffice/go-charmap-sel.c

commit 77f669f123a6be0fb7382eac8cd8939aed19c856
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat Oct 5 16:27:25 2019 +0200

    bindings/guile cosmetic - move price-quotes target lower down
    
    This is just a cosmetic. This way the scm targets in the CMakeLists.txt
    file are ordered according to their dependencies (targets later in the
    file can depend on targets earlier in the file).

diff --git a/bindings/guile/CMakeLists.txt b/bindings/guile/CMakeLists.txt
index 0563ccd44..cdd83d21f 100644
--- a/bindings/guile/CMakeLists.txt
+++ b/bindings/guile/CMakeLists.txt
@@ -67,13 +67,6 @@ install(TARGETS gnucash-guile
 
 # Scheme
 
-# depends on main.scm
-gnc_add_scheme_targets(price-quotes
-  price-quotes.scm
-  gnucash
-  "scm-engine;scm-app-utils"
-  FALSE)
-
 set (core_utils_SCHEME core-utils.scm)
 
 set(GUILE_OUTPUT_DIR   gnucash)
@@ -135,6 +128,12 @@ gnc_add_scheme_targets(scm-engine-2
 
 add_custom_target(scm-engine ALL DEPENDS scm-engine-2 scm-engine-1 scm-engine-0)
 
+gnc_add_scheme_targets(price-quotes
+    price-quotes.scm
+    gnucash
+    "scm-engine;scm-app-utils"
+    FALSE)
+
 set_local_dist(guile_DIST_local
     CMakeLists.txt
     core-utils.scm

commit 48f3195e5ce5ada320899de5346c6949835b0ddb
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat Oct 5 16:18:50 2019 +0200

    bindings - make business-core scm module part of the engine module
    
    There's no reason to expose it as an individual module as what it exports
    are support functions for first class engine objects.

diff --git a/bindings/guile/CMakeLists.txt b/bindings/guile/CMakeLists.txt
index dcc26e773..0563ccd44 100644
--- a/bindings/guile/CMakeLists.txt
+++ b/bindings/guile/CMakeLists.txt
@@ -90,6 +90,7 @@ set (engine_SCHEME_0
     commodity-table.scm
     engine-utilities.scm
     gnc-numeric.scm
+    business-core.scm
 )
 
 set (engine_SCHEME_1
@@ -97,7 +98,6 @@ set (engine_SCHEME_1
 )
 
 set (engine_SCHEME_2
-    business-core.scm
     utilities.scm
 )
 
diff --git a/bindings/guile/business-core.scm b/bindings/guile/business-core.scm
index 9dd032915..3093cb8f5 100644
--- a/bindings/guile/business-core.scm
+++ b/bindings/guile/business-core.scm
@@ -17,9 +17,7 @@
 ;; Boston, MA  02110-1301,  USA       gnu at gnu.org
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-(define-module (gnucash business-core))
 (use-modules (srfi srfi-1))
-(use-modules (gnucash engine))
 
 (define (gnc:owner-get-address owner)
   (let ((type (gncOwnerGetType owner)))
@@ -116,11 +114,3 @@
     (cond (owner (gncOwnerCopy (gncOwnerGetEndOwner owner) result-owner)
                  result-owner)
           (else  '()))))
-
-
-(export gnc:owner-get-address)
-(export gnc:owner-get-name-dep)
-(export gnc:owner-get-address-dep)
-(export gnc:owner-get-name-and-address-dep)
-(export gnc:owner-get-owner-id)
-(export gnc:owner-from-split)
diff --git a/bindings/guile/engine.scm b/bindings/guile/engine.scm
index 539d0730e..9cca0ab21 100644
--- a/bindings/guile/engine.scm
+++ b/bindings/guile/engine.scm
@@ -70,6 +70,15 @@
 (export account-full-name<?)
 (export accounts-get-children-depth)
 
+; business-core.scm
+(export gnc:owner-get-address)
+(export gnc:owner-get-name-dep)
+(export gnc:owner-get-address-dep)
+(export gnc:owner-get-name-and-address-dep)
+(export gnc:owner-get-owner-id)
+(export gnc:owner-from-split)
+
 (load-from-path "gnucash/engine/gnc-numeric")
 (load-from-path "gnucash/engine/commodity-table")
 (load-from-path "gnucash/engine/engine-utilities")
+(load-from-path "gnucash/engine/business-core")
diff --git a/gnucash/report/reports/aging.scm b/gnucash/report/reports/aging.scm
index 34e14adf3..afe9311c8 100644
--- a/gnucash/report/reports/aging.scm
+++ b/gnucash/report/reports/aging.scm
@@ -26,7 +26,6 @@
 
 (define-module (gnucash reports aging))
 
-(use-modules (gnucash business-core))
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
diff --git a/gnucash/report/reports/standard/invoice.scm b/gnucash/report/reports/standard/invoice.scm
index 15786ef44..b2fefc249 100644
--- a/gnucash/report/reports/standard/invoice.scm
+++ b/gnucash/report/reports/standard/invoice.scm
@@ -25,7 +25,6 @@
 (define-module (gnucash reports standard invoice))
 
 (use-modules (gnucash engine))
-(use-modules (gnucash business-core))
 (use-modules (srfi srfi-1))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
diff --git a/gnucash/report/reports/standard/job-report.scm b/gnucash/report/reports/standard/job-report.scm
index b3e0564bb..b28d7f0c7 100644
--- a/gnucash/report/reports/standard/job-report.scm
+++ b/gnucash/report/reports/standard/job-report.scm
@@ -27,7 +27,6 @@
 (define-module (gnucash reports standard job-report))
 
 (use-modules (srfi srfi-1))
-(use-modules (gnucash business-core))
 (use-modules (gnucash engine))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash utilities))		; for gnc:debug
diff --git a/gnucash/report/reports/standard/owner-report.scm b/gnucash/report/reports/standard/owner-report.scm
index 5f1f01bd9..708a09292 100644
--- a/gnucash/report/reports/standard/owner-report.scm
+++ b/gnucash/report/reports/standard/owner-report.scm
@@ -29,7 +29,6 @@
 
 (use-modules (srfi srfi-1))
 (use-modules (srfi srfi-8))
-(use-modules (gnucash business-core))
 (use-modules (gnucash engine))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash utilities))        ; for gnc:debug
diff --git a/gnucash/report/reports/standard/receipt.scm b/gnucash/report/reports/standard/receipt.scm
index 039620ff5..bda6b4425 100644
--- a/gnucash/report/reports/standard/receipt.scm
+++ b/gnucash/report/reports/standard/receipt.scm
@@ -17,7 +17,6 @@
 (define-module (gnucash reports standard receipt))
 
 (use-modules (ice-9 local-eval))  ; for the-environment
-(use-modules (gnucash business-core))
 (use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gettext))
diff --git a/gnucash/report/reports/standard/taxinvoice.scm b/gnucash/report/reports/standard/taxinvoice.scm
index fc8f11b17..13878575a 100644
--- a/gnucash/report/reports/standard/taxinvoice.scm
+++ b/gnucash/report/reports/standard/taxinvoice.scm
@@ -26,7 +26,6 @@
 
 (use-modules (ice-9 local-eval))  ; for the-environment
 (use-modules (gnucash engine))
-(use-modules (gnucash business-core))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gettext))
 
diff --git a/libgnucash/engine/test/test-business-core.scm b/libgnucash/engine/test/test-business-core.scm
index f48863dc8..5baf5c6d7 100644
--- a/libgnucash/engine/test/test-business-core.scm
+++ b/libgnucash/engine/test/test-business-core.scm
@@ -5,7 +5,6 @@
 (use-modules (tests srfi64-extras))
 (use-modules (tests test-engine-extras))
 (use-modules (gnucash utilities))
-(use-modules (gnucash business-core))
 (use-modules (gnucash engine))
 
 (define (run-test)

commit e940ce85240b185806225096b8ee37d96f3a89e2
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat Oct 5 16:04:45 2019 +0200

    engine.scm - a few minor cosmetics
    
    - drop export of non-existing symbol
    - add a couple of comments

diff --git a/bindings/guile/engine.scm b/bindings/guile/engine.scm
index df7e72dc6..539d0730e 100644
--- a/bindings/guile/engine.scm
+++ b/bindings/guile/engine.scm
@@ -24,9 +24,11 @@
       (load-extension "libgnucash-guile" "gnc_guile_bindings_init"))
 (use-modules (sw_engine))
 
+; Export the swig-wrapped symbols in the public interface of this module
 (let ((i (module-public-interface (current-module))))
      (module-use! i (resolve-interface '(sw_engine))))
 
+;; gnc-numeric.scm
 (export GNC-RND-FLOOR)
 (export GNC-RND-CEIL)
 (export GNC-RND-TRUNC)
@@ -53,6 +55,7 @@
 (export gnc:gnc-monetary-amount)
 (export gnc:monetary-neg)
 
+;; commodity-table.scm
 (export GNC_COMMODITY_NS_CURRENCY)
 (export GNC_COMMODITY_NS_NASDAQ)
 (export GNC_COMMODITY_NS_NYSE)
@@ -60,8 +63,6 @@
 (export GNC_COMMODITY_NS_EUREX)
 (export GNC_COMMODITY_NS_MUTUAL)
 
-(export gnc:url->loaded-session)
-
 ;; engine-utilities.scm
 (export gnc:account-map-descendants)
 (export gnc:account-map-children)

commit 3d4cc63d733b2fe3c307953fd80a87595ba08d64
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat Oct 5 16:03:52 2019 +0200

    bindings - ensure engine is initialized before any scm code interfaces with it
    
    This is done by invoking gnc_engine_init in the swig initialization routine

diff --git a/bindings/engine.i b/bindings/engine.i
index caa5a9c80..c19f46c68 100644
--- a/bindings/engine.i
+++ b/bindings/engine.i
@@ -286,6 +286,7 @@ void qof_book_set_string_option(QofBook* book, const char* opt_name, const char*
 %init {
   {
     char tmp[100];
+    char * no_args[1] = { NULL };
 
 #define SET_ENUM(e) snprintf(tmp, 100, "(set! %s (%s))", (e), (e));  \
     scm_c_eval_string(tmp);
@@ -433,6 +434,8 @@ void qof_book_set_string_option(QofBook* book, const char* opt_name, const char*
 
 
 #undef SET_ENUM
+
+    gnc_engine_init(0, no_args);
   }
 
 }

commit 1c7f835f472df6ade9d155e67803471268798449
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat Oct 5 20:06:58 2019 +0200

    engine - move guile code to bindings/guile
    
    This commit tries to do the minimum necessary to move the guile bits from engine
    to bindings/guile. As engine is a very central piece in the software, this unfortunately
    still touches many other source files:
    
    - A few helper objects have been squashed together:
      * engine-helpers-guile.[ch] (of which the c part is extracted from engine-helpers.c)
      * gncBusGuile.[ch]
      * gnc-hooks-scm.[ch]
    - The initialization function of gncmod-engine no longer initializes the scm bits.
      Any scm code that wants to interact with the engine code now has to load
      the (gnucash engine) scm module, or sometimes (gnucash business-core).
      The bulk of changes in this commit actually is updating all the scm consumers to do so.
    - scm-scm target has been removed. Instead (gnucash utilities) is part
      of scm-engine. A few dependency graphs have been updated for this.
    
    More refinements will be in followup commits.

diff --git a/bindings/CMakeLists.txt b/bindings/CMakeLists.txt
index 79f9d27e7..651037956 100644
--- a/bindings/CMakeLists.txt
+++ b/bindings/CMakeLists.txt
@@ -1,5 +1,10 @@
 add_subdirectory(guile)
 add_subdirectory(python)
 
-set_local_dist(bindings_DIST_local CMakeLists.txt core-utils.i)
+set_local_dist(bindings_DIST_local
+    CMakeLists.txt
+    business-core.i
+    core-utils.i
+    engine.i
+    engine-common.i)
 set(bindings_DIST ${bindings_DIST_local} ${guile_DIST} ${python_bindings_DIST} PARENT_SCOPE)
diff --git a/libgnucash/engine/business-core.i b/bindings/business-core.i
similarity index 99%
rename from libgnucash/engine/business-core.i
rename to bindings/business-core.i
index 5ceb8e51e..81ae0552e 100644
--- a/libgnucash/engine/business-core.i
+++ b/bindings/business-core.i
@@ -126,7 +126,7 @@ GLIST_HELPER_INOUT(OwnerList, SWIGTYPE_p__gncOwner);
 %include <gncTaxTable.h>
 %include <gncVendor.h>
 #if defined(SWIGGUILE)
-%include <gncBusGuile.h>
+%include <engine-helpers-guile.h>
 #endif
 /* Import query bindings for the below invoice query functions (but
  * don't generate bindings for them). */
diff --git a/libgnucash/engine/engine-common.i b/bindings/engine-common.i
similarity index 100%
rename from libgnucash/engine/engine-common.i
rename to bindings/engine-common.i
diff --git a/libgnucash/engine/engine.i b/bindings/engine.i
similarity index 99%
rename from libgnucash/engine/engine.i
rename to bindings/engine.i
index 34b49e93c..caa5a9c80 100644
--- a/libgnucash/engine/engine.i
+++ b/bindings/engine.i
@@ -33,7 +33,6 @@
 #include "gnc-pricedb.h"
 #include "gnc-lot.h"
 #include "gnc-session.h"
-#include "gnc-hooks-scm.h"
 #include "engine-deprecated.h"
 #include "engine-helpers.h"
 #include "engine-helpers-guile.h"
@@ -53,7 +52,6 @@
 #include "gncOwner.h"
 #include "gncTaxTable.h"
 #include "gncVendor.h"
-#include "gncBusGuile.h"
 %}
 #if defined(SWIGGUILE)
 %{
diff --git a/bindings/guile/CMakeLists.txt b/bindings/guile/CMakeLists.txt
index e26876735..dcc26e773 100644
--- a/bindings/guile/CMakeLists.txt
+++ b/bindings/guile/CMakeLists.txt
@@ -9,17 +9,35 @@ gnc_add_swig_guile_command (swig-core-utils-guile-c
     ${CORE_UTILS_HEADERS}
 )
 
+# Command to generate the swig-engine.c wrapper file
+gnc_swig_extract_header_files (gncmod-engine ENGINE_HEADERS)
+gnc_add_swig_guile_command (swig-engine-c
+    SWIG_ENGINE_C swig-engine.c
+    ${CMAKE_SOURCE_DIR}/bindings/engine.i
+    "${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_SOURCE_DIR}/libgnucash/engine"
+    ${ENGINE_HEADERS}
+    ${CMAKE_SOURCE_DIR}/bindings/business-core.i
+    ${CMAKE_SOURCE_DIR}/bindings/engine-common.i
+)
+
 set(guile_HEADERS
-    gnc-guile-utils.h)
+    engine-helpers-guile.h
+    glib-helpers.h
+    gnc-guile-utils.h
+    kvp-scm.h)
 
 set(guile_SOURCES
+    engine-helpers-guile.c
+    glib-helpers.c
     gnc-guile-bindings.c
-    gnc-guile-utils.c)
+    gnc-guile-utils.c
+    kvp-scm.cpp)
 
 add_library(gnucash-guile SHARED
     ${guile_SOURCES}
     ${guile_HEADERS}
-    ${SWIG_CORE_UTILS_GUILE_C})
+    ${SWIG_CORE_UTILS_GUILE_C}
+    ${SWIG_ENGINE_C})
 
 add_dependencies(gnucash-guile
     swig-runtime-h)
@@ -38,6 +56,7 @@ target_link_libraries(gnucash-guile
         ${GUILE_LDFLAGS}
     PRIVATE
         gnc-core-utils
+        gncmod-engine
         ${GLIB2_LDFLAGS})
 
 install(TARGETS gnucash-guile
@@ -48,20 +67,11 @@ install(TARGETS gnucash-guile
 
 # Scheme
 
-set(GUILE_DEPENDS      scm-core-utils scm-gnc-module gncmod-engine)
-
-gnc_add_scheme_targets(scm-scm
-  "utilities.scm"
-  gnucash
-  "${GUILE_DEPENDS}"
-  FALSE
-)
-
 # depends on main.scm
 gnc_add_scheme_targets(price-quotes
   price-quotes.scm
   gnucash
-  "scm-scm;scm-app-utils"
+  "scm-engine;scm-app-utils"
   FALSE)
 
 set (core_utils_SCHEME core-utils.scm)
@@ -76,13 +86,64 @@ gnc_add_scheme_targets(scm-core-utils
     FALSE
 )
 
+set (engine_SCHEME_0
+    commodity-table.scm
+    engine-utilities.scm
+    gnc-numeric.scm
+)
+
+set (engine_SCHEME_1
+    engine.scm
+)
+
+set (engine_SCHEME_2
+    business-core.scm
+    utilities.scm
+)
+
+set(BACKEND_DEPENDS gncmod-backend-xml)
+if (WITH_SQL)
+    list(APPEND BACKEND_DEPENDS gncmod-backend-dbi)
+endif(WITH_SQL)
+
+set(GUILE_DEPENDS
+  ${BACKEND_DEPENDS}
+  gncmod-engine
+  gnucash-guile)
+
+
+gnc_add_scheme_targets(scm-engine-0
+    "${engine_SCHEME_0}"
+    "gnucash/engine"
+    "${GUILE_DEPENDS}"
+    TRUE
+)
+
+gnc_add_scheme_targets(scm-engine-1
+    "${engine_SCHEME_1}"
+    gnucash
+    "scm-engine-0;${GUILE_DEPENDS}"
+    FALSE
+)
+
+gnc_add_scheme_targets(scm-engine-2
+    "${engine_SCHEME_2}"
+    gnucash
+    "scm-engine-1;${GUILE_DEPENDS}"
+    FALSE
+)
+
+add_custom_target(scm-engine ALL DEPENDS scm-engine-2 scm-engine-1 scm-engine-0)
+
 set_local_dist(guile_DIST_local
     CMakeLists.txt
     core-utils.scm
-    utilities.scm
     price-quotes.scm
     ${guile_SOURCES}
-    ${guile_HEADERS})
+    ${guile_HEADERS}
+    ${engine_SCHEME_0}
+    ${engine_SCHEME_1}
+    ${engine_SCHEME_2})
 set(guile_DIST ${guile_DIST_local} ${test_guile_DIST} PARENT_SCOPE)
 
 
diff --git a/libgnucash/engine/business-core.scm b/bindings/guile/business-core.scm
similarity index 98%
rename from libgnucash/engine/business-core.scm
rename to bindings/guile/business-core.scm
index ed06f2332..9dd032915 100644
--- a/libgnucash/engine/business-core.scm
+++ b/bindings/guile/business-core.scm
@@ -18,9 +18,8 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (define-module (gnucash business-core))
-(use-modules (gnucash gnc-module))
 (use-modules (srfi srfi-1))
-(gnc:module-load "gnucash/engine" 0)
+(use-modules (gnucash engine))
 
 (define (gnc:owner-get-address owner)
   (let ((type (gncOwnerGetType owner)))
diff --git a/libgnucash/engine/commodity-table.scm b/bindings/guile/commodity-table.scm
similarity index 100%
rename from libgnucash/engine/commodity-table.scm
rename to bindings/guile/commodity-table.scm
diff --git a/libgnucash/engine/engine-helpers.c b/bindings/guile/engine-helpers-guile.c
similarity index 87%
copy from libgnucash/engine/engine-helpers.c
copy to bindings/guile/engine-helpers-guile.c
index 51b836dcf..f9ee52708 100644
--- a/libgnucash/engine/engine-helpers.c
+++ b/bindings/guile/engine-helpers-guile.c
@@ -1,5 +1,5 @@
 /********************************************************************\
- * engine-helpers.c -- gnucash engine helper functions              *
+ * engine-helpers-guile.c -- engine helper functions for guile      *
  * Copyright (C) 2000 Linas Vepstas <linas at linas.org>               *
  * Copyright (C) 2001 Linux Developers Group, Inc.                  *
  *                                                                  *
@@ -51,211 +51,6 @@ cannot be considered "standard" or public parts of QOF. */
 
 static QofLogModule log_module = GNC_MOD_ENGINE;
 
-/** Gets the transaction Number or split Action based on book option:
-  * if the book option is TRUE (split action is used for NUM) and a
-  * split is provided, split-action is returned; if book option is FALSE
-  * (tran-num is used for NUM) and a trans is provided, transaction-num
-  * is returned; if split is provided and tran is NULL, split-action is
-  * returned; if tran is provided and split is NULL, transaction-num is
-  * returned. Otherwise NULL is returned.*/
-const char *
-gnc_get_num_action (const Transaction *trans, const Split *split)
-{
-    gboolean num_action = qof_book_use_split_action_for_num_field
-                           (qof_session_get_book(gnc_get_current_session ()));
-
-    if (trans && !split)
-        return xaccTransGetNum(trans);
-    if (split && !trans)
-        return xaccSplitGetAction(split);
-    if (trans && split)
-    {
-        if (num_action)
-            return xaccSplitGetAction(split);
-        else
-            return xaccTransGetNum(trans);
-    }
-    else return NULL;
-}
-
-/** Opposite of 'gnc_get_num_action'; if the book option is TRUE (split action
-  * is used for NUM) and a trans is provided, transaction-num is returned; if
-  * book option is FALSE (tran-num is used for NUM) and a split is provided,
-  * split-action is returned; if split is provided and tran is NULL,
-  * split-action is returned; if tran is provided and split is NULL,
-  * transaction-num is returned. Otherwise NULL is returned.*/
-const char *
-gnc_get_action_num (const Transaction *trans, const Split *split)
-{
-    gboolean num_action = qof_book_use_split_action_for_num_field
-                           (qof_session_get_book(gnc_get_current_session ()));
-
-    if (trans && !split)
-        return xaccTransGetNum(trans);
-    if (split && !trans)
-        return xaccSplitGetAction(split);
-    if (trans && split)
-    {
-        if (num_action)
-            return xaccTransGetNum(trans);
-        else
-            return xaccSplitGetAction(split);
-    }
-    else return NULL;
-}
-
-/** Sets the transaction Number and/or split Action based on book option:
-  * if the book option is TRUE (split action is to be used for NUM) then 'num'
-  * sets split-action and, if 'tran' and 'action' are provided, 'action'
-  * sets transaction-num; if book option is FALSE (tran-num is to be used for NUM)
-  * then 'num' sets transaction-num and, if 'split' and 'action' are
-  * provided, 'action' sets 'split-action'. If any arguments are NULL (#f, for
-  * the guile version), no change is made to the field that would otherwise be
-  * affected. If 'tran' and 'num' are passed with 'split and 'action' set to
-  * NULL, it is xaccTransSetNum (trans, num). Likewise, if 'split and 'action'
-  * are passed with 'tran' and 'num' set to NULL, it is xaccSplitSetAction (split,
-  * action). */
-void
-gnc_set_num_action (Transaction *trans, Split *split,
-                    const char *num, const char *action)
-{
-    gboolean num_action = qof_book_use_split_action_for_num_field
-                           (qof_session_get_book(gnc_get_current_session ()));
-
-    if (trans && num && !split && !action)
-    {
-        xaccTransSetNum (trans, num);
-        return;
-    }
-
-    if (!trans && !num && split && action)
-    {
-        xaccSplitSetAction (split, action);
-        return;
-    }
-
-    if (trans)
-    {
-        if (!num_action && num)
-            xaccTransSetNum (trans, num);
-        if (num_action && action)
-            xaccTransSetNum (trans, action);
-    }
-
-    if (split)
-    {
-        if (!num_action && action)
-            xaccSplitSetAction (split, action);
-        if (num_action && num)
-           xaccSplitSetAction (split, num);
-    }
-}
-
-/************************************************************/
-/*           Notification of Book Option Changes            */
-/************************************************************/
-
-static GOnce bo_init_once = G_ONCE_INIT;
-static GHashTable *bo_callback_hash = NULL;
-static GHookList *bo_final_hook_list = NULL;
-
-static gpointer
-bo_init (gpointer unused)
-{
-    bo_callback_hash = g_hash_table_new(g_str_hash, g_str_equal);
-
-    bo_final_hook_list = g_malloc(sizeof(GHookList));
-    g_hook_list_init(bo_final_hook_list, sizeof(GHook));
-    return NULL;
-}
-
-static void
-bo_call_hook (GHook *hook, gpointer data)
-{
-    ((GFunc)hook->func)(data, hook->data);
-}
-
-/** Calls registered callbacks when num_field_source book option changes so that
-  * registers/reports can update themselves */
-void
-gnc_book_option_num_field_source_change (gboolean num_action)
-{
-    GHookList *hook_list;
-    const gchar *key = OPTION_NAME_NUM_FIELD_SOURCE;
-
-    g_once(&bo_init_once, bo_init, NULL);
-
-    hook_list = g_hash_table_lookup(bo_callback_hash, key);
-    if (hook_list != NULL)
-        g_hook_list_marshal(hook_list, TRUE, bo_call_hook, &num_action);
-    g_hook_list_invoke(bo_final_hook_list, TRUE);
-}
-
-/** Calls registered callbacks when book_currency book option changes so that
-  * registers/reports can update themselves */
-void
-gnc_book_option_book_currency_selected (gboolean use_book_currency)
-{
-    GHookList *hook_list;
-    const gchar *key = OPTION_NAME_BOOK_CURRENCY;
-
-    g_once(&bo_init_once, bo_init, NULL);
-
-    hook_list = g_hash_table_lookup(bo_callback_hash, key);
-    if (hook_list != NULL)
-        g_hook_list_marshal(hook_list, TRUE, bo_call_hook, &use_book_currency);
-    g_hook_list_invoke(bo_final_hook_list, TRUE);
-}
-
-void
-gnc_book_option_register_cb (gchar *key, GncBOCb func, gpointer user_data)
-{
-    GHookList *hook_list;
-    GHook *hook;
-
-    g_once(&bo_init_once, bo_init, NULL);
-    hook_list = g_hash_table_lookup(bo_callback_hash, key);
-    if (hook_list == NULL)
-    {
-        hook_list = g_malloc(sizeof(GHookList));
-        g_hook_list_init(hook_list, sizeof(GHook));
-        g_hash_table_insert(bo_callback_hash, (gpointer)key, hook_list);
-    }
-
-    hook = g_hook_find_func_data(hook_list, TRUE, func, user_data);
-    if (hook != NULL)
-    {
-        return;
-    }
-
-    hook = g_hook_alloc(hook_list);
-    hook->func = func;
-    hook->data = user_data;
-    g_hook_append(hook_list, hook);
-}
-
-void
-gnc_book_option_remove_cb (gchar *key, GncBOCb func, gpointer user_data)
-{
-    GHookList *hook_list;
-    GHook *hook;
-
-    g_once(&bo_init_once, bo_init, NULL);
-    hook_list = g_hash_table_lookup(bo_callback_hash, key);
-    if (hook_list == NULL)
-        return;
-    hook = g_hook_find_func_data(hook_list, TRUE, func, user_data);
-    if (hook == NULL)
-        return;
-
-    g_hook_destroy_link(hook_list, hook);
-    if (hook_list->hooks == NULL)
-    {
-        g_hash_table_remove(bo_callback_hash, key);
-        g_free(hook_list);
-    }
-}
-
 
 GDate gnc_time64_to_GDate(SCM x)
 {
@@ -1988,3 +1783,107 @@ gnc_book_to_scm (const QofBook *book)
 {
     return gnc_generic_to_scm(book, "_p_QofBook");
 }
+
+static swig_type_info *
+get_acct_type ()
+{
+    static swig_type_info * account_type = NULL;
+
+    if (!account_type)
+        account_type = SWIG_TypeQuery("_p_Account");
+
+    return account_type;
+}
+
+GncAccountValue * gnc_scm_to_account_value_ptr (SCM valuearg)
+{
+    GncAccountValue *res;
+    Account *acc = NULL;
+    gnc_numeric value;
+    swig_type_info * account_type = get_acct_type();
+    SCM val;
+
+    /* Get the account */
+    val = SCM_CAR (valuearg);
+    if (!SWIG_IsPointerOfType (val, account_type))
+        return NULL;
+
+    acc = SWIG_MustGetPtr(val, account_type, 1, 0);
+
+    /* Get the value */
+    val = SCM_CDR (valuearg);
+    value = gnc_scm_to_numeric (val);
+
+    /* Build and return the object */
+    res = g_new0 (GncAccountValue, 1);
+    res->account = acc;
+    res->value = value;
+    return res;
+}
+
+SCM gnc_account_value_ptr_to_scm (GncAccountValue *av)
+{
+    swig_type_info * account_type = get_acct_type();
+    gnc_commodity * com;
+    gnc_numeric val;
+
+    if (!av) return SCM_BOOL_F;
+
+    com = xaccAccountGetCommodity (av->account);
+    val = gnc_numeric_convert (av->value, gnc_commodity_get_fraction (com),
+                               GNC_HOW_RND_ROUND_HALF_UP);
+
+    return scm_cons (SWIG_NewPointerObj(av->account, account_type, 0),
+                     gnc_numeric_to_scm (val));
+}
+
+typedef struct
+{
+    SCM proc;
+    int num_args;
+} GncScmDangler;
+
+
+static void
+delete_scm_hook (gpointer data)
+{
+    GncScmDangler *scm = data;
+    scm_gc_unprotect_object(scm->proc);
+    g_free(scm);
+}
+
+static void
+scm_hook_cb (gpointer data, GncScmDangler *scm)
+{
+    ENTER("data %p, cbarg %p", data, scm);
+
+    if (scm->num_args == 0)
+        scm_call_0 (scm->proc);
+    else
+    {
+        // XXX: FIXME: We really should make sure this is a session!!! */
+        scm_call_1 (scm->proc,
+            SWIG_NewPointerObj(data, SWIG_TypeQuery("_p_QofSession"), 0));
+    }
+
+    LEAVE("");
+}
+
+void
+gnc_hook_add_scm_dangler (const gchar *name, SCM proc)
+{
+    GHook *hook;
+    GncScmDangler *scm;
+    int num_args;
+
+    ENTER("list %s, proc ???", name);
+    num_args = gnc_hook_num_args(name);
+    g_return_if_fail(num_args >= 0);
+    scm = g_new0(GncScmDangler, 1);
+    scm_gc_protect_object(proc);
+    scm->proc = proc;
+    scm->num_args = num_args;
+    gnc_hook_add_dangler(name, (GFunc)scm_hook_cb,
+                         (GDestroyNotify) delete_scm_hook, scm);
+    LEAVE("");
+}
diff --git a/libgnucash/engine/engine-helpers-guile.h b/bindings/guile/engine-helpers-guile.h
similarity index 85%
rename from libgnucash/engine/engine-helpers-guile.h
rename to bindings/guile/engine-helpers-guile.h
index 41fda9a02..ff3e4edab 100644
--- a/libgnucash/engine/engine-helpers-guile.h
+++ b/bindings/guile/engine-helpers-guile.h
@@ -1,5 +1,5 @@
 /********************************************************************\
- * engine-helpers.h -- gnucash engine helper functions              *
+ * engine-helpers-guile.h -- engine helper functions for guile      *
  * Copyright (C) 2000 Linas Vepstas <linas at linas.org>               *
  * Copyright (C) 2001 Linux Developers Group, Inc.                  *
  *                                                                  *
@@ -29,6 +29,8 @@
 #include <libguile.h>
 
 #include "gnc-engine.h"
+#include <gncTaxTable.h>	/* for GncAccountValue */
+#include "gnc-hooks.h"
 
 /* Helpers for various conversions to and from guile */
 
@@ -53,4 +55,12 @@ gnc_commodity * gnc_scm_to_commodity(SCM scm);
 SCM gnc_commodity_to_scm (const gnc_commodity *commodity);
 SCM gnc_book_to_scm (const QofBook *book);
 
+/* Conversion routines used with tax tables */
+GncAccountValue * gnc_scm_to_account_value_ptr (SCM valuearg);
+SCM gnc_account_value_ptr_to_scm (GncAccountValue *);
+
+/**
+ * add Scheme-style danglers from a hook
+ */
+void gnc_hook_add_scm_dangler(const gchar *name, SCM proc);
 #endif
diff --git a/libgnucash/engine/engine-utilities.scm b/bindings/guile/engine-utilities.scm
similarity index 96%
rename from libgnucash/engine/engine-utilities.scm
rename to bindings/guile/engine-utilities.scm
index 1840eddd5..3d101757e 100644
--- a/libgnucash/engine/engine-utilities.scm
+++ b/bindings/guile/engine-utilities.scm
@@ -24,7 +24,7 @@
 
 (eval-when
       (compile load eval expand)
-      (load-extension "libgncmod-engine" "scm_init_sw_engine_module"))
+      (load-extension "libgnucash-guile" "gnc_guile_bindings_init"))
 (use-modules (sw_engine))
 
 (use-modules (srfi srfi-1)
diff --git a/libgnucash/engine/engine.scm b/bindings/guile/engine.scm
similarity index 92%
rename from libgnucash/engine/engine.scm
rename to bindings/guile/engine.scm
index f9f1a10f9..df7e72dc6 100644
--- a/libgnucash/engine/engine.scm
+++ b/bindings/guile/engine.scm
@@ -21,9 +21,12 @@
 
 (eval-when
       (compile load eval expand)
-      (load-extension "libgncmod-engine" "scm_init_sw_engine_module"))
+      (load-extension "libgnucash-guile" "gnc_guile_bindings_init"))
 (use-modules (sw_engine))
 
+(let ((i (module-public-interface (current-module))))
+     (module-use! i (resolve-interface '(sw_engine))))
+
 (export GNC-RND-FLOOR)
 (export GNC-RND-CEIL)
 (export GNC-RND-TRUNC)
diff --git a/libgnucash/engine/glib-helpers.c b/bindings/guile/glib-helpers.c
similarity index 100%
rename from libgnucash/engine/glib-helpers.c
rename to bindings/guile/glib-helpers.c
diff --git a/libgnucash/engine/glib-helpers.h b/bindings/guile/glib-helpers.h
similarity index 100%
rename from libgnucash/engine/glib-helpers.h
rename to bindings/guile/glib-helpers.h
diff --git a/bindings/guile/gnc-guile-bindings.c b/bindings/guile/gnc-guile-bindings.c
index 0f762682e..4d40df5cd 100644
--- a/bindings/guile/gnc-guile-bindings.c
+++ b/bindings/guile/gnc-guile-bindings.c
@@ -32,8 +32,8 @@ void gnc_guile_bindings_init(void);
 
 static int is_initialized = 0;
 
-extern SCM
-scm_init_sw_core_utils_module (void);
+extern SCM scm_init_sw_core_utils_module (void);
+extern SCM scm_init_sw_engine_module (void);
 
 void
 gnc_guile_bindings_init(void)
@@ -42,6 +42,7 @@ gnc_guile_bindings_init(void)
     {
         /* Do what's necessary to initialize the bindings */
         scm_init_sw_core_utils_module();
+        scm_init_sw_engine_module();
 
         is_initialized = 1;
     }
diff --git a/libgnucash/engine/gnc-numeric.scm b/bindings/guile/gnc-numeric.scm
similarity index 100%
rename from libgnucash/engine/gnc-numeric.scm
rename to bindings/guile/gnc-numeric.scm
diff --git a/libgnucash/engine/kvp-scm.cpp b/bindings/guile/kvp-scm.cpp
similarity index 100%
rename from libgnucash/engine/kvp-scm.cpp
rename to bindings/guile/kvp-scm.cpp
diff --git a/libgnucash/engine/kvp-scm.h b/bindings/guile/kvp-scm.h
similarity index 100%
rename from libgnucash/engine/kvp-scm.h
rename to bindings/guile/kvp-scm.h
diff --git a/bindings/guile/price-quotes.scm b/bindings/guile/price-quotes.scm
index 5969ae86a..8a8bbc044 100644
--- a/bindings/guile/price-quotes.scm
+++ b/bindings/guile/price-quotes.scm
@@ -25,6 +25,7 @@
 (export gnc:book-add-quotes) ;; called from gnome/dialog-price-edit-db.c
 (export gnc:price-quotes-install-sources)
 
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils))
diff --git a/bindings/guile/test/CMakeLists.txt b/bindings/guile/test/CMakeLists.txt
index df1d3a692..7fa1ca1ce 100644
--- a/bindings/guile/test/CMakeLists.txt
+++ b/bindings/guile/test/CMakeLists.txt
@@ -6,7 +6,7 @@ set(scm_test_SCHEME
 set(GUILE_DEPENDS
   scm-gnc-module
   scm-app-utils
-  scm-scm scm-engine
+  scm-engine
   scm-srfi64-extras
   scm-deprecated-gnucash-deprecated-module
   scm-deprecated-gnucash-superseded-module
@@ -31,4 +31,4 @@ set_dist_list(test_guile_DIST
 
 # Define two imaginary deprecated guile modules to test the compat file generation code
 gnc_add_scheme_deprecated_module ("gnucash deprecated-module" "" "" "")
-gnc_add_scheme_deprecated_module ("gnucash superseded-module" "gnucash utilities" "scm-scm" "")
+gnc_add_scheme_deprecated_module ("gnucash superseded-module" "gnucash utilities" "scm-engine" "")
diff --git a/bindings/guile/test/test-scm-utilities.scm b/bindings/guile/test/test-scm-utilities.scm
index a335fb13c..269a82ae0 100644
--- a/bindings/guile/test/test-scm-utilities.scm
+++ b/bindings/guile/test/test-scm-utilities.scm
@@ -1,5 +1,6 @@
 (use-modules (gnucash gnc-module))
 (gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (srfi srfi-64))
 (use-modules (tests srfi64-extras))
diff --git a/bindings/guile/utilities.scm b/bindings/guile/utilities.scm
index a2d5dfccd..b854e678d 100644
--- a/bindings/guile/utilities.scm
+++ b/bindings/guile/utilities.scm
@@ -25,10 +25,7 @@
   '(#:warnings (arity-mismatch format duplicate-case-datum bad-case-datum)))
 
 (use-modules (gnucash core-utils))
-
-(eval-when (compile load eval expand)
-  (load-extension "libgncmod-engine" "scm_init_sw_engine_module"))
-(use-modules (sw_engine))
+(use-modules (gnucash engine))
 
 ;; Load the srfis (eventually, we should see where these are needed
 ;; and only have the use-modules statements in those files).
diff --git a/bindings/python/CMakeLists.txt b/bindings/python/CMakeLists.txt
index c25e78757..3a6646725 100644
--- a/bindings/python/CMakeLists.txt
+++ b/bindings/python/CMakeLists.txt
@@ -39,10 +39,11 @@ set(GNUCASH_CORE_C_INCLUDES
 gnc_add_swig_python_command (swig-gnucash-core
     SWIG_GNUCASH_CORE_C SWIG_GNUCASH_CORE_PY
     gnucash_core.c gnucash_core_c.py
-    ${SWIG_FILES}
-    ""
+    ${CMAKE_CURRENT_SOURCE_DIR}/gnucash_core.i
+    ${CMAKE_SOURCE_DIR}/bindings
+    ${CMAKE_CURRENT_SOURCE_DIR}/time64.i
     ${CMAKE_SOURCE_DIR}/common/base-typemaps.i
-    ${CMAKE_SOURCE_DIR}/libgnucash/engine/engine-common.i
+    ${CMAKE_SOURCE_DIR}/bindings/engine-common.i
     ${GNUCASH_CORE_C_INCLUDES}
 )
 
diff --git a/gnucash/CMakeLists.txt b/gnucash/CMakeLists.txt
index 2cbd01aac..875f89dad 100644
--- a/gnucash/CMakeLists.txt
+++ b/gnucash/CMakeLists.txt
@@ -52,7 +52,7 @@ endif (BUILDING_FROM_VCS)
 
 target_link_libraries (gnucash
    gncmod-ledger-core gnc-gnome gncmod-gnome-utils gncmod-app-utils
-   gncmod-engine gnc-module gnc-core-utils gncmod-report
+   gncmod-engine gnc-module gnc-core-utils gncmod-report gnucash-guile
    PkgConfig::GTK3 ${GUILE_LDFLAGS} ${GLIB2_LDFLAGS} ${GTK_MAC_LDFLAGS}
 )
 
diff --git a/gnucash/gnome-utils/CMakeLists.txt b/gnucash/gnome-utils/CMakeLists.txt
index db261366a..b5d97e14c 100644
--- a/gnucash/gnome-utils/CMakeLists.txt
+++ b/gnucash/gnome-utils/CMakeLists.txt
@@ -251,7 +251,7 @@ install(FILES ${gnome_utils_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gnu
 
 # Scheme
 
-set(GUILE_DEPENDS      gncmod-gnome-utils scm-gnc-module scm-scm scm-app-utils)
+set(GUILE_DEPENDS      gncmod-gnome-utils scm-gnc-module scm-engine scm-app-utils)
 
 gnc_add_scheme_targets(scm-gnome-utils-1
   gnome-utils.scm
diff --git a/gnucash/gnome-utils/gnome-utils.scm b/gnucash/gnome-utils/gnome-utils.scm
index c49ff02af..2c331e4e6 100644
--- a/gnucash/gnome-utils/gnome-utils.scm
+++ b/gnucash/gnome-utils/gnome-utils.scm
@@ -19,6 +19,7 @@
 
 (define-module (gnucash gnome-utils))
 
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
 
diff --git a/gnucash/gnome/CMakeLists.txt b/gnucash/gnome/CMakeLists.txt
index 4df8422bd..7c4707d4b 100644
--- a/gnucash/gnome/CMakeLists.txt
+++ b/gnucash/gnome/CMakeLists.txt
@@ -232,7 +232,6 @@ set(GUILE_DEPENDS
     scm-gettext
     scm-gnome-utils
     scm-gnc-module
-    scm-scm
     scm-report
     scm-reports
 )
diff --git a/gnucash/gnome/report-menus.scm b/gnucash/gnome/report-menus.scm
index 3668a23d9..6a2e4513b 100644
--- a/gnucash/gnome/report-menus.scm
+++ b/gnucash/gnome/report-menus.scm
@@ -26,6 +26,7 @@
 
 (define-module (gnucash report-menus))
 (use-modules (gnucash core-utils))
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gnome-utils))
diff --git a/gnucash/import-export/qif-imp/CMakeLists.txt b/gnucash/import-export/qif-imp/CMakeLists.txt
index c6f666079..417369d59 100644
--- a/gnucash/import-export/qif-imp/CMakeLists.txt
+++ b/gnucash/import-export/qif-imp/CMakeLists.txt
@@ -66,7 +66,6 @@ set(GUILE_DEPENDS
   gnc-gnome
   scm-core-utils
   scm-gnc-module
-  scm-scm
   scm-app-utils
   scm-engine
   scm-gnome-utils
diff --git a/gnucash/import-export/qif-imp/qif-import.scm b/gnucash/import-export/qif-imp/qif-import.scm
index bc2f81a02..b4252f4cc 100644
--- a/gnucash/import-export/qif-imp/qif-import.scm
+++ b/gnucash/import-export/qif-imp/qif-import.scm
@@ -25,7 +25,8 @@
 
 
 (define-module (gnucash qif-import))
-(use-modules (gnucash utilities)) 
+(use-modules (gnucash utilities))
+(use-modules (gnucash engine))
 (use-modules (gnucash app-utils))
 
 ;; We do this initialization here because src/gnome isn't a real module.
@@ -35,13 +36,12 @@
 
 (use-modules (sw_gnome))
 
-(use-modules (gnucash gnc-module))
 (use-modules (ice-9 regex))
 (use-modules (srfi srfi-1))
 
 (debug-enable 'backtrace)
 
-(gnc:module-load "gnucash/engine" 0)
+(use-modules (gnucash gnc-module))
 (gnc:module-load "gnucash/app-utils" 0)
 (gnc:module-load "gnucash/gnome-utils" 0)
 
diff --git a/gnucash/import-export/qif-imp/test/CMakeLists.txt b/gnucash/import-export/qif-imp/test/CMakeLists.txt
index dad419905..a6c2d209d 100644
--- a/gnucash/import-export/qif-imp/test/CMakeLists.txt
+++ b/gnucash/import-export/qif-imp/test/CMakeLists.txt
@@ -15,7 +15,6 @@ set (GUILE_DEPENDS
   scm-engine
   scm-test-engine
   scm-gettext
-  scm-scm
   scm-qif-import
 )
 gnc_add_test(test-link-qif-imp test-link.c QIF_IMP_TEST_INCLUDE_DIRS QIF_IMP_TEST_LIBS)
diff --git a/gnucash/import-export/qif-imp/test/test-qif-merge-groups.scm b/gnucash/import-export/qif-imp/test/test-qif-merge-groups.scm
index bd9eb022a..63638d239 100644
--- a/gnucash/import-export/qif-imp/test/test-qif-merge-groups.scm
+++ b/gnucash/import-export/qif-imp/test/test-qif-merge-groups.scm
@@ -1,3 +1,4 @@
+(use-modules (gnucash engine))
 (use-modules (gnucash gnc-module))
 (gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
 (use-modules (srfi srfi-64))
diff --git a/gnucash/report/CMakeLists.txt b/gnucash/report/CMakeLists.txt
index 859aa7223..00ea814a9 100644
--- a/gnucash/report/CMakeLists.txt
+++ b/gnucash/report/CMakeLists.txt
@@ -93,7 +93,7 @@ set(GUILE_DEPENDS
   scm-gnome-utils
   gncmod-report
   scm-app-utils
-  scm-scm
+  scm-engine
   scm-gnc-module
   guile-json
   )
diff --git a/gnucash/report/eguile-html-utilities.scm b/gnucash/report/eguile-html-utilities.scm
index d20dfbd5f..5519dccb8 100644
--- a/gnucash/report/eguile-html-utilities.scm
+++ b/gnucash/report/eguile-html-utilities.scm
@@ -24,6 +24,7 @@
 
 ; using all of these seems like overkill --
 ; not sure which are really required
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash app-utils))
diff --git a/gnucash/report/eguile-utilities.scm b/gnucash/report/eguile-utilities.scm
index 19413551e..93a0da29e 100644
--- a/gnucash/report/eguile-utilities.scm
+++ b/gnucash/report/eguile-utilities.scm
@@ -24,6 +24,7 @@
 
 ; using all of these seems like overkill -- 
 ; not sure which are really required
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash app-utils))
diff --git a/gnucash/report/html-utilities.scm b/gnucash/report/html-utilities.scm
index c3787441f..7d982d087 100644
--- a/gnucash/report/html-utilities.scm
+++ b/gnucash/report/html-utilities.scm
@@ -22,6 +22,7 @@
 ;; Boston, MA  02110-1301,  USA       gnu at gnu.org
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 
 ;; returns a list with n #f (empty cell) values 
diff --git a/gnucash/report/report-core.scm b/gnucash/report/report-core.scm
index 1127c9856..a3a3c71db 100644
--- a/gnucash/report/report-core.scm
+++ b/gnucash/report/report-core.scm
@@ -20,6 +20,7 @@
 ;; Boston, MA  02110-1301,  USA       gnu at gnu.org
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash app-utils))
 (use-modules (gnucash gettext))
diff --git a/gnucash/report/report.scm b/gnucash/report/report.scm
index 18f8a9458..d986bb932 100644
--- a/gnucash/report/report.scm
+++ b/gnucash/report/report.scm
@@ -29,10 +29,10 @@
 (use-modules (ice-9 regex))
 (use-modules (srfi srfi-1))
 (use-modules (srfi srfi-19))
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils))
+(use-modules (gnucash engine))
 
-(gnc:module-load "gnucash/engine" 0)
+(use-modules (gnucash gnc-module))
 (gnc:module-load "gnucash/app-utils" 0)
 (gnc:module-load "gnucash/html" 0)
 (gnc:module-load "gnucash/gnome-utils" 0)
diff --git a/gnucash/report/reports/CMakeLists.txt b/gnucash/report/reports/CMakeLists.txt
index fabe04a90..18f6144db 100644
--- a/gnucash/report/reports/CMakeLists.txt
+++ b/gnucash/report/reports/CMakeLists.txt
@@ -76,7 +76,6 @@ set(scm_rpts_GUILE_DEPENDS
   scm-core-utils
   scm-engine
   scm-gettext
-  scm-scm
   scm-gnome-utils
   scm-report
   )
@@ -87,7 +86,7 @@ set(scm_rpt_example_GUILE_DEPENDS
   scm-core-utils
   scm-gettext
   scm-gnc-module
-  scm-scm
+  scm-engine
   scm-reports-example-links
   scm-gnome-utils
   scm-report
@@ -98,7 +97,7 @@ set(scm_rpt_locale_specific_GUILE_DEPENDS
   scm-core-utils
   scm-gettext
   scm-gnc-module
-  scm-scm
+  scm-engine
   scm-test-core
   scm-locale-tax
   scm-report
diff --git a/gnucash/report/reports/aging.scm b/gnucash/report/reports/aging.scm
index 678f01431..34e14adf3 100644
--- a/gnucash/report/reports/aging.scm
+++ b/gnucash/report/reports/aging.scm
@@ -26,6 +26,8 @@
 
 (define-module (gnucash reports aging))
 
+(use-modules (gnucash business-core))
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
diff --git a/gnucash/report/reports/example/average-balance.scm b/gnucash/report/reports/example/average-balance.scm
index 42315c815..80b492b6f 100644
--- a/gnucash/report/reports/example/average-balance.scm
+++ b/gnucash/report/reports/example/average-balance.scm
@@ -28,6 +28,7 @@
 
 (define-module (gnucash reports example average-balance))
 (use-modules (srfi srfi-1))
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
diff --git a/gnucash/report/reports/example/daily-reports.scm b/gnucash/report/reports/example/daily-reports.scm
index 2b27ae58d..27acaed6d 100644
--- a/gnucash/report/reports/example/daily-reports.scm
+++ b/gnucash/report/reports/example/daily-reports.scm
@@ -27,7 +27,8 @@
 
 (define-module (gnucash reports example daily-reports))
 
-(use-modules (gnucash utilities)) 
+(use-modules (gnucash engine))
+(use-modules (gnucash utilities))
 (use-modules (srfi srfi-1))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
diff --git a/gnucash/report/reports/example/hello-world.scm b/gnucash/report/reports/example/hello-world.scm
index 2643f5b12..ca41b6be7 100644
--- a/gnucash/report/reports/example/hello-world.scm
+++ b/gnucash/report/reports/example/hello-world.scm
@@ -24,6 +24,7 @@
 ;; new reports for GnuCash.
 
 (define-module (gnucash reports example hello-world))
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
diff --git a/gnucash/report/reports/example/sample-graphs.scm b/gnucash/report/reports/example/sample-graphs.scm
index d942ae2e5..ba44b8ce9 100644
--- a/gnucash/report/reports/example/sample-graphs.scm
+++ b/gnucash/report/reports/example/sample-graphs.scm
@@ -24,6 +24,7 @@
 ;; new reports for GnuCash.
 
 (define-module (gnucash reports example sample-graphs))
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
 (use-modules (gnucash gnc-module))
 
diff --git a/gnucash/report/reports/example/welcome-to-gnucash.scm b/gnucash/report/reports/example/welcome-to-gnucash.scm
index 05c589bb5..a0044424c 100644
--- a/gnucash/report/reports/example/welcome-to-gnucash.scm
+++ b/gnucash/report/reports/example/welcome-to-gnucash.scm
@@ -23,6 +23,7 @@
 
 (define-module (gnucash reports example welcome-to-gnucash))
 
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash core-utils)) ; for gnc:version
 (use-modules (gnucash gettext))
diff --git a/gnucash/report/reports/locale-specific/de_DE/taxtxf.scm b/gnucash/report/reports/locale-specific/de_DE/taxtxf.scm
index 67de731fe..01d007a0e 100644
--- a/gnucash/report/reports/locale-specific/de_DE/taxtxf.scm
+++ b/gnucash/report/reports/locale-specific/de_DE/taxtxf.scm
@@ -67,6 +67,7 @@
 ;; depends must be outside module scope -- and should eventually go away.
 
 (define-module (gnucash reports locale-specific de_DE taxtxf))
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
 (use-modules (srfi srfi-1))
 (use-modules (gnucash core-utils)) ; for gnc:version
@@ -75,7 +76,6 @@
 
 (use-modules (gnucash gnc-module))
 (gnc:module-load "gnucash/report" 0)
-(gnc:module-load "gnucash/engine" 0)
 
 (define reportname (N_ "Tax Report / TXF Export"))
 
diff --git a/gnucash/report/reports/locale-specific/us/taxtxf.scm b/gnucash/report/reports/locale-specific/us/taxtxf.scm
index 8e2e5fafb..819298fe9 100644
--- a/gnucash/report/reports/locale-specific/us/taxtxf.scm
+++ b/gnucash/report/reports/locale-specific/us/taxtxf.scm
@@ -99,7 +99,8 @@
 
 
 (define-module (gnucash reports locale-specific us taxtxf))
-(use-modules (gnucash utilities)) 
+(use-modules (gnucash engine))
+(use-modules (gnucash utilities))
 (use-modules (srfi srfi-1))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
diff --git a/gnucash/report/reports/reports.scm b/gnucash/report/reports/reports.scm
index b946c71e3..dbb2549dc 100644
--- a/gnucash/report/reports/reports.scm
+++ b/gnucash/report/reports/reports.scm
@@ -29,6 +29,7 @@
 (use-modules (srfi srfi-8))
 (use-modules (gnucash app-utils))
 (use-modules (gnucash core-utils))
+(use-modules (gnucash engine))
 (use-modules (gnucash report))
 (use-modules (gnucash utilities))
 
@@ -50,8 +51,7 @@
        (all-dirs (append report-dirs (list (list 'gnucash 'reports 'locale-specific loc-spec)))))
       (report-module-loader all-dirs))
 
-(use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/engine" 0)
+(use-modules (gnucash engine))
 
 (define (gnc:register-report-create account split query journal? ledger-type?
                                     double? title debit-string credit-string)
diff --git a/gnucash/report/reports/standard/account-piecharts.scm b/gnucash/report/reports/standard/account-piecharts.scm
index 5f814c7a4..caad76f16 100644
--- a/gnucash/report/reports/standard/account-piecharts.scm
+++ b/gnucash/report/reports/standard/account-piecharts.scm
@@ -25,7 +25,8 @@
 
 (define-module (gnucash reports standard account-piecharts))
 
-(use-modules (gnucash utilities)) 
+(use-modules (gnucash engine))
+(use-modules (gnucash utilities))
 (use-modules (srfi srfi-1))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
diff --git a/gnucash/report/reports/standard/account-summary.scm b/gnucash/report/reports/standard/account-summary.scm
index 6b1b485d9..33d2f127f 100644
--- a/gnucash/report/reports/standard/account-summary.scm
+++ b/gnucash/report/reports/standard/account-summary.scm
@@ -56,6 +56,7 @@
 (define-module (gnucash reports standard account-summary))
 
 (use-modules (srfi srfi-1))
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
diff --git a/gnucash/report/reports/standard/advanced-portfolio.scm b/gnucash/report/reports/standard/advanced-portfolio.scm
index 4e144fb13..60e6a1680 100644
--- a/gnucash/report/reports/standard/advanced-portfolio.scm
+++ b/gnucash/report/reports/standard/advanced-portfolio.scm
@@ -27,6 +27,7 @@
 
 (define-module (gnucash reports standard advanced-portfolio))
 
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
 (use-modules (srfi srfi-1))
 (use-modules (gnucash gnc-module))
diff --git a/gnucash/report/reports/standard/balance-forecast.scm b/gnucash/report/reports/standard/balance-forecast.scm
index 21cf544f2..f9649a48c 100644
--- a/gnucash/report/reports/standard/balance-forecast.scm
+++ b/gnucash/report/reports/standard/balance-forecast.scm
@@ -25,6 +25,7 @@
 
 (define-module (gnucash reports standard balance-forecast))
 
+(use-modules (gnucash engine))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
 (use-modules (srfi srfi-1))
diff --git a/gnucash/report/reports/standard/balance-sheet.scm b/gnucash/report/reports/standard/balance-sheet.scm
index 0a57e1aeb..b31a4cb25 100644
--- a/gnucash/report/reports/standard/balance-sheet.scm
+++ b/gnucash/report/reports/standard/balance-sheet.scm
@@ -63,6 +63,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (define-module (gnucash reports standard balance-sheet))
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
diff --git a/gnucash/report/reports/standard/balsheet-eg.scm b/gnucash/report/reports/standard/balsheet-eg.scm
index 6020470a7..3145f38f0 100644
--- a/gnucash/report/reports/standard/balsheet-eg.scm
+++ b/gnucash/report/reports/standard/balsheet-eg.scm
@@ -32,6 +32,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (define-module (gnucash reports standard balsheet-eg))
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
diff --git a/gnucash/report/reports/standard/balsheet-pnl.scm b/gnucash/report/reports/standard/balsheet-pnl.scm
index a043e39d1..ef0fcd47d 100644
--- a/gnucash/report/reports/standard/balsheet-pnl.scm
+++ b/gnucash/report/reports/standard/balsheet-pnl.scm
@@ -26,6 +26,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (define-module (gnucash reports standard balsheet-pnl))
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
diff --git a/gnucash/report/reports/standard/budget-balance-sheet.scm b/gnucash/report/reports/standard/budget-balance-sheet.scm
index 4ddb78d1c..bb503d77a 100644
--- a/gnucash/report/reports/standard/budget-balance-sheet.scm
+++ b/gnucash/report/reports/standard/budget-balance-sheet.scm
@@ -29,6 +29,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (define-module (gnucash reports standard budget-balance-sheet))
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
diff --git a/gnucash/report/reports/standard/budget-barchart.scm b/gnucash/report/reports/standard/budget-barchart.scm
index f89b0edac..8faf3d7f6 100644
--- a/gnucash/report/reports/standard/budget-barchart.scm
+++ b/gnucash/report/reports/standard/budget-barchart.scm
@@ -27,6 +27,7 @@
 (define-module (gnucash reports standard budget-barchart))
 
 (use-modules (srfi srfi-1))
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
diff --git a/gnucash/report/reports/standard/budget-flow.scm b/gnucash/report/reports/standard/budget-flow.scm
index 7d43cc26e..319bce919 100644
--- a/gnucash/report/reports/standard/budget-flow.scm
+++ b/gnucash/report/reports/standard/budget-flow.scm
@@ -26,6 +26,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (define-module (gnucash reports standard budget-flow))
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
diff --git a/gnucash/report/reports/standard/budget-income-statement.scm b/gnucash/report/reports/standard/budget-income-statement.scm
index d5759d484..7a61c7c7d 100644
--- a/gnucash/report/reports/standard/budget-income-statement.scm
+++ b/gnucash/report/reports/standard/budget-income-statement.scm
@@ -41,6 +41,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (define-module (gnucash reports standard budget-income-statement))
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
diff --git a/gnucash/report/reports/standard/budget.scm b/gnucash/report/reports/standard/budget.scm
index 4ff3beeef..71d69ded5 100644
--- a/gnucash/report/reports/standard/budget.scm
+++ b/gnucash/report/reports/standard/budget.scm
@@ -27,12 +27,11 @@
 
 (define-module (gnucash reports standard budget))
 
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
 
-(use-modules (gnucash engine))
-
 (use-modules (srfi srfi-1))
 (use-modules (ice-9 match))
 
diff --git a/gnucash/report/reports/standard/cash-flow.scm b/gnucash/report/reports/standard/cash-flow.scm
index d8d656f53..477aa524f 100644
--- a/gnucash/report/reports/standard/cash-flow.scm
+++ b/gnucash/report/reports/standard/cash-flow.scm
@@ -28,10 +28,10 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (define-module (gnucash reports standard cash-flow))
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
-(use-modules (gnucash engine))
 
 (gnc:module-load "gnucash/report" 0)
 (gnc:module-load "gnucash/gnome-utils" 0) ;for gnc-build-url
diff --git a/gnucash/report/reports/standard/cashflow-barchart.scm b/gnucash/report/reports/standard/cashflow-barchart.scm
index e288b1eab..af09c9115 100644
--- a/gnucash/report/reports/standard/cashflow-barchart.scm
+++ b/gnucash/report/reports/standard/cashflow-barchart.scm
@@ -29,10 +29,10 @@
 
 (define-module (gnucash reports standard cashflow-barchart))
 
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
-(use-modules (gnucash engine))
 (use-modules (gnucash reports standard cash-flow))
 
 (gnc:module-load "gnucash/report" 0)
diff --git a/gnucash/report/reports/standard/category-barchart.scm b/gnucash/report/reports/standard/category-barchart.scm
index 01756ddf7..405e9c53b 100644
--- a/gnucash/report/reports/standard/category-barchart.scm
+++ b/gnucash/report/reports/standard/category-barchart.scm
@@ -26,6 +26,7 @@
 (define-module (gnucash reports standard category-barchart))
 (use-modules (srfi srfi-1))
 (use-modules (srfi srfi-9))
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
diff --git a/gnucash/report/reports/standard/customer-summary.scm b/gnucash/report/reports/standard/customer-summary.scm
index 98312c7c6..59a1d71ff 100644
--- a/gnucash/report/reports/standard/customer-summary.scm
+++ b/gnucash/report/reports/standard/customer-summary.scm
@@ -30,6 +30,7 @@
 
 (use-modules (srfi srfi-1))
 (use-modules (gnucash gnc-module))
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities))                ; for gnc:debug
 (use-modules (gnucash gettext))
 (use-modules (gnucash reports))
diff --git a/gnucash/report/reports/standard/dashboard.scm b/gnucash/report/reports/standard/dashboard.scm
index 365b9e017..6e61c77db 100644
--- a/gnucash/report/reports/standard/dashboard.scm
+++ b/gnucash/report/reports/standard/dashboard.scm
@@ -25,6 +25,7 @@
 (define-module (gnucash reports standard dashboard))
 (export gnc:make-dashboard)
 
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash core-utils)) ; for gnc:version
 (use-modules (gnucash gettext))
diff --git a/gnucash/report/reports/standard/equity-statement.scm b/gnucash/report/reports/standard/equity-statement.scm
index 7c56f5629..5d1498fa2 100644
--- a/gnucash/report/reports/standard/equity-statement.scm
+++ b/gnucash/report/reports/standard/equity-statement.scm
@@ -46,6 +46,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (define-module (gnucash reports standard equity-statement))
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
diff --git a/gnucash/report/reports/standard/general-journal.scm b/gnucash/report/reports/standard/general-journal.scm
index 791e70b75..c050bb01a 100644
--- a/gnucash/report/reports/standard/general-journal.scm
+++ b/gnucash/report/reports/standard/general-journal.scm
@@ -27,6 +27,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (define-module (gnucash reports standard general-journal))
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
diff --git a/gnucash/report/reports/standard/general-ledger.scm b/gnucash/report/reports/standard/general-ledger.scm
index 1c6db3f71..14ac85d37 100644
--- a/gnucash/report/reports/standard/general-ledger.scm
+++ b/gnucash/report/reports/standard/general-ledger.scm
@@ -30,6 +30,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (define-module (gnucash reports standard general-ledger))
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
diff --git a/gnucash/report/reports/standard/income-gst-statement.scm b/gnucash/report/reports/standard/income-gst-statement.scm
index 142435c3c..9cd28c59e 100644
--- a/gnucash/report/reports/standard/income-gst-statement.scm
+++ b/gnucash/report/reports/standard/income-gst-statement.scm
@@ -27,6 +27,7 @@
 
 (define-module (gnucash reports standard income-gst-statement))
 
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
 (use-modules (srfi srfi-1))
 (use-modules (gnucash gnc-module))
diff --git a/gnucash/report/reports/standard/income-statement.scm b/gnucash/report/reports/standard/income-statement.scm
index 6baeb91b8..10ac37db5 100644
--- a/gnucash/report/reports/standard/income-statement.scm
+++ b/gnucash/report/reports/standard/income-statement.scm
@@ -42,6 +42,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (define-module (gnucash reports standard income-statement))
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
diff --git a/gnucash/report/reports/standard/invoice.scm b/gnucash/report/reports/standard/invoice.scm
index 5e60dbe06..15786ef44 100644
--- a/gnucash/report/reports/standard/invoice.scm
+++ b/gnucash/report/reports/standard/invoice.scm
@@ -24,6 +24,8 @@
 
 (define-module (gnucash reports standard invoice))
 
+(use-modules (gnucash engine))
+(use-modules (gnucash business-core))
 (use-modules (srfi srfi-1))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
diff --git a/gnucash/report/reports/standard/job-report.scm b/gnucash/report/reports/standard/job-report.scm
index 0f2665731..b3e0564bb 100644
--- a/gnucash/report/reports/standard/job-report.scm
+++ b/gnucash/report/reports/standard/job-report.scm
@@ -27,6 +27,8 @@
 (define-module (gnucash reports standard job-report))
 
 (use-modules (srfi srfi-1))
+(use-modules (gnucash business-core))
+(use-modules (gnucash engine))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash utilities))		; for gnc:debug
 (use-modules (gnucash gettext))
diff --git a/gnucash/report/reports/standard/net-charts.scm b/gnucash/report/reports/standard/net-charts.scm
index 7f422d5fc..715c0a7a8 100644
--- a/gnucash/report/reports/standard/net-charts.scm
+++ b/gnucash/report/reports/standard/net-charts.scm
@@ -29,6 +29,7 @@
 (define-module (gnucash reports standard net-charts))
 
 (use-modules (srfi srfi-1))
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
diff --git a/gnucash/report/reports/standard/new-aging.scm b/gnucash/report/reports/standard/new-aging.scm
index f713ecf22..3f7cca454 100644
--- a/gnucash/report/reports/standard/new-aging.scm
+++ b/gnucash/report/reports/standard/new-aging.scm
@@ -30,6 +30,7 @@
 (use-modules (srfi srfi-1))
 (use-modules (srfi srfi-11))            ;let-values
 (use-modules (gnucash utilities))
+(use-modules (gnucash engine))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
 
diff --git a/gnucash/report/reports/standard/new-owner-report.scm b/gnucash/report/reports/standard/new-owner-report.scm
index 489e11f5d..82ab49362 100644
--- a/gnucash/report/reports/standard/new-owner-report.scm
+++ b/gnucash/report/reports/standard/new-owner-report.scm
@@ -32,6 +32,7 @@
 (use-modules (srfi srfi-8))
 (use-modules (srfi srfi-11))             ;for let-values
 (use-modules (gnucash gnc-module))
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities))        ; for gnc:debug
 (use-modules (gnucash gettext))
 
diff --git a/gnucash/report/reports/standard/owner-report.scm b/gnucash/report/reports/standard/owner-report.scm
index 4a5b62903..5f1f01bd9 100644
--- a/gnucash/report/reports/standard/owner-report.scm
+++ b/gnucash/report/reports/standard/owner-report.scm
@@ -29,6 +29,8 @@
 
 (use-modules (srfi srfi-1))
 (use-modules (srfi srfi-8))
+(use-modules (gnucash business-core))
+(use-modules (gnucash engine))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash utilities))        ; for gnc:debug
 (use-modules (gnucash gettext))
diff --git a/gnucash/report/reports/standard/payables.scm b/gnucash/report/reports/standard/payables.scm
index d800945a3..5b7499ad4 100644
--- a/gnucash/report/reports/standard/payables.scm
+++ b/gnucash/report/reports/standard/payables.scm
@@ -25,6 +25,7 @@
 
 (define-module (gnucash reports standard payables))
 
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
diff --git a/gnucash/report/reports/standard/portfolio.scm b/gnucash/report/reports/standard/portfolio.scm
index 93292a624..9ac552143 100644
--- a/gnucash/report/reports/standard/portfolio.scm
+++ b/gnucash/report/reports/standard/portfolio.scm
@@ -23,6 +23,7 @@
 
 (define-module (gnucash reports standard portfolio))
 
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
 (use-modules (srfi srfi-1))
 (use-modules (gnucash gnc-module))
diff --git a/gnucash/report/reports/standard/price-scatter.scm b/gnucash/report/reports/standard/price-scatter.scm
index 24e066a1e..4d934e3e4 100644
--- a/gnucash/report/reports/standard/price-scatter.scm
+++ b/gnucash/report/reports/standard/price-scatter.scm
@@ -24,6 +24,7 @@
 
 (define-module (gnucash reports standard price-scatter))
 
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
 (use-modules (srfi srfi-1))
 (use-modules (gnucash gnc-module))
diff --git a/gnucash/report/reports/standard/receipt.scm b/gnucash/report/reports/standard/receipt.scm
index d8aea8209..039620ff5 100644
--- a/gnucash/report/reports/standard/receipt.scm
+++ b/gnucash/report/reports/standard/receipt.scm
@@ -17,12 +17,14 @@
 (define-module (gnucash reports standard receipt))
 
 (use-modules (ice-9 local-eval))  ; for the-environment
+(use-modules (gnucash business-core))
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities))
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
+
+(use-modules (gnucash gnc-module))
 (gnc:module-load "gnucash/report" 0)
 (gnc:module-load "gnucash/html" 0)
-(gnc:module-load "gnucash/engine" 0)
 
 (use-modules (gnucash eguile))
 
diff --git a/gnucash/report/reports/standard/receivables.scm b/gnucash/report/reports/standard/receivables.scm
index 086e6ceb5..ee7e5dff7 100644
--- a/gnucash/report/reports/standard/receivables.scm
+++ b/gnucash/report/reports/standard/receivables.scm
@@ -25,6 +25,7 @@
 
 (define-module (gnucash reports standard receivables))
 
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
diff --git a/gnucash/report/reports/standard/reconcile-report.scm b/gnucash/report/reports/standard/reconcile-report.scm
index 951484fed..ffd690f33 100644
--- a/gnucash/report/reports/standard/reconcile-report.scm
+++ b/gnucash/report/reports/standard/reconcile-report.scm
@@ -26,6 +26,7 @@
 
 (define-module (gnucash reports standard reconcile-report))
 
+(use-modules (gnucash engine))
 (use-modules (gnucash gettext))
 (use-modules (gnucash gnc-module))
 (gnc:module-load "gnucash/report" 0)
diff --git a/gnucash/report/reports/standard/register.scm b/gnucash/report/reports/standard/register.scm
index f493b5d0f..862940473 100644
--- a/gnucash/report/reports/standard/register.scm
+++ b/gnucash/report/reports/standard/register.scm
@@ -22,6 +22,7 @@
 
 (define-module (gnucash reports standard register))
 
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (srfi srfi-1))
 (use-modules (gnucash gnc-module))
diff --git a/gnucash/report/reports/standard/taxinvoice.scm b/gnucash/report/reports/standard/taxinvoice.scm
index 5e0bcdacc..fc8f11b17 100644
--- a/gnucash/report/reports/standard/taxinvoice.scm
+++ b/gnucash/report/reports/standard/taxinvoice.scm
@@ -25,12 +25,14 @@
 (define-module (gnucash reports standard taxinvoice))
 
 (use-modules (ice-9 local-eval))  ; for the-environment
+(use-modules (gnucash engine))
+(use-modules (gnucash business-core))
 (use-modules (gnucash utilities))
-(use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
+
+(use-modules (gnucash gnc-module))
 (gnc:module-load "gnucash/report" 0)
 (gnc:module-load "gnucash/html" 0)
-(gnc:module-load "gnucash/engine" 0)
 
 (use-modules (gnucash eguile))
 
diff --git a/gnucash/report/reports/standard/test/CMakeLists.txt b/gnucash/report/reports/standard/test/CMakeLists.txt
index 5e2d56017..af01f05b6 100644
--- a/gnucash/report/reports/standard/test/CMakeLists.txt
+++ b/gnucash/report/reports/standard/test/CMakeLists.txt
@@ -32,7 +32,6 @@ set(GUILE_DEPENDS
   scm-engine
   scm-test-engine
   scm-gettext
-  scm-scm
   scm-test-report
   scm-reports
   scm-report-stylesheets
diff --git a/gnucash/report/reports/standard/test/test-account-summary.scm b/gnucash/report/reports/standard/test/test-account-summary.scm
index 13f1e614f..121624c30 100644
--- a/gnucash/report/reports/standard/test/test-account-summary.scm
+++ b/gnucash/report/reports/standard/test/test-account-summary.scm
@@ -1,3 +1,4 @@
+(use-modules (gnucash engine))
 (use-modules (gnucash gnc-module))
 (gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
 (use-modules (tests test-engine-extras))
diff --git a/gnucash/report/reports/standard/test/test-balsheet-pnl.scm b/gnucash/report/reports/standard/test/test-balsheet-pnl.scm
index ff2d232bd..c862d2ca3 100644
--- a/gnucash/report/reports/standard/test/test-balsheet-pnl.scm
+++ b/gnucash/report/reports/standard/test/test-balsheet-pnl.scm
@@ -1,3 +1,4 @@
+(use-modules (gnucash engine))
 (use-modules (gnucash gnc-module))
 (gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
 (use-modules (tests test-engine-extras))
diff --git a/gnucash/report/reports/standard/test/test-cash-flow.scm b/gnucash/report/reports/standard/test/test-cash-flow.scm
index bff0bc9a8..ef424add6 100644
--- a/gnucash/report/reports/standard/test/test-cash-flow.scm
+++ b/gnucash/report/reports/standard/test/test-cash-flow.scm
@@ -1,3 +1,4 @@
+(use-modules (gnucash engine))
 (use-modules (gnucash gnc-module))
 
 (gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
diff --git a/gnucash/report/reports/standard/test/test-charts.scm b/gnucash/report/reports/standard/test/test-charts.scm
index ec963f025..c82cda882 100644
--- a/gnucash/report/reports/standard/test/test-charts.scm
+++ b/gnucash/report/reports/standard/test/test-charts.scm
@@ -1,3 +1,4 @@
+(use-modules (gnucash engine))
 (use-modules (gnucash gnc-module))
 (gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
 (use-modules (tests test-engine-extras))
diff --git a/gnucash/report/reports/standard/test/test-income-gst.scm b/gnucash/report/reports/standard/test/test-income-gst.scm
index faccdfb30..69b6a64c0 100644
--- a/gnucash/report/reports/standard/test/test-income-gst.scm
+++ b/gnucash/report/reports/standard/test/test-income-gst.scm
@@ -1,3 +1,4 @@
+(use-modules (gnucash engine))
 (use-modules (gnucash gnc-module))
 (gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
 (use-modules (tests test-engine-extras))
diff --git a/gnucash/report/reports/standard/test/test-invoice.scm b/gnucash/report/reports/standard/test/test-invoice.scm
index 7557a312f..07e6e8d5c 100644
--- a/gnucash/report/reports/standard/test/test-invoice.scm
+++ b/gnucash/report/reports/standard/test/test-invoice.scm
@@ -1,3 +1,4 @@
+(use-modules (gnucash engine))
 (use-modules (gnucash gnc-module))
 (gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
 (use-modules (tests test-engine-extras))
diff --git a/gnucash/report/reports/standard/test/test-owner-report.scm b/gnucash/report/reports/standard/test/test-owner-report.scm
index 62322784b..aae287374 100644
--- a/gnucash/report/reports/standard/test/test-owner-report.scm
+++ b/gnucash/report/reports/standard/test/test-owner-report.scm
@@ -1,3 +1,4 @@
+(use-modules (gnucash engine))
 (use-modules (gnucash gnc-module))
 (gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
 (use-modules (tests test-engine-extras))
diff --git a/gnucash/report/reports/standard/test/test-portfolios.scm b/gnucash/report/reports/standard/test/test-portfolios.scm
index cd882ac0f..219ef7225 100644
--- a/gnucash/report/reports/standard/test/test-portfolios.scm
+++ b/gnucash/report/reports/standard/test/test-portfolios.scm
@@ -1,3 +1,4 @@
+(use-modules (gnucash engine))
 (use-modules (gnucash gnc-module))
 (gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
 (use-modules (tests test-engine-extras))
diff --git a/gnucash/report/reports/standard/test/test-stress-options.scm b/gnucash/report/reports/standard/test/test-stress-options.scm
index ff462deea..8bd58fe45 100644
--- a/gnucash/report/reports/standard/test/test-stress-options.scm
+++ b/gnucash/report/reports/standard/test/test-stress-options.scm
@@ -1,5 +1,6 @@
 (use-modules (ice-9 textual-ports))
 (use-modules (ice-9 popen))
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
 (gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
diff --git a/gnucash/report/reports/standard/test/test-transaction.scm b/gnucash/report/reports/standard/test/test-transaction.scm
index c27345825..34a8bd24f 100644
--- a/gnucash/report/reports/standard/test/test-transaction.scm
+++ b/gnucash/report/reports/standard/test/test-transaction.scm
@@ -1,3 +1,4 @@
+(use-modules (gnucash engine))
 (use-modules (gnucash gnc-module))
 (gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
 (use-modules (tests test-engine-extras))
diff --git a/gnucash/report/reports/standard/trial-balance.scm b/gnucash/report/reports/standard/trial-balance.scm
index ada7ede93..ab0c3c09b 100644
--- a/gnucash/report/reports/standard/trial-balance.scm
+++ b/gnucash/report/reports/standard/trial-balance.scm
@@ -52,6 +52,7 @@
 
 (define-module (gnucash reports standard trial-balance))
 (use-modules (srfi srfi-1))
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
diff --git a/gnucash/report/reports/standard/view-column.scm b/gnucash/report/reports/standard/view-column.scm
index a95826b32..38caa8fcb 100644
--- a/gnucash/report/reports/standard/view-column.scm
+++ b/gnucash/report/reports/standard/view-column.scm
@@ -27,6 +27,7 @@
 ;; don't have to worry about that here.
 
 (define-module (gnucash reports standard view-column))
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities)) 
 (use-modules (gnucash app-utils))
 (use-modules (gnucash gnc-module))
diff --git a/gnucash/report/stylesheets/CMakeLists.txt b/gnucash/report/stylesheets/CMakeLists.txt
index ac83e6e23..f423374bf 100644
--- a/gnucash/report/stylesheets/CMakeLists.txt
+++ b/gnucash/report/stylesheets/CMakeLists.txt
@@ -10,7 +10,7 @@ set(GUILE_DEPENDS
   scm-gnc-module
   scm-core-utils
   scm-gettext
-  scm-scm
+  scm-engine
   gncmod-html
   scm-report
   )
diff --git a/gnucash/report/stylesheets/footer.scm b/gnucash/report/stylesheets/footer.scm
index 70f0a542d..15df6a652 100644
--- a/gnucash/report/stylesheets/footer.scm
+++ b/gnucash/report/stylesheets/footer.scm
@@ -36,6 +36,7 @@
 
 (define-module (gnucash report stylesheets footer))
 
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))
diff --git a/gnucash/report/stylesheets/head-or-tail.scm b/gnucash/report/stylesheets/head-or-tail.scm
index 61272bb9f..cf84a88fe 100644
--- a/gnucash/report/stylesheets/head-or-tail.scm
+++ b/gnucash/report/stylesheets/head-or-tail.scm
@@ -35,6 +35,7 @@
 
 (define-module (gnucash report stylesheets head-or-tail))
 
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils)) ; for gnc:version
diff --git a/gnucash/report/stylesheets/plain.scm b/gnucash/report/stylesheets/plain.scm
index 4b6acdd06..be0ea67db 100644
--- a/gnucash/report/stylesheets/plain.scm
+++ b/gnucash/report/stylesheets/plain.scm
@@ -24,6 +24,7 @@
 
 (define-module (gnucash report stylesheets plain))
 
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash core-utils))
diff --git a/gnucash/report/test/CMakeLists.txt b/gnucash/report/test/CMakeLists.txt
index 323c60e75..f996cc631 100644
--- a/gnucash/report/test/CMakeLists.txt
+++ b/gnucash/report/test/CMakeLists.txt
@@ -31,7 +31,6 @@ set(GUILE_DEPENDS
   scm-gettext
   scm-engine
   scm-test-engine
-  scm-scm
   scm-report-2
   scm-test-report
   scm-report-stylesheets
diff --git a/gnucash/report/test/test-report-html.scm b/gnucash/report/test/test-report-html.scm
index 68db51c78..b7e6943fd 100644
--- a/gnucash/report/test/test-report-html.scm
+++ b/gnucash/report/test/test-report-html.scm
@@ -2,6 +2,7 @@
 
 (gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
 
+(use-modules (gnucash engine))
 (use-modules (tests test-engine-extras))
 (use-modules (gnucash report))
 (use-modules (tests test-report-extras))
diff --git a/gnucash/report/test/test-report-utilities.scm b/gnucash/report/test/test-report-utilities.scm
index 8eeba1c9d..b9280a33c 100644
--- a/gnucash/report/test/test-report-utilities.scm
+++ b/gnucash/report/test/test-report-utilities.scm
@@ -3,6 +3,7 @@
 (gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
 (gnc:module-begin-syntax (gnc:module-load "gnucash/report" 0))
 
+(use-modules (gnucash engine))
 (use-modules (srfi srfi-64))
 (use-modules (tests srfi64-extras))
 (use-modules (tests test-engine-extras))
diff --git a/libgnucash/app-utils/CMakeLists.txt b/libgnucash/app-utils/CMakeLists.txt
index 42946ce5c..e23a6a412 100644
--- a/libgnucash/app-utils/CMakeLists.txt
+++ b/libgnucash/app-utils/CMakeLists.txt
@@ -178,7 +178,6 @@ set(GUILE_DEPENDS
   gncmod-app-utils
   scm-core-utils
   scm-engine
-  scm-scm
   scm-gnc-module
   )
 
diff --git a/libgnucash/app-utils/app-utils.scm b/libgnucash/app-utils/app-utils.scm
index 36ce6e8fd..bc535b1f2 100644
--- a/libgnucash/app-utils/app-utils.scm
+++ b/libgnucash/app-utils/app-utils.scm
@@ -22,14 +22,9 @@
 (use-modules (sw_app_utils))
 (use-modules (srfi srfi-1))
 (use-modules (gnucash utilities))
-(use-modules (gnucash gnc-module))
+(use-modules (gnucash engine))
 (use-modules (gnucash gettext))
 
-;; Guile 2 needs to find the symbols from the c module at compile time already
-(eval-when
-      (compile load eval expand)
-      (gnc:module-load "gnucash/engine" 0))
-
 ;; gettext.scm
 (re-export gnc:gettext)
 (re-export _)
diff --git a/libgnucash/app-utils/business-options.scm b/libgnucash/app-utils/business-options.scm
index a04d3d4ae..11ad03f42 100644
--- a/libgnucash/app-utils/business-options.scm
+++ b/libgnucash/app-utils/business-options.scm
@@ -24,6 +24,7 @@
 ;; invoice pointers may be used to set the value of the option. The
 ;; option always returns a single invoice pointer.
 
+(use-modules (gnucash engine))
 (use-modules (gnucash utilities))
 
 (define (gnc:make-invoice-option
diff --git a/libgnucash/app-utils/test/CMakeLists.txt b/libgnucash/app-utils/test/CMakeLists.txt
index 111f7b3b8..93a5fd5b8 100644
--- a/libgnucash/app-utils/test/CMakeLists.txt
+++ b/libgnucash/app-utils/test/CMakeLists.txt
@@ -35,7 +35,6 @@ set(GUILE_DEPENDS
   scm-core-utils
   scm-gnc-module
   scm-engine
-  scm-scm
   scm-gettext
   gncmod-backend-xml
 )
diff --git a/libgnucash/app-utils/test/test-date-utilities.scm b/libgnucash/app-utils/test/test-date-utilities.scm
index 1ed664a15..760671b7b 100644
--- a/libgnucash/app-utils/test/test-date-utilities.scm
+++ b/libgnucash/app-utils/test/test-date-utilities.scm
@@ -1,3 +1,4 @@
+(use-modules (gnucash engine))
 (use-modules (gnucash gnc-module))
 (gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
 (use-modules (tests test-engine-extras))
diff --git a/libgnucash/backend/xml/test/CMakeLists.txt b/libgnucash/backend/xml/test/CMakeLists.txt
index df1e599c2..17cadb33f 100644
--- a/libgnucash/backend/xml/test/CMakeLists.txt
+++ b/libgnucash/backend/xml/test/CMakeLists.txt
@@ -76,9 +76,8 @@ add_xml_test(test-load-xml2 test-load-xml2.cpp
 #  GNC_TEST_FILES=${CMAKE_CURRENT_SOURCE_DIR}/test-files/xml2
 #)
 
-gnc_add_test_with_guile(test-load-example-account
+add_xml_test(test-load-example-account
   "${test_backend_xml_module_SOURCES};test-load-example-account.cpp"
-  XML_TEST_INCLUDE_DIRS XML_TEST_LIBS
   GNC_ACCOUNT_PATH=${CMAKE_SOURCE_DIR}/data/accounts/C
 )
 target_compile_options(test-load-example-account PRIVATE -DU_SHOW_CPLUSPLUS_API=0)
diff --git a/libgnucash/backend/xml/test/test-load-example-account.cpp b/libgnucash/backend/xml/test/test-load-example-account.cpp
index 8193ba348..16d356ae4 100644
--- a/libgnucash/backend/xml/test/test-load-example-account.cpp
+++ b/libgnucash/backend/xml/test/test-load-example-account.cpp
@@ -37,7 +37,6 @@ extern "C"
 #include "test-engine-stuff.h"
 }
 
-#include <libguile.h>
 #include "test-file-stuff.h"
 #include "io-gncxml-v2.h"
 
@@ -65,13 +64,15 @@ test_load_file (const char* filename)
     }
 }
 
-static void
-guile_main (void* closure, int argc, char** argv)
+int
+main (int argc, char** argv)
 {
     const char* location = g_getenv ("GNC_ACCOUNT_PATH");
     GSList* list = NULL;
     GDir* ea_dir;
 
+    g_setenv ("GNC_UNINSTALLED", "1", TRUE);
+
     if (!location)
     {
         location = "../../../../data/accounts/C";
@@ -115,11 +116,3 @@ guile_main (void* closure, int argc, char** argv)
     print_test_results ();
     exit (get_rv ());
 }
-
-int
-main (int argc, char** argv)
-{
-    g_setenv ("GNC_UNINSTALLED", "1", TRUE);
-    scm_boot_guile (argc, argv, guile_main, NULL);
-    exit (get_rv ());
-}
diff --git a/libgnucash/engine/CMakeLists.txt b/libgnucash/engine/CMakeLists.txt
index 71e35fcad..704777ca8 100644
--- a/libgnucash/engine/CMakeLists.txt
+++ b/libgnucash/engine/CMakeLists.txt
@@ -13,7 +13,6 @@ set(engine_noinst_HEADERS
   engine-deprecated.h
   gnc-backend-prov.hpp
   gnc-date-p.h
-  gnc-hooks-scm.h
   gnc-int128.hpp
   gnc-lot.h
   gnc-lot-p.h
@@ -45,8 +44,6 @@ set (engine_HEADERS
   cap-gains.h
   cashobjects.h
   engine-helpers.h
-  engine-helpers-guile.h
-  glib-helpers.h
   gnc-aqbanking-templates.h
   gnc-budget.h
   gnc-commodity.h
@@ -68,7 +65,6 @@ set (engine_HEADERS
   gncAddressP.h
   gncBillTerm.h
   gncBillTermP.h
-  gncBusGuile.h
   gncBusiness.h
   gncCustomer.h
   gncCustomerP.h
@@ -92,7 +88,6 @@ set (engine_HEADERS
   guid.h
   guid.hpp
   kvp-frame.hpp
-  kvp-scm.h
   kvp-value.hpp
   policy.h
   qof.h
@@ -118,12 +113,6 @@ set (engine_HEADERS
   qof-string-cache.h
 )
 
-# Command to generate the swig-engine.c wrapper file
-gnc_add_swig_guile_command (swig-engine-c
-    SWIG_ENGINE_C swig-engine.c
-    ${CMAKE_CURRENT_SOURCE_DIR}/engine.i "" ${engine_HEADERS}
-)
-
 # Command to generate the iso-4217-currencies.c file
 set (ISO_4217_C ${CMAKE_CURRENT_BINARY_DIR}/iso-4217-currencies.c)
 add_custom_command (
@@ -160,7 +149,6 @@ set (engine_SOURCES
   gnc-event.c
   gnc-features.c
   gnc-hooks.c
-  gnc-hooks-scm.c
   gnc-int128.cpp
   gnc-lot.c
   gnc-numeric.cpp
@@ -170,14 +158,11 @@ set (engine_SOURCES
   gnc-timezone.cpp
   gnc-uri-utils.c
   gncmod-engine.c
-  kvp-scm.cpp
   engine-helpers.c
-  glib-helpers.c
   guid.cpp
   policy.c
   gncAddress.c
   gncBillTerm.c
-  gncBusGuile.c
   gncBusiness.c
   gncCustomer.c
   gncEmployee.c
@@ -226,12 +211,11 @@ set_source_files_properties (gnc-commodity.c PROPERTIES OBJECT_DEPENDS "${ISO_42
 add_library (gncmod-engine
   ${engine_SOURCES}
   ${engine_HEADERS}
-  ${SWIG_ENGINE_C}
   ${engine_noinst_HEADERS}
 )
 
 # Add dependency on swig-runtime.h and iso-4217-currencies.c
-add_dependencies (gncmod-engine swig-runtime-h iso-4217-c)
+add_dependencies (gncmod-engine iso-4217-c)
 if (WIN32)
   set(BCRYPT "bcrypt.lib")
 else()
@@ -241,7 +225,6 @@ endif()
 target_link_libraries(gncmod-engine
     gnc-core-utils
     gnc-module
-    gnucash-guile
     ${Boost_DATE_TIME_LIBRARIES}
     ${Boost_REGEX_LIBRARIES}
     ${ICU4C_I18N_LDFLAGS}
@@ -257,6 +240,7 @@ target_compile_definitions (gncmod-engine PRIVATE -DG_LOG_DOMAIN=\"gnc.engine\")
 target_include_directories (gncmod-engine
     PRIVATE
         ${CMAKE_CURRENT_BINARY_DIR} # for iso-4217-currencies.c
+        ${GUILE_INCLUDE_DIRS}
     PUBLIC
         ${CMAKE_CURRENT_SOURCE_DIR}
         ${CMAKE_BINARY_DIR}/common # for config.h
@@ -278,51 +262,8 @@ install(TARGETS gncmod-engine
 
 install(FILES ${engine_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gnucash)
 
-# Scheme
-
-set (engine_SCHEME_0
-    engine.scm
-    business-core.scm
-)
-
-set (engine_SCHEME_1
-    commodity-table.scm
-    engine-utilities.scm
-    gnc-numeric.scm
-)
-
-set(BACKEND_DEPENDS gncmod-backend-xml)
-if (WITH_SQL)
-    list(APPEND BACKEND_DEPENDS gncmod-backend-dbi)
-endif(WITH_SQL)
-
-set(GUILE_DEPENDS
-  ${BACKEND_DEPENDS}
-  gncmod-engine
-  scm-gnc-module)
-
-
-gnc_add_scheme_targets(scm-engine-0
-  "${engine_SCHEME_0}"
-  gnucash
-  "${GUILE_DEPENDS}"
-  FALSE
-)
-
-gnc_add_scheme_targets(scm-engine-1
-  "${engine_SCHEME_1}"
-  "gnucash/engine"
-  "scm-engine-0;${GUILE_DEPENDS}"
-  TRUE
-)
-
-add_custom_target(scm-engine ALL DEPENDS scm-engine-1 scm-engine-0)
-
 set(engine_EXTRA_DIST
-        business-core.i
         design.txt
-        engine.i
-        engine-common.i
         extensions.txt
         iso-4217-currencies.xml
         iso-currencies-to-c.xsl
@@ -336,5 +277,5 @@ if (NOT WIN32)
   list(APPEND engine_EXTRA_DIST qof-win32.cpp)
 endif (NOT WIN32)
 set_local_dist(engine_DIST_local CMakeLists.txt ${engine_SOURCES} ${engine_HEADERS}
-                     ${engine_noinst_HEADERS} ${engine_SCHEME_0} ${engine_SCHEME_1} ${engine_EXTRA_DIST})
+                     ${engine_noinst_HEADERS} ${engine_EXTRA_DIST})
 set(engine_DIST ${engine_DIST_local} ${engine_test_core_DIST} ${test_engine_DIST} PARENT_SCOPE)
diff --git a/libgnucash/engine/engine-helpers.c b/libgnucash/engine/engine-helpers.c
index 51b836dcf..24bb5f077 100644
--- a/libgnucash/engine/engine-helpers.c
+++ b/libgnucash/engine/engine-helpers.c
@@ -24,19 +24,13 @@
 
 #include <config.h>
 
-#include "swig-runtime.h"
-#include <libguile.h>
 #include <string.h>
 
 #include "Account.h"
 #include "engine-helpers.h"
-#include "engine-helpers-guile.h"
-#include "glib-helpers.h"
 #include "gnc-date.h"
 #include "gnc-engine.h"
 #include "gnc-session.h"
-#include "guile-mappings.h"
-#include "gnc-guile-utils.h"
 #include <qof.h>
 #include <qofbookslots.h>
 
@@ -257,1734 +251,3 @@ gnc_book_option_remove_cb (gchar *key, GncBOCb func, gpointer user_data)
 }
 
 
-GDate gnc_time64_to_GDate(SCM x)
-{
-    time64 time = scm_to_int64 (x);
-    return time64_to_gdate(time);
-}
-
-SCM
-gnc_guid2scm(GncGUID guid)
-{
-    char string[GUID_ENCODING_LENGTH + 1];
-
-    if (!guid_to_string_buff(&guid, string))
-        return SCM_BOOL_F;
-
-    return scm_from_utf8_string(string);
-}
-
-GncGUID
-gnc_scm2guid(SCM guid_scm)
-{
-    GncGUID guid;
-    gchar * str;
-
-    if (!scm_is_string(guid_scm)
-            || (GUID_ENCODING_LENGTH != scm_c_string_length (guid_scm)))
-    {
-        return *guid_null();
-    }
-    str = gnc_scm_to_utf8_string (guid_scm);
-    string_to_guid(str, &guid);
-    g_free (str);
-    return guid;
-}
-
-int
-gnc_guid_p(SCM guid_scm)
-{
-    GncGUID guid;
-    gchar * str;
-    int return_int;
-
-    if (!scm_is_string(guid_scm))
-        return FALSE;
-
-    if (GUID_ENCODING_LENGTH != scm_c_string_length (guid_scm))
-    {
-        return FALSE;
-    }
-    str = gnc_scm_to_utf8_string (guid_scm);
-    return_int = string_to_guid(str, &guid);
-    g_free (str);
-    return return_int;
-}
-
-
-/********************************************************************
- * type converters for query API
- ********************************************************************/
-
-/* The query scm representation is a list of pairs, where the
- * car of each pair is one of the following symbols:
- *
- *   Symbol                cdr
- *   'terms                list of OR terms
- *   'primary-sort         scm rep of sort_type_t
- *   'secondary-sort       scm rep of sort_type_t
- *   'tertiary-sort        scm rep of sort_type_t
- *   'primary-increasing   boolean
- *   'secondary-increasing boolean
- *   'tertiary-increasing  boolean
- *   'max-splits           integer
- *
- *   Each OR term is a list of AND terms.
- *   Each AND term is a list of one of the following forms:
- *
- *   ('pd-amount pr-type sense-bool amt-match-how amt-match-sign amount)
- *   ('pd-account pr-type sense-bool acct-match-how list-of-account-guids)
- *   ('pd-string pr-type sense-bool case-sense-bool use-regexp-bool string)
- *   ('pd-cleared pr-type sense-bool cleared-field)
- *   ('pd-balance pr-type sense-bool balance-field)
- */
-
-typedef enum
-{
-    gnc_QUERY_v1 = 1,
-    gnc_QUERY_v2
-} query_version_t;
-
-/* QofCompareFunc */
-
-static QofQueryCompare
-gnc_query_scm2compare (SCM how_scm)
-{
-    return scm_to_int(how_scm);
-}
-
-/* QofStringMatch */
-static QofStringMatch
-gnc_query_scm2string (SCM how_scm)
-{
-    return scm_to_int(how_scm);
-}
-
-/* QofDateMatch */
-static QofDateMatch
-gnc_query_scm2date (SCM how_scm)
-{
-    return scm_to_int(how_scm);
-}
-
-/* QofNumericMatch */
-static QofNumericMatch
-gnc_query_scm2numericop (SCM how_scm)
-{
-    return scm_to_int(how_scm);
-}
-
-/* QofGuidMatch */
-static QofGuidMatch
-gnc_query_scm2guid (SCM how_scm)
-{
-    return scm_to_int(how_scm);
-}
-
-/* QofCharMatch */
-static QofCharMatch
-gnc_query_scm2char (SCM how_scm)
-{
-    return scm_to_int(how_scm);
-}
-
-static QofGuidMatch
-gnc_scm2acct_match_how (SCM how_scm)
-{
-    QofGuidMatch res;
-    gchar *how = gnc_scm_symbol_to_locale_string (how_scm);
-
-    if (!g_strcmp0 (how, "acct-match-all"))
-        res = QOF_GUID_MATCH_ALL;
-    else if (!g_strcmp0 (how, "acct-match-any"))
-        res = QOF_GUID_MATCH_ANY;
-    else if (!g_strcmp0 (how, "acct-match-none"))
-        res = QOF_GUID_MATCH_NONE;
-    else
-    {
-        PINFO ("invalid account match: %s", how);
-        res = QOF_GUID_MATCH_NULL;
-    }
-
-    g_free (how);
-    return res;
-}
-
-static QofQueryCompare
-gnc_scm2amt_match_how (SCM how_scm)
-{
-    QofQueryCompare res;
-    gchar *how = gnc_scm_symbol_to_locale_string (how_scm);
-
-    if (!g_strcmp0 (how, "amt-match-atleast"))
-        res = QOF_COMPARE_GTE;
-    else if (!g_strcmp0 (how, "amt-match-atmost"))
-        res = QOF_COMPARE_LTE;
-    else if (!g_strcmp0 (how, "amt-match-exactly"))
-        res = QOF_COMPARE_EQUAL;
-    else
-    {
-        PINFO ("invalid amount match: %s", how);
-        res = QOF_COMPARE_EQUAL;
-    }
-
-    g_free (how);
-    return res;
-}
-
-static int
-gnc_scm2bitfield (SCM field_scm)
-{
-    int field = 0;
-
-    if (!scm_is_list (field_scm))
-        return 0;
-
-    while (!scm_is_null (field_scm))
-    {
-        SCM scm;
-        int bit;
-
-        scm = SCM_CAR (field_scm);
-        field_scm = SCM_CDR (field_scm);
-
-        bit = scm_to_int(scm);
-        field |= bit;
-    }
-
-    return field;
-}
-
-static cleared_match_t
-gnc_scm2cleared_match_how (SCM how_scm)
-{
-    return gnc_scm2bitfield (how_scm);
-}
-
-static gboolean
-gnc_scm2balance_match_how (SCM how_scm, gboolean *resp)
-{
-    gchar *how;
-
-    if (!scm_is_list (how_scm))
-        return FALSE;
-
-    if (scm_is_null (how_scm))
-        return FALSE;
-
-    /* Only allow a single-entry list */
-    if (!scm_is_null (SCM_CDR (how_scm)))
-        return FALSE;
-
-    how = gnc_scm_symbol_to_locale_string (SCM_CAR(how_scm));
-
-    if (!g_strcmp0 (how, "balance-match-balanced"))
-        *resp = TRUE;
-    else
-        *resp = FALSE;
-
-    g_free (how);
-    return TRUE;
-}
-
-static SCM
-gnc_guid_glist2scm (const GList *account_guids)
-{
-    SCM guids = SCM_EOL;
-    const GList *node;
-
-    for (node = account_guids; node; node = node->next)
-    {
-        GncGUID *guid = node->data;
-
-        if (guid)
-            guids = scm_cons (gnc_guid2scm (*guid), guids);
-    }
-
-    return scm_reverse (guids);
-}
-
-static GList *
-gnc_scm2guid_glist (SCM guids_scm)
-{
-    GList *guids = NULL;
-
-    if (!scm_is_list (guids_scm))
-        return NULL;
-
-    while (!scm_is_null (guids_scm))
-    {
-        SCM guid_scm = SCM_CAR (guids_scm);
-        GncGUID *guid = NULL;
-
-        if (guid_scm != SCM_BOOL_F)
-        {
-            guid = guid_malloc ();
-            *guid = gnc_scm2guid (guid_scm);
-        }
-
-        guids = g_list_prepend (guids, guid);
-
-        guids_scm = SCM_CDR (guids_scm);
-    }
-
-    return g_list_reverse (guids);
-}
-
-static void
-gnc_guid_glist_free (GList *guids)
-{
-    GList *node;
-
-    for (node = guids; node; node = node->next)
-        guid_free (node->data);
-
-    g_list_free (guids);
-}
-
-static SCM
-gnc_query_numeric2scm (gnc_numeric val)
-{
-    return scm_cons (scm_from_int64 (val.num),
-                     scm_from_int64 (val.denom));
-}
-
-static gboolean
-gnc_query_numeric_p (SCM pair)
-{
-    return (scm_is_pair (pair));
-}
-
-static gnc_numeric
-gnc_query_scm2numeric (SCM pair)
-{
-    SCM denom;
-    SCM num;
-
-    num = SCM_CAR (pair);
-    denom = SCM_CDR (pair);
-
-    return gnc_numeric_create (scm_to_int64 (num),
-                               scm_to_int64 (denom));
-}
-
-static SCM
-gnc_query_path2scm (const GSList *path)
-{
-    SCM path_scm = SCM_EOL;
-    const GSList *node;
-
-    for (node = path; node; node = node->next)
-    {
-        const char *key = node->data;
-
-        if (key)
-            path_scm = scm_cons (scm_from_utf8_string (key), path_scm);
-    }
-
-    return scm_reverse (path_scm);
-}
-
-GSList *
-gnc_query_scm2path (SCM path_scm)
-{
-    GSList *path = NULL;
-
-    if (!scm_is_list (path_scm))
-        return NULL;
-
-    while (!scm_is_null (path_scm))
-    {
-        SCM key_scm = SCM_CAR (path_scm);
-        char *key;
-
-        if (!scm_is_string (key_scm))
-            break;
-
-        key = gnc_scm_to_utf8_string(key_scm);
-        path = g_slist_prepend (path, key);
-        path_scm = SCM_CDR (path_scm);
-    }
-
-    return g_slist_reverse (path);
-}
-
-static void
-gnc_query_path_free (GSList *path)
-{
-    GSList *node;
-
-    for (node = path; node; node = node->next)
-        g_free (node->data);
-
-    g_slist_free (path);
-}
-
-
-static SCM
-gnc_queryterm2scm (const QofQueryTerm *qt)
-{
-    SCM qt_scm = SCM_EOL;
-    QofQueryPredData *pd = NULL;
-
-    qt_scm = scm_cons (gnc_query_path2scm (qof_query_term_get_param_path (qt)),
-                       qt_scm);
-    qt_scm = scm_cons (SCM_BOOL (qof_query_term_is_inverted (qt)), qt_scm);
-
-    pd = qof_query_term_get_pred_data (qt);
-    qt_scm = scm_cons (scm_from_locale_symbol (pd->type_name), qt_scm);
-    qt_scm = scm_cons (scm_from_long  (pd->how), qt_scm);
-
-    if (!g_strcmp0 (pd->type_name, QOF_TYPE_STRING))
-    {
-        query_string_t pdata = (query_string_t) pd;
-
-        qt_scm = scm_cons (scm_from_long  (pdata->options), qt_scm);
-        qt_scm = scm_cons (SCM_BOOL (pdata->is_regex), qt_scm);
-        qt_scm = scm_cons (pdata->matchstring ? scm_from_utf8_string (pdata->matchstring) : SCM_BOOL_F, qt_scm);
-
-    }
-    else if (!g_strcmp0 (pd->type_name, QOF_TYPE_DATE))
-    {
-        query_date_t pdata = (query_date_t) pd;
-
-        qt_scm = scm_cons (scm_from_long  (pdata->options), qt_scm);
-        qt_scm = scm_cons (scm_from_int64 (pdata->date), qt_scm);
-
-    }
-    else if (!g_strcmp0 (pd->type_name, QOF_TYPE_NUMERIC))
-    {
-        query_numeric_t pdata = (query_numeric_t) pd;
-
-        qt_scm = scm_cons (scm_from_long  (pdata->options), qt_scm);
-        qt_scm = scm_cons (gnc_query_numeric2scm (pdata->amount), qt_scm);
-
-    }
-    else if (!g_strcmp0 (pd->type_name, QOF_TYPE_GUID))
-    {
-        query_guid_t pdata = (query_guid_t) pd;
-
-        qt_scm = scm_cons (scm_from_long  (pdata->options), qt_scm);
-        qt_scm = scm_cons (gnc_guid_glist2scm (pdata->guids), qt_scm);
-
-    }
-    else if (!g_strcmp0 (pd->type_name, QOF_TYPE_INT64))
-    {
-        query_int64_t pdata = (query_int64_t) pd;
-
-        qt_scm = scm_cons (scm_from_int64 (pdata->val), qt_scm);
-
-    }
-    else if (!g_strcmp0 (pd->type_name, QOF_TYPE_DOUBLE))
-    {
-        query_double_t pdata = (query_double_t) pd;
-
-        qt_scm = scm_cons (scm_from_double  (pdata->val), qt_scm);
-
-    }
-    else if (!g_strcmp0 (pd->type_name, QOF_TYPE_BOOLEAN))
-    {
-        query_boolean_t pdata = (query_boolean_t) pd;
-
-        qt_scm = scm_cons (SCM_BOOL (pdata->val), qt_scm);
-
-    }
-    else if (!g_strcmp0 (pd->type_name, QOF_TYPE_CHAR))
-    {
-        query_char_t pdata = (query_char_t) pd;
-
-        qt_scm = scm_cons (scm_from_long  (pdata->options), qt_scm);
-        qt_scm = scm_cons (pdata->char_list ? scm_from_utf8_string (pdata->char_list) : SCM_BOOL_F, qt_scm);
-
-    }
-    else
-    {
-        PWARN ("query core type %s not supported", pd->type_name);
-        return SCM_BOOL_F;
-    }
-
-    return scm_reverse (qt_scm);
-}
-
-static QofQuery *
-gnc_scm2query_term_query_v2 (SCM qt_scm)
-{
-    QofQuery *q = NULL;
-    QofQueryPredData *pd = NULL;
-    SCM scm;
-    gchar *type = NULL;
-    GSList *path = NULL;
-    gboolean inverted = FALSE;
-    QofQueryCompare compare_how;
-
-    if (!scm_is_list (qt_scm) || scm_is_null (qt_scm))
-        return NULL;
-
-    do
-    {
-        /* param path */
-        scm = SCM_CAR (qt_scm);
-        qt_scm = SCM_CDR (qt_scm);
-        if (!scm_is_list (scm))
-            break;
-        path = gnc_query_scm2path (scm);
-
-        /* inverted */
-        scm = SCM_CAR (qt_scm);
-        qt_scm = SCM_CDR (qt_scm);
-        if (!scm_is_bool (scm))
-            break;
-        inverted = scm_is_true (scm);
-
-        /* type */
-        scm = SCM_CAR (qt_scm);
-        qt_scm = SCM_CDR (qt_scm);
-        if (!scm_is_symbol (scm))
-            break;
-        type = gnc_scm_symbol_to_locale_string (scm);
-
-        /* QofCompareFunc */
-        scm = SCM_CAR (qt_scm);
-        qt_scm = SCM_CDR (qt_scm);
-        if (scm_is_null (scm))
-            break;
-        compare_how = gnc_query_scm2compare (scm);
-
-        /* Now compute the predicate */
-
-        if (!g_strcmp0 (type, QOF_TYPE_STRING))
-        {
-            QofStringMatch options;
-            gboolean is_regex;
-            gchar *matchstring;
-
-            scm = SCM_CAR (qt_scm);
-            qt_scm = SCM_CDR (qt_scm);
-            if (scm_is_null (scm)) break;
-            options = gnc_query_scm2string (scm);
-
-            scm = SCM_CAR (qt_scm);
-            qt_scm = SCM_CDR (qt_scm);
-            if (!scm_is_bool (scm)) break;
-            is_regex = scm_is_true (scm);
-
-            scm = SCM_CAR (qt_scm);
-            if (!scm_is_string (scm)) break;
-
-            matchstring = gnc_scm_to_utf8_string (scm);
-
-            pd = qof_query_string_predicate (compare_how, matchstring,
-                                             options, is_regex);
-            g_free (matchstring);
-        }
-        else if (!g_strcmp0 (type, QOF_TYPE_DATE))
-        {
-            QofDateMatch options;
-            time64 date;
-
-            scm = SCM_CAR (qt_scm);
-            qt_scm = SCM_CDR (qt_scm);
-            if (scm_is_null (scm))
-                break;
-            options = gnc_query_scm2date (scm);
-
-            scm = SCM_CAR (qt_scm);
-            if (scm_is_null (scm))
-                break;
-            date = scm_to_int64 (scm);
-
-            pd = qof_query_date_predicate (compare_how, options, date);
-
-        }
-        else if (!g_strcmp0 (type, QOF_TYPE_NUMERIC))
-        {
-            QofNumericMatch options;
-            gnc_numeric val;
-
-            scm = SCM_CAR (qt_scm);
-            qt_scm = SCM_CDR (qt_scm);
-            if (scm_is_null (scm))
-                break;
-            options = gnc_query_scm2numericop (scm);
-
-            scm = SCM_CAR (qt_scm);
-            if (!gnc_query_numeric_p (scm))
-                break;
-            val = gnc_query_scm2numeric (scm);
-
-            pd = qof_query_numeric_predicate (compare_how, options, val);
-
-        }
-        else if (!g_strcmp0 (type, QOF_TYPE_GUID))
-        {
-            QofGuidMatch options;
-            GList *guids;
-
-            scm = SCM_CAR (qt_scm);
-            qt_scm = SCM_CDR (qt_scm);
-            if (scm_is_null (scm))
-                break;
-            options = gnc_query_scm2guid (scm);
-
-            scm = SCM_CAR (qt_scm);
-            if (!scm_is_list (scm))
-                break;
-            guids = gnc_scm2guid_glist (scm);
-
-            pd = qof_query_guid_predicate (options, guids);
-
-            gnc_guid_glist_free (guids);
-
-        }
-        else if (!g_strcmp0 (type, QOF_TYPE_INT64))
-        {
-            gint64 val;
-
-            scm = SCM_CAR (qt_scm);
-            if (scm_is_null (scm))
-                break;
-            val = scm_to_int64 (scm);
-
-            pd = qof_query_int64_predicate (compare_how, val);
-
-        }
-        else if (!g_strcmp0 (type, QOF_TYPE_DOUBLE))
-        {
-            double val;
-
-            scm = SCM_CAR (qt_scm);
-            if (!scm_is_number (scm))
-                break;
-            val = scm_to_double (scm);
-
-            pd = qof_query_double_predicate (compare_how, val);
-
-        }
-        else if (!g_strcmp0 (type, QOF_TYPE_BOOLEAN))
-        {
-            gboolean val;
-
-            scm = SCM_CAR (qt_scm);
-            if (!scm_is_bool (scm))
-                break;
-            val = scm_is_true (scm);
-
-            pd = qof_query_boolean_predicate (compare_how, val);
-
-        }
-        else if (!g_strcmp0 (type, QOF_TYPE_CHAR))
-        {
-            QofCharMatch options;
-            gchar *char_list;
-
-            scm = SCM_CAR (qt_scm);
-            qt_scm = SCM_CDR (qt_scm);
-            if (scm_is_null (scm))
-                break;
-            options = gnc_query_scm2char (scm);
-
-            scm = SCM_CAR (qt_scm);
-            if (!scm_is_string (scm))
-                break;
-            char_list = gnc_scm_to_utf8_string (scm);
-
-            pd = qof_query_char_predicate (options, char_list);
-            g_free (char_list);
-        }
-        else
-        {
-            PWARN ("query core type %s not supported", type);
-            break;
-        }
-
-        g_free (type);
-
-    }
-    while (FALSE);
-
-    if (pd)
-    {
-        q = qof_query_create ();
-        qof_query_add_term (q, path, pd, QOF_QUERY_OR);
-        if (inverted)
-        {
-            QofQuery *outq = qof_query_invert (q);
-            qof_query_destroy (q);
-            q = outq;
-        }
-    }
-    else
-    {
-        gnc_query_path_free (path);
-    }
-
-    return q;
-}
-
-static QofQuery *
-gnc_scm2query_term_query_v1 (SCM query_term_scm)
-{
-    gboolean ok = FALSE;
-    gchar * pd_type = NULL;
-    gchar * pr_type = NULL;
-    gboolean sense = FALSE;
-    QofQuery *q = NULL;
-    SCM scm;
-
-    if (!scm_is_list (query_term_scm) ||
-            scm_is_null (query_term_scm))
-    {
-        PINFO ("null term");
-        return NULL;
-    }
-
-    do
-    {
-        /* pd_type */
-        scm = SCM_CAR (query_term_scm);
-        query_term_scm = SCM_CDR (query_term_scm);
-        pd_type = gnc_scm_symbol_to_locale_string (scm);
-
-        /* pr_type */
-        if (scm_is_null (query_term_scm))
-        {
-            PINFO ("null pr_type");
-            break;
-        }
-        scm = SCM_CAR (query_term_scm);
-        query_term_scm = SCM_CDR (query_term_scm);
-        pr_type = gnc_scm_symbol_to_locale_string (scm);
-
-        /* sense */
-        if (scm_is_null (query_term_scm))
-        {
-            PINFO ("null sense");
-            break;
-        }
-        scm = SCM_CAR (query_term_scm);
-        query_term_scm = SCM_CDR (query_term_scm);
-        sense = scm_is_true (scm);
-
-        q = qof_query_create_for(GNC_ID_SPLIT);
-
-        if (!g_strcmp0 (pd_type, "pd-date"))
-        {
-            gboolean use_start;
-            gboolean use_end;
-            time64 start;
-            time64 end;
-
-            /* use_start */
-            if (scm_is_null (query_term_scm))
-            {
-                PINFO ("null use_start");
-                break;
-            }
-
-            scm = SCM_CAR (query_term_scm);
-            query_term_scm = SCM_CDR (query_term_scm);
-            use_start = scm_is_true (scm);
-
-            /* start */
-            if (scm_is_null (query_term_scm))
-                break;
-
-            scm = SCM_CAR (query_term_scm);
-            query_term_scm = SCM_CDR (query_term_scm);
-            start = scm_to_int64 (scm);
-
-            /* use_end */
-            if (scm_is_null (query_term_scm))
-                break;
-
-            scm = SCM_CAR (query_term_scm);
-            query_term_scm = SCM_CDR (query_term_scm);
-            use_end = scm_is_true (scm);
-
-            /* end */
-            if (scm_is_null (query_term_scm))
-                break;
-
-            scm = SCM_CAR (query_term_scm);
-            end = scm_to_int64 (scm);
-
-            xaccQueryAddDateMatchTT (q, use_start, start, use_end, end, QOF_QUERY_OR);
-
-            ok = TRUE;
-
-        }
-        else if (!g_strcmp0 (pd_type, "pd-amount"))
-        {
-            QofQueryCompare how;
-            QofNumericMatch amt_sgn;
-            double amount;
-            gnc_numeric val;
-
-            /* how */
-            if (scm_is_null (query_term_scm))
-                break;
-            scm = SCM_CAR (query_term_scm);
-            query_term_scm = SCM_CDR (query_term_scm);
-            how = gnc_scm2amt_match_how (scm);
-
-            /* amt_sgn */
-            if (scm_is_null (query_term_scm))
-                break;
-            scm = SCM_CAR (query_term_scm);
-            query_term_scm = SCM_CDR (query_term_scm);
-            amt_sgn = gnc_query_scm2numericop (scm);
-
-            /* amount */
-            if (scm_is_null (query_term_scm))
-                break;
-            scm = SCM_CAR (query_term_scm);
-            val = gnc_numeric_create (scm_to_int64(scm_numerator(scm)),
-                                      scm_to_int64(scm_denominator(scm)));
-
-            if (!g_strcmp0 (pr_type, "pr-price"))
-            {
-                xaccQueryAddSharePriceMatch (q, val, how, QOF_QUERY_OR);
-                ok = TRUE;
-
-            }
-            else if (!g_strcmp0 (pr_type, "pr-shares"))
-            {
-                xaccQueryAddSharesMatch (q, val, how, QOF_QUERY_OR);
-                ok = TRUE;
-
-            }
-            else if (!g_strcmp0 (pr_type, "pr-value"))
-            {
-                xaccQueryAddValueMatch (q, val, amt_sgn, how, QOF_QUERY_OR);
-                ok = TRUE;
-
-            }
-            else
-            {
-                PINFO ("unknown amount predicate: %s", pr_type);
-            }
-
-        }
-        else if (!g_strcmp0 (pd_type, "pd-account"))
-        {
-            QofGuidMatch how;
-            GList *account_guids;
-
-            /* how */
-            if (scm_is_null (query_term_scm))
-            {
-                PINFO ("pd-account: null how");
-                break;
-            }
-
-            scm = SCM_CAR (query_term_scm);
-            query_term_scm = SCM_CDR (query_term_scm);
-            how = gnc_scm2acct_match_how (scm);
-
-            /* account guids */
-            if (scm_is_null (query_term_scm))
-            {
-                PINFO ("pd-account: null guids");
-                break;
-            }
-
-            scm = SCM_CAR (query_term_scm);
-
-            account_guids = gnc_scm2guid_glist (scm);
-
-            xaccQueryAddAccountGUIDMatch (q, account_guids, how, QOF_QUERY_OR);
-
-            gnc_guid_glist_free (account_guids);
-
-            ok = TRUE;
-
-        }
-        else if (!g_strcmp0 (pd_type, "pd-string"))
-        {
-            gboolean case_sens;
-            gboolean use_regexp;
-            gchar *matchstring;
-
-            /* case_sens */
-            if (scm_is_null (query_term_scm))
-                break;
-
-            scm = SCM_CAR (query_term_scm);
-            query_term_scm = SCM_CDR (query_term_scm);
-            case_sens = scm_is_true (scm);
-
-            /* use_regexp */
-            if (scm_is_null (query_term_scm))
-                break;
-
-            scm = SCM_CAR (query_term_scm);
-            query_term_scm = SCM_CDR (query_term_scm);
-            use_regexp = scm_is_true (scm);
-
-            /* matchstring */
-            if (scm_is_null (query_term_scm))
-                break;
-
-            scm = SCM_CAR (query_term_scm);
-            matchstring = gnc_scm_to_utf8_string (scm);
-
-            if (!g_strcmp0 (pr_type, "pr-action"))
-            {
-                xaccQueryAddActionMatch (q, matchstring, case_sens, use_regexp,
-                                         QOF_COMPARE_CONTAINS, QOF_QUERY_OR);
-                ok = TRUE;
-
-            }
-            else if (!g_strcmp0 (pr_type, "pr-desc"))
-            {
-                xaccQueryAddDescriptionMatch (q, matchstring, case_sens,
-                                              use_regexp, QOF_COMPARE_CONTAINS, QOF_QUERY_OR);
-                ok = TRUE;
-
-            }
-            else if (!g_strcmp0 (pr_type, "pr-memo"))
-            {
-                xaccQueryAddMemoMatch (q, matchstring, case_sens, use_regexp,
-                                       QOF_COMPARE_CONTAINS, QOF_QUERY_OR);
-                ok = TRUE;
-
-            }
-            else if (!g_strcmp0 (pr_type, "pr-num"))
-            {
-                xaccQueryAddNumberMatch (q, matchstring, case_sens, use_regexp,
-                                         QOF_COMPARE_CONTAINS, QOF_QUERY_OR);
-                ok = TRUE;
-
-            }
-            else
-            {
-                PINFO ("Unknown string predicate: %s", pr_type);
-            }
-            g_free (matchstring);
-
-        }
-        else if (!g_strcmp0 (pd_type, "pd-cleared"))
-        {
-            cleared_match_t how;
-
-            /* how */
-            if (scm_is_null (query_term_scm))
-                break;
-
-            scm = SCM_CAR (query_term_scm);
-            how = gnc_scm2cleared_match_how (scm);
-
-            xaccQueryAddClearedMatch (q, how, QOF_QUERY_OR);
-            ok = TRUE;
-
-        }
-        else if (!g_strcmp0 (pd_type, "pd-balance"))
-        {
-            gboolean how;
-
-            /* how */
-            if (scm_is_null (query_term_scm))
-                break;
-
-            scm = SCM_CAR (query_term_scm);
-            if (gnc_scm2balance_match_how (scm, &how) == FALSE)
-                break;
-
-            xaccQueryAddBalanceMatch (q, how, QOF_QUERY_OR);
-            ok = TRUE;
-
-        }
-        else if (!g_strcmp0 (pd_type, "pd-guid"))
-        {
-            GncGUID guid;
-            QofIdType id_type;
-
-            /* guid */
-            if (scm_is_null (query_term_scm))
-                break;
-
-            scm = SCM_CAR (query_term_scm);
-            query_term_scm = SCM_CDR (query_term_scm);
-            guid = gnc_scm2guid (scm);
-
-            /* id type */
-            scm = SCM_CAR (query_term_scm);
-            id_type = (QofIdType) gnc_scm_to_utf8_string (scm);
-
-            xaccQueryAddGUIDMatch (q, &guid, id_type, QOF_QUERY_OR);
-            g_free ((void *) id_type);
-            ok = TRUE;
-
-        }
-        else
-        {
-            PINFO ("Unknown Predicate: %s", pd_type);
-        }
-
-        g_free (pd_type);
-        g_free (pr_type);
-
-    }
-    while (FALSE);
-
-    if (ok)
-    {
-        QofQuery *out_q;
-
-        if (sense)
-            out_q = q;
-        else
-        {
-            out_q = qof_query_invert (q);
-            qof_query_destroy (q);
-        }
-
-        return out_q;
-    }
-
-    qof_query_destroy (q);
-    return NULL;
-}
-
-static QofQuery *
-gnc_scm2query_term_query (SCM query_term_scm, query_version_t vers)
-{
-    switch (vers)
-    {
-    case gnc_QUERY_v1:
-        return gnc_scm2query_term_query_v1 (query_term_scm);
-    case gnc_QUERY_v2:
-        return gnc_scm2query_term_query_v2 (query_term_scm);
-    default:
-        return NULL;
-    }
-}
-
-static SCM
-gnc_query_terms2scm (const GList *terms)
-{
-    SCM or_terms = SCM_EOL;
-    const GList *or_node;
-
-    for (or_node = terms; or_node; or_node = or_node->next)
-    {
-        SCM and_terms = SCM_EOL;
-        GList *and_node;
-
-        for (and_node = or_node->data; and_node; and_node = and_node->next)
-        {
-            QofQueryTerm *qt = and_node->data;
-            SCM qt_scm;
-
-            qt_scm = gnc_queryterm2scm (qt);
-
-            and_terms = scm_cons (qt_scm, and_terms);
-        }
-
-        and_terms = scm_reverse (and_terms);
-
-        or_terms = scm_cons (and_terms, or_terms);
-    }
-
-    return scm_reverse (or_terms);
-}
-
-static QofQuery *
-gnc_scm2query_and_terms (SCM and_terms, query_version_t vers)
-{
-    QofQuery *q = NULL;
-
-    if (!scm_is_list (and_terms))
-        return NULL;
-
-    while (!scm_is_null (and_terms))
-    {
-        SCM term;
-
-        term = SCM_CAR (and_terms);
-        and_terms = SCM_CDR (and_terms);
-
-        if (!q)
-            q = gnc_scm2query_term_query (term, vers);
-        else
-        {
-            QofQuery *q_and;
-            QofQuery *q_new;
-
-            q_and = gnc_scm2query_term_query (term, vers);
-
-            if (q_and)
-            {
-                q_new = qof_query_merge (q, q_and, QOF_QUERY_AND);
-
-                if (q_new)
-                {
-                    qof_query_destroy (q);
-                    q = q_new;
-                }
-            }
-        }
-    }
-
-    return q;
-}
-
-static QofQuery *
-gnc_scm2query_or_terms (SCM or_terms, query_version_t vers)
-{
-    QofQuery *q = NULL;
-
-    if (!scm_is_list (or_terms))
-        return NULL;
-
-    q = qof_query_create_for(GNC_ID_SPLIT);
-
-    while (!scm_is_null (or_terms))
-    {
-        SCM and_terms;
-
-        and_terms = SCM_CAR (or_terms);
-        or_terms = SCM_CDR (or_terms);
-
-        if (!q)
-            q = gnc_scm2query_and_terms (and_terms, vers);
-        else
-        {
-            QofQuery *q_or;
-            QofQuery *q_new;
-
-            q_or = gnc_scm2query_and_terms (and_terms, vers);
-
-            if (q_or)
-            {
-                q_new = qof_query_merge (q, q_or, QOF_QUERY_OR);
-
-                if (q_new)
-                {
-                    qof_query_destroy (q);
-                    q = q_new;
-                }
-            }
-        }
-    }
-
-    return q;
-}
-
-static SCM
-gnc_query_sort2scm (const QofQuerySort *qs)
-{
-    SCM sort_scm = SCM_EOL;
-    GSList *path;
-
-    path = qof_query_sort_get_param_path (qs);
-    if (path == NULL)
-        return SCM_BOOL_F;
-
-    sort_scm = scm_cons (gnc_query_path2scm (path), sort_scm);
-    sort_scm = scm_cons (scm_from_int  (qof_query_sort_get_sort_options (qs)), sort_scm);
-    sort_scm = scm_cons (SCM_BOOL (qof_query_sort_get_increasing (qs)), sort_scm);
-
-    return scm_reverse (sort_scm);
-}
-
-static gboolean
-gnc_query_scm2sort (SCM sort_scm, GSList **path, gint *options, gboolean *inc)
-{
-    SCM val;
-    GSList *p;
-    gint o;
-    gboolean i;
-
-    g_return_val_if_fail (path && options && inc, FALSE);
-    g_return_val_if_fail (*path == NULL, FALSE);
-
-    /* This is ok -- it means we have an empty sort.  Don't do anything */
-    if (scm_is_bool (sort_scm))
-        return TRUE;
-
-    /* Ok, this had better be a list */
-    if (!scm_is_list (sort_scm))
-        return FALSE;
-
-    /* Parse the path, options, and increasing */
-    val = SCM_CAR (sort_scm);
-    sort_scm = SCM_CDR (sort_scm);
-    if (!scm_is_list (val))
-        return FALSE;
-    p = gnc_query_scm2path (val);
-
-    /* options */
-    val = SCM_CAR (sort_scm);
-    sort_scm = SCM_CDR (sort_scm);
-    if (!scm_is_number (val))
-    {
-        gnc_query_path_free (p);
-        return FALSE;
-    }
-    o = scm_to_int (val);
-
-    /* increasing */
-    val = SCM_CAR (sort_scm);
-    sort_scm = SCM_CDR (sort_scm);
-    if (!scm_is_bool (val))
-    {
-        gnc_query_path_free (p);
-        return FALSE;
-    }
-    i = scm_is_true (val);
-
-    /* EOL */
-    if (!scm_is_null (sort_scm))
-    {
-        gnc_query_path_free (p);
-        return FALSE;
-    }
-    *path = p;
-    *options = o;
-    *inc = i;
-
-    return TRUE;
-}
-
-SCM
-gnc_query2scm (QofQuery *q)
-{
-    SCM query_scm = SCM_EOL;
-    SCM pair;
-    QofQuerySort *s1, *s2, *s3;
-
-    if (!q) return SCM_BOOL_F;
-
-    /* terms */
-    pair = scm_cons (gnc_query_terms2scm (qof_query_get_terms (q)), SCM_EOL);
-    pair = scm_cons (scm_from_locale_symbol ("terms"), pair);
-    query_scm = scm_cons (pair, query_scm);
-
-    /* search-for */
-    pair = scm_cons (scm_from_locale_symbol (qof_query_get_search_for (q)), SCM_EOL);
-    pair = scm_cons (scm_from_locale_symbol ("search-for"), pair);
-    query_scm = scm_cons (pair, query_scm);
-
-    /* sorts... */
-    qof_query_get_sorts (q, &s1, &s2, &s3);
-
-    /* primary-sort */
-    pair = scm_cons (gnc_query_sort2scm (s1), SCM_EOL);
-    pair = scm_cons (scm_from_locale_symbol ("primary-sort"), pair);
-    query_scm = scm_cons (pair, query_scm);
-
-    /* secondary-sort */
-    pair = scm_cons (gnc_query_sort2scm (s2), SCM_EOL);
-    pair = scm_cons (scm_from_locale_symbol ("secondary-sort"), pair);
-    query_scm = scm_cons (pair, query_scm);
-
-    /* tertiary-sort */
-    pair = scm_cons (gnc_query_sort2scm (s3), SCM_EOL);
-    pair = scm_cons (scm_from_locale_symbol ("tertiary-sort"), pair);
-    query_scm = scm_cons (pair, query_scm);
-
-    /* max results */
-    pair = scm_cons (scm_from_int  (qof_query_get_max_results (q)), SCM_EOL);
-    pair = scm_cons (scm_from_locale_symbol ("max-results"), pair);
-    query_scm = scm_cons (pair, query_scm);
-
-    /* Reverse this list; tag it as 'query-v2' */
-    pair = scm_reverse (query_scm);
-    return scm_cons (scm_from_locale_symbol ("query-v2"), pair);
-}
-
-static GSList *
-gnc_query_sort_to_list (const gchar * symbol)
-{
-    GSList *path = NULL;
-
-    if (!symbol)
-        return NULL;
-
-    if (!g_strcmp0 (symbol, "by-none"))
-    {
-        path = NULL;
-    }
-    else if (!g_strcmp0 (symbol, "by-standard"))
-    {
-        path = g_slist_prepend (path, QUERY_DEFAULT_SORT);
-
-    }
-    else if (!g_strcmp0 (symbol, "by-date") ||
-             !g_strcmp0 (symbol, "by-date-rounded"))
-    {
-        path = g_slist_prepend (path, TRANS_DATE_POSTED);
-        path = g_slist_prepend (path, SPLIT_TRANS);
-
-    }
-    else if (!g_strcmp0 (symbol, "by-date-entered") ||
-             !g_strcmp0 (symbol, "by-date-entered-rounded"))
-    {
-        path = g_slist_prepend (path, TRANS_DATE_ENTERED);
-        path = g_slist_prepend (path, SPLIT_TRANS);
-
-    }
-    else if (!g_strcmp0 (symbol, "by-date-reconciled") ||
-             !g_strcmp0 (symbol, "by-date-reconciled-rounded"))
-    {
-        path = g_slist_prepend (path, SPLIT_DATE_RECONCILED);
-
-    }
-    else if (!g_strcmp0 (symbol, "by-num"))
-    {
-        path = g_slist_prepend (path, TRANS_NUM);
-        path = g_slist_prepend (path, SPLIT_TRANS);
-
-    }
-    else if (!g_strcmp0 (symbol, "by-amount"))
-    {
-        path = g_slist_prepend (path, SPLIT_VALUE);
-
-    }
-    else if (!g_strcmp0 (symbol, "by-memo"))
-    {
-        path = g_slist_prepend (path, SPLIT_MEMO);
-
-    }
-    else if (!g_strcmp0 (symbol, "by-desc"))
-    {
-        path = g_slist_prepend (path, TRANS_DESCRIPTION);
-        path = g_slist_prepend (path, SPLIT_TRANS);
-
-    }
-    else if (!g_strcmp0 (symbol, "by-reconcile"))
-    {
-        path = g_slist_prepend (path, SPLIT_RECONCILE);
-
-    }
-    else if (!g_strcmp0 (symbol, "by-account-full-name"))
-    {
-        path = g_slist_prepend (path, SPLIT_ACCT_FULLNAME);
-
-    }
-    else if (!g_strcmp0 (symbol, "by-account-code"))
-    {
-        path = g_slist_prepend (path, ACCOUNT_CODE_);
-        path = g_slist_prepend (path, SPLIT_ACCOUNT);
-
-    }
-    else if (!g_strcmp0 (symbol, "by-corr-account-full-name"))
-    {
-        path = g_slist_prepend (path, SPLIT_CORR_ACCT_NAME);
-
-    }
-    else if (!g_strcmp0 (symbol, "by-corr-account-code"))
-    {
-        path = g_slist_prepend (path, SPLIT_CORR_ACCT_CODE);
-
-    }
-    else
-    {
-        PERR ("Unknown sort-type, %s", symbol);
-    }
-
-    return path;
-}
-
-static QofQuery *
-gnc_scm2query_v1 (SCM query_scm)
-{
-    QofQuery *q = NULL;
-    gboolean ok = TRUE;
-    gchar * primary_sort = NULL;
-    gchar * secondary_sort = NULL;
-    gchar * tertiary_sort = NULL;
-    gboolean primary_increasing = TRUE;
-    gboolean secondary_increasing = TRUE;
-    gboolean tertiary_increasing = TRUE;
-    int max_splits = -1;
-
-    while (!scm_is_null (query_scm))
-    {
-        gchar *symbol;
-        SCM sym_scm;
-        SCM value;
-        SCM pair;
-
-        pair = SCM_CAR (query_scm);
-        query_scm = SCM_CDR (query_scm);
-
-        if (!scm_is_pair (pair))
-        {
-            PERR ("Not a Pair");
-            ok = FALSE;
-            break;
-        }
-
-        sym_scm = SCM_CAR (pair);
-        value = SCM_CADR (pair);
-
-        if (!scm_is_symbol (sym_scm))
-        {
-            PERR ("Not a symbol");
-            ok = FALSE;
-            break;
-        }
-
-        symbol = gnc_scm_symbol_to_locale_string (sym_scm);
-        if (!symbol)
-        {
-            PERR ("No string found");
-            ok = FALSE;
-            break;
-        }
-
-        if (g_strcmp0 ("terms", symbol) == 0)
-        {
-            if (q)
-                qof_query_destroy (q);
-
-            q = gnc_scm2query_or_terms (value, gnc_QUERY_v1);
-            if (!q)
-            {
-                PINFO ("invalid terms");
-                ok = FALSE;
-                break;
-            }
-
-        }
-        else if (g_strcmp0 ("primary-sort", symbol) == 0)
-        {
-            if (!scm_is_symbol (value))
-            {
-                PINFO ("Invalid primary sort");
-                ok = FALSE;
-                break;
-            }
-
-            primary_sort = gnc_scm_symbol_to_locale_string (value);
-
-        }
-        else if (g_strcmp0 ("secondary-sort", symbol) == 0)
-        {
-            if (!scm_is_symbol (value))
-            {
-                PINFO ("Invalid secondary sort");
-                ok = FALSE;
-                break;
-            }
-
-            secondary_sort = gnc_scm_symbol_to_locale_string (value);
-
-        }
-        else if (g_strcmp0 ("tertiary-sort", symbol) == 0)
-        {
-            if (!scm_is_symbol (value))
-            {
-                PINFO ("Invalid tertiary sort");
-                ok = FALSE;
-                break;
-            }
-
-            tertiary_sort = gnc_scm_symbol_to_locale_string (value);
-
-        }
-        else if (g_strcmp0 ("primary-increasing", symbol) == 0)
-        {
-            primary_increasing = scm_is_true (value);
-
-        }
-        else if (g_strcmp0 ("secondary-increasing", symbol) == 0)
-        {
-            secondary_increasing = scm_is_true (value);
-
-        }
-        else if (g_strcmp0 ("tertiary-increasing", symbol) == 0)
-        {
-            tertiary_increasing = scm_is_true (value);
-
-        }
-        else if (g_strcmp0 ("max-splits", symbol) == 0)
-        {
-            if (!scm_is_number (value))
-            {
-                PERR ("invalid max-splits");
-                ok = FALSE;
-                break;
-            }
-
-            max_splits = scm_to_int (value);
-
-        }
-        else
-        {
-            PERR ("Unknown symbol: %s", symbol);
-            ok = FALSE;
-            break;
-        }
-
-        g_free (symbol);
-    }
-
-    if (ok)
-    {
-        GSList *s1, *s2, *s3;
-        s1 = gnc_query_sort_to_list (primary_sort);
-        s2 = gnc_query_sort_to_list (secondary_sort);
-        s3 = gnc_query_sort_to_list (tertiary_sort);
-
-        qof_query_set_sort_order (q, s1, s2, s3);
-        qof_query_set_sort_increasing (q, primary_increasing, secondary_increasing,
-                                       tertiary_increasing);
-        qof_query_set_max_results (q, max_splits);
-    }
-    else
-    {
-        qof_query_destroy (q);
-        q = NULL;
-    }
-
-    g_free (primary_sort);
-    g_free (secondary_sort);
-    g_free (tertiary_sort);
-
-    return q;
-}
-
-static QofQuery *
-gnc_scm2query_v2 (SCM query_scm)
-{
-    QofQuery *q = NULL;
-    gboolean ok = TRUE;
-    gchar * search_for = NULL;
-    GSList *sp1 = NULL, *sp2 = NULL, *sp3 = NULL;
-    gint so1 = 0, so2 = 0, so3 = 0;
-    gboolean si1 = TRUE, si2 = TRUE, si3 = TRUE;
-    int max_results = -1;
-
-    while (!scm_is_null (query_scm))
-    {
-        gchar *symbol;
-        SCM sym_scm;
-        SCM value;
-        SCM pair;
-
-        pair = SCM_CAR (query_scm);
-        query_scm = SCM_CDR (query_scm);
-
-        if (!scm_is_pair (pair))
-        {
-            ok = FALSE;
-            break;
-        }
-
-        sym_scm = SCM_CAR (pair);
-        value = SCM_CADR (pair);
-
-        if (!scm_is_symbol (sym_scm))
-        {
-            ok = FALSE;
-            break;
-        }
-
-        symbol = gnc_scm_symbol_to_locale_string (sym_scm);
-        if (!symbol)
-        {
-            ok = FALSE;
-            break;
-        }
-
-        if (!g_strcmp0 ("terms", symbol))
-        {
-            if (q)
-                qof_query_destroy (q);
-
-            q = gnc_scm2query_or_terms (value, gnc_QUERY_v2);
-            if (!q)
-            {
-                ok = FALSE;
-                break;
-            }
-
-        }
-        else if (!g_strcmp0 ("search-for", symbol))
-        {
-            if (!scm_is_symbol (value))
-            {
-                ok = FALSE;
-                break;
-            }
-            search_for = gnc_scm_symbol_to_locale_string (value);
-
-        }
-        else if (g_strcmp0 ("primary-sort", symbol) == 0)
-        {
-            if (! gnc_query_scm2sort (value, &sp1, &so1, &si1))
-            {
-                ok = FALSE;
-                break;
-            }
-
-        }
-        else if (!g_strcmp0 ("secondary-sort", symbol))
-        {
-            if (! gnc_query_scm2sort (value, &sp2, &so2, &si2))
-            {
-                ok = FALSE;
-                break;
-            }
-
-        }
-        else if (!g_strcmp0 ("tertiary-sort", symbol))
-        {
-            if (! gnc_query_scm2sort (value, &sp3, &so3, &si3))
-            {
-                ok = FALSE;
-                break;
-            }
-
-        }
-        else if (!g_strcmp0 ("max-results", symbol))
-        {
-            if (!scm_is_number (value))
-            {
-                ok = FALSE;
-                break;
-            }
-
-            max_results = scm_to_int (value);
-
-        }
-        else
-        {
-            ok = FALSE;
-            break;
-        }
-
-        g_free (symbol);
-    }
-
-    if (ok && search_for)
-    {
-        qof_query_search_for (q, search_for);
-        qof_query_set_sort_order (q, sp1, sp2, sp3);
-        qof_query_set_sort_options (q, so1, so2, so3);
-        qof_query_set_sort_increasing (q, si1, si2, si3);
-        qof_query_set_max_results (q, max_results);
-    }
-    else
-    {
-        qof_query_destroy (q);
-        q = NULL;
-    }
-
-    g_free (search_for);
-
-    return q;
-}
-
-QofQuery *
-gnc_scm2query (SCM query_scm)
-{
-    SCM q_type;
-    gchar *type;
-    QofQuery *q = NULL;
-
-    /* Not a list or NULL?  No need to go further */
-    if (!scm_is_list (query_scm) || scm_is_null (query_scm))
-        return NULL;
-
-    /* Grab the 'type' (for v2 and above) */
-    q_type = SCM_CAR (query_scm);
-
-    if (!scm_is_symbol (q_type))
-    {
-        if (scm_is_pair (q_type))
-        {
-            /* Version-1 queries are just a list */
-            return gnc_scm2query_v1 (query_scm);
-        }
-        else
-        {
-            return NULL;
-        }
-    }
-
-    /* Ok, the LHS is the version and the RHS is the actual query list */
-    type = gnc_scm_symbol_to_locale_string (q_type);
-    if (!type)
-        return NULL;
-
-    if (!g_strcmp0 (type, "query-v2"))
-        q = gnc_scm2query_v2 (SCM_CDR (query_scm));
-
-    g_free (type);
-    return q;
-}
-
-gnc_numeric
-gnc_scm_to_numeric(SCM gncnum)
-{
-    if (scm_is_signed_integer(scm_numerator(gncnum), INT64_MIN, INT64_MAX) &&
-        scm_is_signed_integer(scm_denominator(gncnum), INT64_MIN, INT64_MAX))
-        return gnc_numeric_create(scm_to_int64(scm_numerator(gncnum)),
-                                  scm_to_int64(scm_denominator(gncnum)));
-    return gnc_numeric_create(0, GNC_ERROR_OVERFLOW);
-}
-
-SCM
-gnc_numeric_to_scm(gnc_numeric arg)
-{
-    return scm_divide(scm_from_int64(arg.num),
-                           scm_from_int64(arg.denom));
-}
-
-static SCM
-gnc_generic_to_scm(const void *cx, const gchar *type_str)
-{
-    swig_type_info * stype = NULL;
-    void *x = (void*) cx;
-
-    if (!x) return SCM_BOOL_F;
-    stype = SWIG_TypeQuery(type_str);
-
-    if (!stype)
-    {
-        PERR("Unknown SWIG Type: %s ", type_str);
-        return SCM_BOOL_F;
-    }
-
-    return SWIG_NewPointerObj(x, stype, 0);
-}
-
-static void *
-gnc_scm_to_generic(SCM scm, const gchar *type_str)
-{
-    swig_type_info * stype = NULL;
-
-    stype = SWIG_TypeQuery(type_str);
-    if (!stype)
-    {
-        PERR("Unknown SWIG Type: %s ", type_str);
-        return NULL;
-    }
-
-    if (!SWIG_IsPointerOfType(scm, stype))
-        return NULL;
-
-    return SWIG_MustGetPtr(scm, stype, 1, 0);
-}
-
-gnc_commodity *
-gnc_scm_to_commodity(SCM scm)
-{
-    return gnc_scm_to_generic(scm, "_p_gnc_commodity");
-}
-
-SCM
-gnc_commodity_to_scm (const gnc_commodity *commodity)
-{
-    return gnc_generic_to_scm(commodity, "_p_gnc_commodity");
-}
-
-SCM
-gnc_book_to_scm (const QofBook *book)
-{
-    return gnc_generic_to_scm(book, "_p_QofBook");
-}
diff --git a/libgnucash/engine/gnc-commodity.c b/libgnucash/engine/gnc-commodity.c
index b6ae5a4b3..bc20f53c5 100644
--- a/libgnucash/engine/gnc-commodity.c
+++ b/libgnucash/engine/gnc-commodity.c
@@ -138,7 +138,7 @@ struct gnc_new_iso_code
     {"TRL", "TRY"}, /* New Turkish Lira: changed 2005 */
 
     /* Only add currencies to this table when the old currency no longer
-     * exists in the file iso-4217-currencies.scm */
+     * exists in the file iso-4217-currencies.xml */
 };
 #define GNC_NEW_ISO_CODES \
         (sizeof(gnc_new_iso_codes) / sizeof(struct gnc_new_iso_code))
diff --git a/libgnucash/engine/gnc-hooks-scm.c b/libgnucash/engine/gnc-hooks-scm.c
deleted file mode 100644
index b4929b7aa..000000000
--- a/libgnucash/engine/gnc-hooks-scm.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * gnc-hooks-scm.c -- helpers for using Glib hook functions in guile
- * Copyright (C) 2005 David Hampton <hampton at employees.org>
- *                    Derek Atkins <derek at ihtfp.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, contact:
- *
- * Free Software Foundation           Voice:  +1-617-542-5942
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652
- * Boston, MA  02110-1301,  USA       gnu at gnu.org
- */
-
-#include <config.h>
-
-#include <glib.h>
-#include <stdio.h>
-#include "gnc-hooks.h"
-#include "gnc-hooks-scm.h"
-#include "gnc-engine.h"
-#include <libguile.h>
-#include "swig-runtime.h"
-#include <guile-mappings.h>
-
-static QofLogModule log_module = GNC_MOD_ENGINE;
-
-typedef struct
-{
-    SCM proc;
-    int num_args;
-} GncScmDangler;
-
-
-static void
-delete_scm_hook (gpointer data)
-{
-    GncScmDangler *scm = data;
-    scm_gc_unprotect_object(scm->proc);
-    g_free(scm);
-}
-
-static void
-scm_hook_cb (gpointer data, GncScmDangler *scm)
-{
-    ENTER("data %p, cbarg %p", data, scm);
-
-    if (scm->num_args == 0)
-        scm_call_0 (scm->proc);
-    else
-    {
-        // XXX: FIXME: We really should make sure this is a session!!! */
-        scm_call_1 (scm->proc,
-            SWIG_NewPointerObj(data, SWIG_TypeQuery("_p_QofSession"), 0));
-    }
-
-    LEAVE("");
-}
-
-void
-gnc_hook_add_scm_dangler (const gchar *name, SCM proc)
-{
-    GHook *hook;
-    GncScmDangler *scm;
-    int num_args;
-
-    ENTER("list %s, proc ???", name);
-    num_args = gnc_hook_num_args(name);
-    g_return_if_fail(num_args >= 0);
-    scm = g_new0(GncScmDangler, 1);
-    scm_gc_protect_object(proc);
-    scm->proc = proc;
-    scm->num_args = num_args;
-    gnc_hook_add_dangler(name, (GFunc)scm_hook_cb,
-                         (GDestroyNotify) delete_scm_hook, scm);
-    LEAVE("");
-}
diff --git a/libgnucash/engine/gnc-hooks-scm.h b/libgnucash/engine/gnc-hooks-scm.h
deleted file mode 100644
index 253567367..000000000
--- a/libgnucash/engine/gnc-hooks-scm.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * gnc-hooks-scm.h -- scheme helpers for using Glib hook functions
- * Copyright (C) 2005 Derek Atkins <derek at ihtfp.com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, contact:
- *
- * Free Software Foundation           Voice:  +1-617-542-5942
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652
- * Boston, MA  02110-1301,  USA       gnu at gnu.org
- *
- */
-
-#ifndef GNC_HOOKS_SCM_H
-#define GNC_HOOKS_SCM_H
-
-#include "gnc-hooks.h"
-#include <libguile.h>
-
-/**
- * add and remove Scheme-style danglers from a hook
- */
-void gnc_hook_add_scm_dangler(const gchar *name, SCM proc);
-void gnc_hook_del_scm_dangler(const gchar *name, SCM proc);
-
-#endif /* GNC_HOOKS_SCM_H */
diff --git a/libgnucash/engine/gncBusGuile.c b/libgnucash/engine/gncBusGuile.c
deleted file mode 100644
index 359c5c8ff..000000000
--- a/libgnucash/engine/gncBusGuile.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * gncBusGuile.c -- Business Guile Helper Functions
- * Copyright (C) 2003 Derek Atkins
- * Author: Derek Atkins <warlord at MIT.EDU>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, contact:
- *
- * Free Software Foundation           Voice:  +1-617-542-5942
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652
- * Boston, MA  02110-1301,  USA       gnu at gnu.org
- */
-
-#include <config.h>
-
-#include "gncBusGuile.h"
-#include "engine-helpers.h"
-#include "engine-helpers-guile.h"
-#include "swig-runtime.h"
-#include "guile-mappings.h"
-#define FUNC_NAME G_STRFUNC
-
-static swig_type_info *
-get_acct_type ()
-{
-    static swig_type_info * account_type = NULL;
-
-    if (!account_type)
-        account_type = SWIG_TypeQuery("_p_Account");
-
-    return account_type;
-}
-
-GncAccountValue * gnc_scm_to_account_value_ptr (SCM valuearg)
-{
-    GncAccountValue *res;
-    Account *acc = NULL;
-    gnc_numeric value;
-    swig_type_info * account_type = get_acct_type();
-    SCM val;
-
-    /* Get the account */
-    val = SCM_CAR (valuearg);
-    if (!SWIG_IsPointerOfType (val, account_type))
-        return NULL;
-
-    acc = SWIG_MustGetPtr(val, account_type, 1, 0);
-
-    /* Get the value */
-    val = SCM_CDR (valuearg);
-    value = gnc_scm_to_numeric (val);
-
-    /* Build and return the object */
-    res = g_new0 (GncAccountValue, 1);
-    res->account = acc;
-    res->value = value;
-    return res;
-}
-
-SCM gnc_account_value_ptr_to_scm (GncAccountValue *av)
-{
-    swig_type_info * account_type = get_acct_type();
-    gnc_commodity * com;
-    gnc_numeric val;
-
-    if (!av) return SCM_BOOL_F;
-
-    com = xaccAccountGetCommodity (av->account);
-    val = gnc_numeric_convert (av->value, gnc_commodity_get_fraction (com),
-                               GNC_HOW_RND_ROUND_HALF_UP);
-
-    return scm_cons (SWIG_NewPointerObj(av->account, account_type, 0),
-                     gnc_numeric_to_scm (val));
-}
diff --git a/libgnucash/engine/gncBusGuile.h b/libgnucash/engine/gncBusGuile.h
deleted file mode 100644
index 8f2053524..000000000
--- a/libgnucash/engine/gncBusGuile.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * gncBusGuile.h -- Business Guile Helper Functions
- * Copyright (C) 2003 Derek Atkins
- * Author: Derek Atkins <warlord at MIT.EDU>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, contact:
- *
- * Free Software Foundation           Voice:  +1-617-542-5942
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652
- * Boston, MA  02110-1301,  USA       gnu at gnu.org
- */
-
-#ifndef GNC_BUSINESS_GUILE_H_
-#define GNC_BUSINESS_GUILE_H_
-
-#include <gncTaxTable.h>	/* for GncAccountValue */
-#include <libguile.h>
-
-GncAccountValue * gnc_scm_to_account_value_ptr (SCM valuearg);
-SCM gnc_account_value_ptr_to_scm (GncAccountValue *);
-
-#endif /* GNC_BUSINESS_GUILE_H_ */
diff --git a/libgnucash/engine/gncmod-engine.c b/libgnucash/engine/gncmod-engine.c
index 54813e2ad..d7edaacb3 100644
--- a/libgnucash/engine/gncmod-engine.c
+++ b/libgnucash/engine/gncmod-engine.c
@@ -27,7 +27,6 @@
 
 #include <config.h>
 #include <gmodule.h>
-#include <libguile.h>
 
 #include "gnc-engine.h"
 #include "gnc-module-api.h"
@@ -55,8 +54,6 @@ libgncmod_engine_gnc_module_description(void)
     return g_strdup("The GnuCash accounting engine");
 }
 
-extern SCM scm_init_sw_engine_module(void);
-
 int
 libgncmod_engine_gnc_module_init(int refcount)
 {
@@ -66,11 +63,6 @@ libgncmod_engine_gnc_module_init(int refcount)
         gnc_engine_init(0, NULL);
     }
 
-    scm_init_sw_engine_module();
-    scm_c_eval_string("(use-modules (sw_engine))");
-    scm_c_eval_string("(use-modules (gnucash engine))");
-    scm_c_eval_string("(use-modules (gnucash business-core))");
-
     return TRUE;
 }
 
diff --git a/libgnucash/engine/test/CMakeLists.txt b/libgnucash/engine/test/CMakeLists.txt
index 56c3843f7..a9445c348 100644
--- a/libgnucash/engine/test/CMakeLists.txt
+++ b/libgnucash/engine/test/CMakeLists.txt
@@ -6,10 +6,11 @@ set(ENGINE_TEST_INCLUDE_DIRS
   ${CMAKE_SOURCE_DIR}/libgnucash/engine/test-core
   ${CMAKE_BINARY_DIR}/common # for config.h
   ${CMAKE_SOURCE_DIR}/common/test-core  # for unittest-support.h
+  ${CMAKE_SOURCE_DIR}/bindings/guile # for engine-helpers-guile.h
   ${GLIB2_INCLUDE_DIRS}
 )
 
-set(ENGINE_TEST_LIBS gncmod-engine gncmod-test-engine test-core ${LIBXML2_LDFLAGS} -lm)
+set(ENGINE_TEST_LIBS gncmod-engine gncmod-test-engine test-core gnucash-guile ${LIBXML2_LDFLAGS} -lm)
 
 macro(add_engine_test _TARGET _SOURCE_FILES)
   gnc_add_test(${_TARGET} "${_SOURCE_FILES}" ENGINE_TEST_INCLUDE_DIRS ENGINE_TEST_LIBS)
@@ -214,7 +215,7 @@ set(engine_test_SCHEME
 
 #list(APPEND engine_test_SCHEME  test-scm-query-import.scm) Fails
 
-set(GUILE_DEPENDS      scm-gnc-module scm-app-utils scm-scm scm-engine)
+set(GUILE_DEPENDS      scm-gnc-module scm-app-utils scm-engine)
 
 gnc_add_scheme_test_targets(scm-test-engine-extras
   "test-engine-extras.scm"
diff --git a/libgnucash/engine/test/test-business-core.scm b/libgnucash/engine/test/test-business-core.scm
index c597ccc0d..f48863dc8 100644
--- a/libgnucash/engine/test/test-business-core.scm
+++ b/libgnucash/engine/test/test-business-core.scm
@@ -1,12 +1,12 @@
 (use-modules (srfi srfi-1))
 (use-modules (srfi srfi-64))
 (use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/engine" 0)
 (gnc:module-load "gnucash/app-utils" 0)
 (use-modules (tests srfi64-extras))
 (use-modules (tests test-engine-extras))
 (use-modules (gnucash utilities))
 (use-modules (gnucash business-core))
+(use-modules (gnucash engine))
 
 (define (run-test)
   (test-runner-factory gnc:test-runner)
diff --git a/libgnucash/engine/test/test-create-account.scm b/libgnucash/engine/test/test-create-account.scm
index 3007a1aba..d816d2bc4 100644
--- a/libgnucash/engine/test/test-create-account.scm
+++ b/libgnucash/engine/test/test-create-account.scm
@@ -21,11 +21,11 @@
 
 
 (use-modules (gnucash gnc-module))
+(use-modules (gnucash engine))
 
 (define (run-test)
   (setenv "GNC_UNINSTALLED" "1")
   (gnc:module-system-init)
-  (gnc:module-load "gnucash/engine" 0)
 
   (let* ((session (qof-session-new))
          (book (qof-session-get-book session))
diff --git a/libgnucash/engine/test/test-scm-query-import.scm b/libgnucash/engine/test/test-scm-query-import.scm
index 2e31a9028..9f30797a3 100644
--- a/libgnucash/engine/test/test-scm-query-import.scm
+++ b/libgnucash/engine/test/test-scm-query-import.scm
@@ -21,11 +21,11 @@
 
 
 (use-modules (gnucash gnc-module))
+(use-modules (gnucash engine))
 
 (define (run-test)
   (setenv "GNC_UNINSTALLED" "1")
   (gnc:module-system-init)
-  (gnc:module-load "gnucash/engine" 0)
 
   (display "\tTesting the Query Import interface... \n")
   (display "\tYou may see \"Error: xaccQueryAddGUIDMatch: Invalid match type\".\n")
diff --git a/libgnucash/tax/de_DE/tax.scm b/libgnucash/tax/de_DE/tax.scm
index 34d20dac0..8f2129b75 100644
--- a/libgnucash/tax/de_DE/tax.scm
+++ b/libgnucash/tax/de_DE/tax.scm
@@ -19,13 +19,11 @@
 
 (define-module (gnucash locale de_DE tax))
 
-(use-modules (gnucash gnc-module))
 (eval-when
       (compile load eval expand)
-      (load-extension "libgncmod-engine" "scm_init_sw_engine_module")
       (load-extension "libgncmod-app-utils" "scm_init_sw_app_utils_module"))
+(use-modules (gnucash engine))
 (use-modules (sw_app_utils))
-(use-modules (sw_engine))
 (use-modules (gnucash app-utils))
 
 (export gnc:txf-get-payer-name-source)
diff --git a/libgnucash/tax/us/txf.scm b/libgnucash/tax/us/txf.scm
index ef551bea3..c08866132 100644
--- a/libgnucash/tax/us/txf.scm
+++ b/libgnucash/tax/us/txf.scm
@@ -40,6 +40,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 
+(use-modules (gnucash engine))
 (use-modules (gnucash app-utils))
 (use-modules (srfi srfi-2))
 
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 821163604..5a22d255e 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,8 +1,16 @@
 # This is a list of files which contain translatable strings.
 # This file was autogenerated by cmake.
+bindings/guile/business-core.scm
+bindings/guile/commodity-table.scm
 bindings/guile/core-utils.scm
+bindings/guile/engine-helpers-guile.c
+bindings/guile/engine.scm
+bindings/guile/engine-utilities.scm
+bindings/guile/glib-helpers.c
 bindings/guile/gnc-guile-bindings.c
 bindings/guile/gnc-guile-utils.c
+bindings/guile/gnc-numeric.scm
+bindings/guile/kvp-scm.cpp
 bindings/guile/price-quotes.scm
 bindings/guile/utilities.scm
 borrowed/goffice/go-charmap-sel.c
@@ -616,21 +624,14 @@ libgnucash/core-utils/gnc-prefs.c
 libgnucash/core-utils/gnc-version.c
 libgnucash/doc/doxygen_main_page.c
 libgnucash/engine/Account.cpp
-libgnucash/engine/business-core.scm
 libgnucash/engine/cap-gains.c
 libgnucash/engine/cashobjects.c
-libgnucash/engine/commodity-table.scm
 libgnucash/engine/engine-deprecated.c
 libgnucash/engine/engine-helpers.c
-libgnucash/engine/engine-interface.scm
-libgnucash/engine/engine.scm
-libgnucash/engine/engine-utilities.scm
-libgnucash/engine/glib-helpers.c
 libgnucash/engine/gncAddress.c
 libgnucash/engine/gnc-aqbanking-templates.cpp
 libgnucash/engine/gncBillTerm.c
 libgnucash/engine/gnc-budget.c
-libgnucash/engine/gncBusGuile.c
 libgnucash/engine/gncBusiness.c
 libgnucash/engine/gnc-commodity.c
 libgnucash/engine/gncCustomer.c
@@ -642,7 +643,6 @@ libgnucash/engine/gncEntry.c
 libgnucash/engine/gnc-event.c
 libgnucash/engine/gnc-features.c
 libgnucash/engine/gnc-hooks.c
-libgnucash/engine/gnc-hooks-scm.c
 libgnucash/engine/gncIDSearch.c
 libgnucash/engine/gnc-int128.cpp
 libgnucash/engine/gncInvoice.c
@@ -650,7 +650,6 @@ libgnucash/engine/gncJob.c
 libgnucash/engine/gnc-lot.c
 libgnucash/engine/gncmod-engine.c
 libgnucash/engine/gnc-numeric.cpp
-libgnucash/engine/gnc-numeric.scm
 libgnucash/engine/gncOrder.c
 libgnucash/engine/gncOwner.c
 libgnucash/engine/gnc-pricedb.c
@@ -662,7 +661,6 @@ libgnucash/engine/gnc-uri-utils.c
 libgnucash/engine/gncVendor.c
 libgnucash/engine/guid.cpp
 libgnucash/engine/kvp-frame.cpp
-libgnucash/engine/kvp-scm.cpp
 libgnucash/engine/kvp-value.cpp
 libgnucash/engine/policy.c
 libgnucash/engine/qof-backend.cpp

commit b1ba16c33bcaaa9c5fbfc9a1e33af786c61baf87
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Fri Oct 4 21:57:30 2019 +0200

    gnc-hooks - factor out scm calls into a separate source file
    
    This required the addition of an extra parameter to gnc_hook_add_dangler
    to allow the scm hooks to unprotect the scm data on hook destruction.

diff --git a/gnucash/gnome-utils/gnc-main-window.c b/gnucash/gnome-utils/gnc-main-window.c
index 730a3fbd4..935c4dd7d 100644
--- a/gnucash/gnome-utils/gnc-main-window.c
+++ b/gnucash/gnome-utils/gnc-main-window.c
@@ -2542,9 +2542,9 @@ gnc_main_window_class_init (GncMainWindowClass *klass)
                            NULL);
 
     gnc_hook_add_dangler(HOOK_BOOK_SAVED,
-                         (GFunc)gnc_main_window_update_all_titles, NULL);
+                         (GFunc)gnc_main_window_update_all_titles, NULL, NULL);
     gnc_hook_add_dangler(HOOK_BOOK_OPENED,
-                         (GFunc)gnc_main_window_attach_to_book, NULL);
+                         (GFunc)gnc_main_window_attach_to_book, NULL, NULL);
 
 }
 
diff --git a/gnucash/gnome-utils/gnc-plugin-manager.c b/gnucash/gnome-utils/gnc-plugin-manager.c
index 9d8406753..b33730345 100644
--- a/gnucash/gnome-utils/gnc-plugin-manager.c
+++ b/gnucash/gnome-utils/gnc-plugin-manager.c
@@ -67,7 +67,7 @@ gnc_plugin_manager_get (void)
         singleton = g_object_new (GNC_TYPE_PLUGIN_MANAGER,
                                   NULL);
         gnc_hook_add_dangler (HOOK_SHUTDOWN,
-                              gnc_plugin_manager_shutdown, NULL);
+                              gnc_plugin_manager_shutdown, NULL, NULL);
     }
 
     return singleton;
diff --git a/gnucash/gnome-utils/gnc-tree-view-account.c b/gnucash/gnome-utils/gnc-tree-view-account.c
index d4d82756c..848b800f1 100644
--- a/gnucash/gnome-utils/gnc-tree-view-account.c
+++ b/gnucash/gnome-utils/gnc-tree-view-account.c
@@ -138,7 +138,7 @@ gnc_tree_view_account_class_init (GncTreeViewAccountClass *klass)
     o_class->finalize = gnc_tree_view_account_finalize;
 
     gnc_hook_add_dangler(HOOK_CURRENCY_CHANGED,
-                         (GFunc)gtva_currency_changed_cb, NULL);
+                         (GFunc)gtva_currency_changed_cb, NULL, NULL);
 }
 
 /********************************************************************\
diff --git a/gnucash/gnome-utils/gnc-tree-view-owner.c b/gnucash/gnome-utils/gnc-tree-view-owner.c
index ced2bf90d..c018b0d0f 100644
--- a/gnucash/gnome-utils/gnc-tree-view-owner.c
+++ b/gnucash/gnome-utils/gnc-tree-view-owner.c
@@ -110,7 +110,7 @@ gnc_tree_view_owner_class_init (GncTreeViewOwnerClass *klass)
     o_class->finalize = gnc_tree_view_owner_finalize;
 
     gnc_hook_add_dangler(HOOK_CURRENCY_CHANGED,
-                         (GFunc)gtvo_currency_changed_cb, NULL);
+                         (GFunc)gtvo_currency_changed_cb, NULL, NULL);
 }
 
 /********************************************************************\
diff --git a/gnucash/gnome/assistant-hierarchy.c b/gnucash/gnome/assistant-hierarchy.c
index 9f9733452..89922cf07 100644
--- a/gnucash/gnome/assistant-hierarchy.c
+++ b/gnucash/gnome/assistant-hierarchy.c
@@ -1366,5 +1366,5 @@ void
 gnc_ui_hierarchy_assistant_initialize (void)
 {
     gnc_hook_add_dangler(HOOK_NEW_BOOK,
-                         (GFunc)gnc_ui_hierarchy_assistant_hook, NULL);
+                         (GFunc)gnc_ui_hierarchy_assistant_hook, NULL, NULL);
 }
diff --git a/gnucash/gnome/dialog-sx-editor.c b/gnucash/gnome/dialog-sx-editor.c
index 1b1d423c7..9eb60157f 100644
--- a/gnucash/gnome/dialog-sx-editor.c
+++ b/gnucash/gnome/dialog-sx-editor.c
@@ -1822,7 +1822,7 @@ gnc_ui_sx_initialize (void)
     _sx_engine_event_handler_id = qof_event_register_handler(_sx_engine_event_handler, NULL);
 
     gnc_hook_add_dangler(HOOK_BOOK_OPENED,
-                         (GFunc)gnc_sx_sxsincelast_book_opened, NULL);
+                         (GFunc)gnc_sx_sxsincelast_book_opened, NULL, NULL);
 
     /* Add page to preferences page for Scheduled Transactions */
     /* The parameters are; glade file, items to add from glade file - last being the dialog, preference tab name */
diff --git a/gnucash/gnome/dialog-sx-editor2.c b/gnucash/gnome/dialog-sx-editor2.c
index 925859818..dbe01a9f4 100644
--- a/gnucash/gnome/dialog-sx-editor2.c
+++ b/gnucash/gnome/dialog-sx-editor2.c
@@ -1771,7 +1771,7 @@ gnc_ui_sx_initialize2 (void) //FIXME need to remove the 2 when live
     _sx_engine_event_handler_id = qof_event_register_handler (_sx_engine_event_handler, NULL);
 
     gnc_hook_add_dangler (HOOK_BOOK_OPENED,
-                         (GFunc)gnc_sx_sxsincelast_book_opened, NULL);
+                          (GFunc)gnc_sx_sxsincelast_book_opened, NULL, NULL);
 
     /* Add page to preferences page for Scheduled Transactions */
     /* The parameters are; glade file, items to add from glade file - last being the dialog, preference tab name */
diff --git a/gnucash/gnome/top-level.c b/gnucash/gnome/top-level.c
index 6d6ee938e..069c83db9 100644
--- a/gnucash/gnome/top-level.c
+++ b/gnucash/gnome/top-level.c
@@ -411,15 +411,15 @@ gnc_main_gui_init (void)
     gnc_hook_run(HOOK_UI_STARTUP, NULL);
 
     gnc_hook_add_dangler(HOOK_BOOK_OPENED,
-                         gnc_restore_all_state, NULL);
+                         gnc_restore_all_state, NULL, NULL);
     gnc_hook_add_dangler(HOOK_BOOK_CLOSED,
-                         gnc_save_all_state, NULL);
+                         gnc_save_all_state, NULL, NULL);
     gnc_hook_add_dangler(HOOK_BOOK_CLOSED,
-                         (GFunc)gnc_reports_flush_global, NULL);
+                         (GFunc)gnc_reports_flush_global, NULL, NULL);
     gnc_hook_add_dangler(HOOK_BOOK_OPENED,
-                         (GFunc)gnc_invoice_remind_bills_due_cb, NULL);
+                         (GFunc)gnc_invoice_remind_bills_due_cb, NULL, NULL);
     gnc_hook_add_dangler(HOOK_BOOK_OPENED,
-                         (GFunc)gnc_invoice_remind_invoices_due_cb, NULL);
+                         (GFunc)gnc_invoice_remind_invoices_due_cb, NULL, NULL);
 
     gnc_ui_sx_initialize();
 
diff --git a/gnucash/gnucash-bin.c b/gnucash/gnucash-bin.c
index fcb79c425..8e687e90c 100644
--- a/gnucash/gnucash-bin.c
+++ b/gnucash/gnucash-bin.c
@@ -636,7 +636,7 @@ inner_main (void *closure, int argc, char **argv)
        before booting guile.  */
     gnc_main_gui_init();
 
-    gnc_hook_add_dangler(HOOK_UI_SHUTDOWN, (GFunc)gnc_file_quit, NULL);
+    gnc_hook_add_dangler(HOOK_UI_SHUTDOWN, (GFunc)gnc_file_quit, NULL, NULL);
 
     /* Install Price Quote Sources */
     gnc_update_splash_screen(_("Checking Finance::Quote..."), GNC_SPLASH_PERCENTAGE_UNKNOWN);
diff --git a/gnucash/report/html-style-sheet.scm b/gnucash/report/html-style-sheet.scm
index d3aa5e46b..cab11af6e 100644
--- a/gnucash/report/html-style-sheet.scm
+++ b/gnucash/report/html-style-sheet.scm
@@ -122,7 +122,7 @@
 (define gnc:current-saved-stylesheets
   (gnc-build-userdata-path "stylesheets-2.0"))
 
-(define (gnc:save-style-sheet-options) 
+(define (gnc:save-style-sheet-options)
   (let ((port (false-if-exception
                (open gnc:current-saved-stylesheets
                      (logior O_WRONLY O_CREAT O_TRUNC)))))
diff --git a/libgnucash/app-utils/gncmod-app-utils.c b/libgnucash/app-utils/gncmod-app-utils.c
index f30e687ee..12dcc6896 100644
--- a/libgnucash/app-utils/gncmod-app-utils.c
+++ b/libgnucash/app-utils/gncmod-app-utils.c
@@ -95,8 +95,8 @@ libgncmod_app_utils_gnc_module_init(int refcount)
     if (refcount == 0)
     {
         gnc_component_manager_init ();
-        gnc_hook_add_dangler(HOOK_STARTUP, (GFunc)gnc_exp_parser_init, NULL);
-        gnc_hook_add_dangler(HOOK_SHUTDOWN, (GFunc)app_utils_shutdown, NULL);
+        gnc_hook_add_dangler(HOOK_STARTUP, (GFunc)gnc_exp_parser_init, NULL, NULL);
+        gnc_hook_add_dangler(HOOK_SHUTDOWN, (GFunc)app_utils_shutdown, NULL, NULL);
     }
 
     return TRUE;
diff --git a/libgnucash/engine/CMakeLists.txt b/libgnucash/engine/CMakeLists.txt
index 6c1a33a94..71e35fcad 100644
--- a/libgnucash/engine/CMakeLists.txt
+++ b/libgnucash/engine/CMakeLists.txt
@@ -160,6 +160,7 @@ set (engine_SOURCES
   gnc-event.c
   gnc-features.c
   gnc-hooks.c
+  gnc-hooks-scm.c
   gnc-int128.cpp
   gnc-lot.c
   gnc-numeric.cpp
diff --git a/libgnucash/engine/gnc-hooks-scm.c b/libgnucash/engine/gnc-hooks-scm.c
new file mode 100644
index 000000000..b4929b7aa
--- /dev/null
+++ b/libgnucash/engine/gnc-hooks-scm.c
@@ -0,0 +1,86 @@
+/*
+ * gnc-hooks-scm.c -- helpers for using Glib hook functions in guile
+ * Copyright (C) 2005 David Hampton <hampton at employees.org>
+ *                    Derek Atkins <derek at ihtfp.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, contact:
+ *
+ * Free Software Foundation           Voice:  +1-617-542-5942
+ * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652
+ * Boston, MA  02110-1301,  USA       gnu at gnu.org
+ */
+
+#include <config.h>
+
+#include <glib.h>
+#include <stdio.h>
+#include "gnc-hooks.h"
+#include "gnc-hooks-scm.h"
+#include "gnc-engine.h"
+#include <libguile.h>
+#include "swig-runtime.h"
+#include <guile-mappings.h>
+
+static QofLogModule log_module = GNC_MOD_ENGINE;
+
+typedef struct
+{
+    SCM proc;
+    int num_args;
+} GncScmDangler;
+
+
+static void
+delete_scm_hook (gpointer data)
+{
+    GncScmDangler *scm = data;
+    scm_gc_unprotect_object(scm->proc);
+    g_free(scm);
+}
+
+static void
+scm_hook_cb (gpointer data, GncScmDangler *scm)
+{
+    ENTER("data %p, cbarg %p", data, scm);
+
+    if (scm->num_args == 0)
+        scm_call_0 (scm->proc);
+    else
+    {
+        // XXX: FIXME: We really should make sure this is a session!!! */
+        scm_call_1 (scm->proc,
+            SWIG_NewPointerObj(data, SWIG_TypeQuery("_p_QofSession"), 0));
+    }
+
+    LEAVE("");
+}
+
+void
+gnc_hook_add_scm_dangler (const gchar *name, SCM proc)
+{
+    GHook *hook;
+    GncScmDangler *scm;
+    int num_args;
+
+    ENTER("list %s, proc ???", name);
+    num_args = gnc_hook_num_args(name);
+    g_return_if_fail(num_args >= 0);
+    scm = g_new0(GncScmDangler, 1);
+    scm_gc_protect_object(proc);
+    scm->proc = proc;
+    scm->num_args = num_args;
+    gnc_hook_add_dangler(name, (GFunc)scm_hook_cb,
+                         (GDestroyNotify) delete_scm_hook, scm);
+    LEAVE("");
+}
diff --git a/libgnucash/engine/gnc-hooks.c b/libgnucash/engine/gnc-hooks.c
index a30a2065a..3388e5e74 100644
--- a/libgnucash/engine/gnc-hooks.c
+++ b/libgnucash/engine/gnc-hooks.c
@@ -25,11 +25,7 @@
 
 #include <glib.h>
 #include <stdio.h>
-#include <libguile.h>
-#include "swig-runtime.h"
-#include <guile-mappings.h>
 #include "gnc-hooks.h"
-#include "gnc-hooks-scm.h"
 #include "gnc-engine.h"
 
 static QofLogModule log_module = GNC_MOD_ENGINE;
@@ -39,16 +35,11 @@ static gboolean gnc_hooks_initialized = FALSE;
 
 typedef struct
 {
-    gchar		*desc;
-    GHookList	*c_danglers;
-    GHookList	*scm_danglers;
-    gint           num_args;
+    gchar     *desc;
+    GHookList *danglers;
+    gint       num_args;
 } GncHook;
 
-typedef struct
-{
-    SCM		proc;
-} GncScmDangler;
 
 gchar *
 gnc_hook_create (const gchar *name, gint num_args, const gchar *desc)
@@ -78,11 +69,9 @@ gnc_hook_create (const gchar *name, gint num_args, const gchar *desc)
 
     hook_list = g_new0(GncHook, 1);
     hook_list->desc = g_strdup(desc);
-    hook_list->c_danglers = g_malloc(sizeof(GHookList));
-    g_hook_list_init(hook_list->c_danglers, sizeof(GHook));
-    hook_list->scm_danglers = g_malloc(sizeof(GHookList));
+    hook_list->danglers = g_malloc(sizeof(GHookList));
+    g_hook_list_init(hook_list->danglers, sizeof(GHook));
     hook_list->num_args = num_args;
-    g_hook_list_init(hook_list->scm_danglers, sizeof(GHook));
     g_hash_table_insert(gnc_hooks_list, (gchar *)name, hook_list);
 
     LEAVE("created list %s(%p)", name, hook_list);
@@ -106,8 +95,29 @@ gnc_hook_lookup (const gchar *name)
     return(hook);
 }
 
+int
+gnc_hook_num_args (const gchar *name)
+{
+    GncHook *hook;
+    int num_args = -1;
+
+    ENTER("name %s", name);
+    if (gnc_hooks_list == NULL)
+    {
+        PINFO("no hook lists");
+        gnc_hooks_init();
+    }
+
+    hook = g_hash_table_lookup(gnc_hooks_list, name);
+    if (hook)
+        num_args = hook->num_args;
+    LEAVE("hook list %p, num_args %i", hook, num_args);
+    return(num_args);
+}
+
 void
-gnc_hook_add_dangler (const gchar *name, GFunc callback, gpointer cb_arg)
+gnc_hook_add_dangler (const gchar *name, GFunc callback,
+                      GDestroyNotify destroy, gpointer cb_arg)
 {
     GncHook *gnc_hook;
     GHook *hook;
@@ -115,20 +125,14 @@ gnc_hook_add_dangler (const gchar *name, GFunc callback, gpointer cb_arg)
     ENTER("list %s, function %p, cbarg %p", name, callback, cb_arg);
     gnc_hook = gnc_hook_lookup(name);
     g_return_if_fail(gnc_hook != NULL);
-    hook = g_hook_alloc(gnc_hook->c_danglers);
+    hook = g_hook_alloc(gnc_hook->danglers);
     hook->func = callback;
     hook->data = cb_arg;
-    hook->destroy = NULL;
-    g_hook_append(gnc_hook->c_danglers, hook);
+    hook->destroy = destroy;
+    g_hook_append(gnc_hook->danglers, hook);
     LEAVE("");
 }
 
-static gboolean
-hook_remove_runner (GHook *hook, gpointer data)
-{
-    return(hook->func == data);
-}
-
 void
 gnc_hook_remove_dangler (const gchar *name, GFunc callback)
 {
@@ -143,74 +147,19 @@ gnc_hook_remove_dangler (const gchar *name, GFunc callback)
         return;
     }
 
-    hook = g_hook_find(gnc_hook->c_danglers, TRUE, hook_remove_runner, callback);
+    hook = g_hook_find_func(gnc_hook->danglers, TRUE, callback);
     if (hook == NULL)
     {
         LEAVE("Hook %p not found in %s", callback, name);
         return;
     }
 
-    g_hook_destroy_link(gnc_hook->c_danglers, hook);
+    g_hook_destroy_link(gnc_hook->danglers, hook);
     LEAVE("Removed %p from %s", hook, name);
 }
 
 static void
-delete_scm_hook (gpointer data)
-{
-    GncScmDangler *scm = data;
-    scm_gc_unprotect_object(scm->proc);
-    g_free(scm);
-}
-
-static void
-call_scm_hook (GHook *hook, gpointer data)
-{
-    GncScmDangler *scm = hook->data;
-
-    ENTER("hook %p, data %p, cbarg %p", hook, data, hook->data);
-
-    scm_call_0 (scm->proc);
-
-    LEAVE("");
-}
-
-static void
-call_scm_hook_1 (GHook *hook, gpointer data)
-{
-    GncScmDangler *scm = hook->data;
-
-    ENTER("hook %p, data %p, cbarg %p", hook, data, hook->data);
-
-    // XXX: FIXME: We really should make sure this is a session!!! */
-    scm_call_1 (scm->proc,
-                SWIG_NewPointerObj(data, SWIG_TypeQuery("_p_QofSession"), 0));
-
-    LEAVE("");
-}
-
-void
-gnc_hook_add_scm_dangler (const gchar *name, SCM proc)
-{
-    GncHook *gnc_hook;
-    GHook *hook;
-    GncScmDangler *scm;
-
-    ENTER("list %s, proc ???", name);
-    gnc_hook = gnc_hook_lookup(name);
-    g_return_if_fail(gnc_hook != NULL);
-    scm = g_new0(GncScmDangler, 1);
-    scm_gc_protect_object(proc);
-    scm->proc = proc;
-    hook = g_hook_alloc(gnc_hook->scm_danglers);
-    hook->func = call_scm_hook;
-    hook->data = scm;
-    hook->destroy = delete_scm_hook;
-    g_hook_append(gnc_hook->scm_danglers, hook);
-    LEAVE("");
-}
-
-static void
-call_c_hook (GHook *hook, gpointer data)
+call_hook (GHook *hook, gpointer data)
 {
     ENTER("hook %p (func %p), data %p, cbarg %p", hook, hook->func, data,
           hook->data);
@@ -230,11 +179,7 @@ gnc_hook_run (const gchar *name, gpointer data)
         LEAVE("No such hook list");
         return;
     }
-    g_hook_list_marshal(hook->c_danglers, TRUE, call_c_hook, data);
-    if (hook->num_args == 0)
-        g_hook_list_marshal(hook->scm_danglers, TRUE, call_scm_hook, data);
-    else
-        g_hook_list_marshal(hook->scm_danglers, TRUE, call_scm_hook_1, data);
+    g_hook_list_marshal(hook->danglers, TRUE, call_hook, data);
     LEAVE("");
 }
 
diff --git a/libgnucash/engine/gnc-hooks.h b/libgnucash/engine/gnc-hooks.h
index cd8edaafb..efbddd44a 100644
--- a/libgnucash/engine/gnc-hooks.h
+++ b/libgnucash/engine/gnc-hooks.h
@@ -36,9 +36,16 @@ gchar * gnc_hook_create(const gchar *name, gint num_args, const gchar *desc);
  * add and remove C-style dangers from a hook.  The callback is called
  *   function(hook_run_data, cb_data)
  */
-void gnc_hook_add_dangler(const gchar *name, GFunc callback, gpointer cb_data);
+void gnc_hook_add_dangler(const gchar *name, GFunc callback,
+                          GDestroyNotify destroy, gpointer cb_data);
 void gnc_hook_remove_dangler(const gchar *name, GFunc callback);
 
+/**
+ * helper function to retrieve the number of arguments
+ * a hook expects
+ */
+int gnc_hook_num_args (const gchar *name);
+
 /**
  * Run the hook danglers.
  */
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 48fae6f58..821163604 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -642,6 +642,7 @@ libgnucash/engine/gncEntry.c
 libgnucash/engine/gnc-event.c
 libgnucash/engine/gnc-features.c
 libgnucash/engine/gnc-hooks.c
+libgnucash/engine/gnc-hooks-scm.c
 libgnucash/engine/gncIDSearch.c
 libgnucash/engine/gnc-int128.cpp
 libgnucash/engine/gncInvoice.c

commit 49bf27fad57eb492416638ae357522bebe9d2ae1
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat Oct 5 16:01:44 2019 +0200

    core-utils - use one command to export all swig wrapped symbols via the (gnucash core-utils) module

diff --git a/bindings/guile/core-utils.scm b/bindings/guile/core-utils.scm
index 5feaf1420..82cb17c63 100644
--- a/bindings/guile/core-utils.scm
+++ b/bindings/guile/core-utils.scm
@@ -30,39 +30,10 @@
 (eval-when
       (compile load eval expand)
       (load-extension "libgnucash-guile" "gnc_guile_bindings_init"))
-
 (use-modules (sw_core_utils))
 
-(re-export gnc-path-get-bindir)
-(re-export gnc-path-get-scmdir)
-(re-export gnc-path-get-reportsdir)
-(re-export gnc-path-get-stdreportsdir)
-(re-export gnc-path-find-localized-html-file)
-(re-export gnc-build-userdata-path)
-(re-export gnc-build-scm-path)
-(re-export gnc-build-report-path)
-(re-export gnc-build-stdreports-path)
-(re-export gnc-build-reports-path)
-(re-export gnc-file-path-absolute)
-(re-export gnc-utf8?)
-(re-export gnc-utf8-strip-invalid-strdup)
-(re-export gnc-locale-from-utf8)
-(re-export gnc-locale-to-utf8)
-(re-export gnc-scm-log-warn)
-(re-export gnc-scm-log-error)
-(re-export gnc-scm-log-msg)
-(re-export gnc-scm-log-debug)
-(re-export gnc-locale-default-iso-currency-code)
-(re-export gnc-locale-name)
-
-(re-export gnc-prefs-set-bool)
-(re-export gnc-prefs-set-int)
-(re-export gnc-prefs-set-int64)
-(re-export gnc-prefs-set-float)
-(re-export gnc-prefs-set-string)
-(re-export gnc-prefs-set-coords)
-(re-export gnc-prefs-get-string)
-(re-export gnc-prefs-is-extra-enabled)
-(re-export gnc-prefs-is-debugging-enabled)
+; Export the swig-wrapped symbols in the public interface of this module
+(let ((i (module-public-interface (current-module))))
+     (module-use! i (resolve-interface '(sw_core_utils))))
 
 (define-public gnc:version (gnc-version))

commit a6b7eecd817657f0bb27242cfd9a610c506188bd
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Wed Oct 2 23:14:31 2019 +0200

    core-utils - make the swig generated source file dependent on the core-utils headers
    
    That should trigger a regeneration of these swig sources if
    any of the header files change.
    This is done via a small macro that can be reused for other wrappers as well.
    
    Note
    cmake 3.15 introduces a 'FILTER' generator expression
    that might allow us to do something like the following:
    $<FILTER:$<TARGET_PROPERTY:baselib,SOURCES>,INCLUDE,"*.h[pp]?$">
    I toyed briefly with that idea but it currently has two issues:
    1. 3.15 is newer than our current minimum cmake requirement, so we can't
       depend in that feature yet.
    2. the sources are relative to *their* source directory, which
       is different from the one in which the wrappers are generated
       So they should still be properly transformed into absolute paths

diff --git a/bindings/guile/CMakeLists.txt b/bindings/guile/CMakeLists.txt
index cf2b44ea6..e26876735 100644
--- a/bindings/guile/CMakeLists.txt
+++ b/bindings/guile/CMakeLists.txt
@@ -1,9 +1,12 @@
 add_subdirectory(test)
 
 # Command to generate the swig-core-utils-guile.c wrapper file
+gnc_swig_extract_header_files (gnc-core-utils CORE_UTILS_HEADERS)
 gnc_add_swig_guile_command (swig-core-utils-guile-c
     SWIG_CORE_UTILS_GUILE_C swig-core-utils-guile.c
-    ${CMAKE_SOURCE_DIR}/bindings/core-utils.i ${CMAKE_SOURCE_DIR}/libgnucash/core-utils
+    ${CMAKE_SOURCE_DIR}/bindings/core-utils.i
+    ${CMAKE_SOURCE_DIR}/libgnucash/core-utils
+    ${CORE_UTILS_HEADERS}
 )
 
 set(guile_HEADERS
diff --git a/bindings/python/CMakeLists.txt b/bindings/python/CMakeLists.txt
index 368c3c4f0..c25e78757 100644
--- a/bindings/python/CMakeLists.txt
+++ b/bindings/python/CMakeLists.txt
@@ -47,10 +47,12 @@ gnc_add_swig_python_command (swig-gnucash-core
 )
 
 # Command to generate the swig-core-utils-python.c wrapper file
+gnc_swig_extract_header_files (gnc-core-utils CORE_UTILS_HEADERS)
 gnc_add_swig_python_command (swig-core-utils-python
     SWIG_CORE_UTILS_PYTHON_C SWIG_CORE_UTILS_PYTHON_PY
     swig-core-utils-python.c sw_core_utils.py
     ${CMAKE_SOURCE_DIR}/bindings/core-utils.i ${CMAKE_SOURCE_DIR}/libgnucash/core-utils
+    ${CORE_UTILS_HEADERS}
 )
 
 if(WITH_PYTHON)
diff --git a/common/cmake_modules/GncAddSwigCommand.cmake b/common/cmake_modules/GncAddSwigCommand.cmake
index 75edd5233..336201488 100644
--- a/common/cmake_modules/GncAddSwigCommand.cmake
+++ b/common/cmake_modules/GncAddSwigCommand.cmake
@@ -90,3 +90,25 @@ macro (gnc_add_swig_python_command _target _out_var _py_out_var _output _py_outp
     )
     add_custom_target(${_target} ALL DEPENDS ${outfile} ${py_outfile} ${CMAKE_SOURCE_DIR}/common/base-typemaps.i ${_input} ${ARGN})
 endmacro()
+
+
+# The swig wrappers need to know the header files ("the interface")
+# for the library they are wrapping.
+# We can extract those from the target's SOURCES property
+# Using a few ordinary cmake commands
+macro (gnc_swig_extract_header_files _target _variable)
+    set(${_variable} "")
+    get_target_property(_headers ${_target} SOURCES)
+    if(_headers)
+        list(FILTER _headers INCLUDE REGEX ".*[.]h(pp)?$")
+        get_target_property(_srcdir ${_target} SOURCE_DIR)
+        foreach (_header  ${_headers})
+            if(NOT IS_ABSOLUTE "${_header}")
+                set(_header_abs "${_srcdir}/${_header}")
+            else()
+                set(_header_abs "${_header}")
+            endif()
+            list (APPEND ${_variable} "${_header_abs}")
+        endforeach ()
+    endif()
+endmacro()

commit a1898daf6cb7e4e60dd2e8ac05cd9b4b886f32a0
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Wed Oct 2 21:39:50 2019 +0200

    core-utils - move python wrapper code to bindings/python
    
    This makes libgnucash/core-utils completely guile and python free.

diff --git a/bindings/python/CMakeLists.txt b/bindings/python/CMakeLists.txt
index 324255bdf..368c3c4f0 100644
--- a/bindings/python/CMakeLists.txt
+++ b/bindings/python/CMakeLists.txt
@@ -46,8 +46,17 @@ gnc_add_swig_python_command (swig-gnucash-core
     ${GNUCASH_CORE_C_INCLUDES}
 )
 
+# Command to generate the swig-core-utils-python.c wrapper file
+gnc_add_swig_python_command (swig-core-utils-python
+    SWIG_CORE_UTILS_PYTHON_C SWIG_CORE_UTILS_PYTHON_PY
+    swig-core-utils-python.c sw_core_utils.py
+    ${CMAKE_SOURCE_DIR}/bindings/core-utils.i ${CMAKE_SOURCE_DIR}/libgnucash/core-utils
+)
+
 if(WITH_PYTHON)
 
+  ### gnucash_core_c
+
   set(gnucash_core_c_INCLUDE_DIRS
     ${CMAKE_SOURCE_DIR}/libgnucash
     ${CMAKE_SOURCE_DIR}/libgnucash/engine
@@ -100,6 +109,41 @@ if(WITH_PYTHON)
     COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR_BUILD}/gnucash/_gnucash_core_c${CMAKE_SHARED_MODULE_SUFFIX} ${PYTHON_SYSCONFIG_BUILD}/gnucash
     DEPENDS gnucash_core_c)
 
+
+  ### sw_core_utils
+
+  add_library (sw_core_utils MODULE ${SWIG_CORE_UTILS_PYTHON_C})
+
+  target_link_libraries(sw_core_utils gnc-core-utils ${PYTHON_LIBRARIES})
+  set_target_properties(sw_core_utils PROPERTIES PREFIX "_")
+
+  if (HAVE_STRINGOP_TRUNCATION)
+    target_compile_options(sw_core_utils PRIVATE -Wno-error=stringop-truncation)
+  endif()
+
+  target_include_directories (sw_core_utils
+    PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
+    PRIVATE ${PYTHON_INCLUDE_DIRS}
+  )
+  target_compile_definitions (sw_core_utils PRIVATE -DG_LOG_DOMAIN=\"gnc.core-utils\")
+
+  if (APPLE)
+    set_target_properties (sw_core_utils PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/gnucash")
+  endif()
+
+  install(TARGETS sw_core_utils
+    LIBRARY DESTINATION ${PYTHON_SYSCONFIG_OUTPUT}/gnucash
+    ARCHIVE DESTINATION ${PYTHON_SYSCONFIG_OUTPUT}/gnucash
+  )
+
+  add_custom_target(sw-core-utils-py ALL
+    COMMAND ${CMAKE_COMMAND} -E copy ${SWIG_CORE_UTILS_PYTHON_PY} ${PYTHON_SYSCONFIG_BUILD}/gnucash
+    DEPENDS ${SWIG_CORE_UTILS_PYTHON_C})
+
+  add_custom_target(sw-core-utils-build ALL
+    COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR_BUILD}/gnucash/_sw_core_utils${CMAKE_SHARED_MODULE_SUFFIX} ${PYTHON_SYSCONFIG_BUILD}/gnucash
+    DEPENDS sw_core_utils)
+
 endif()
 
 set(python_bindings_DATA ${PYEXEC_FILES}
diff --git a/libgnucash/core-utils/CMakeLists.txt b/libgnucash/core-utils/CMakeLists.txt
index 039a46cf9..7461b0729 100644
--- a/libgnucash/core-utils/CMakeLists.txt
+++ b/libgnucash/core-utils/CMakeLists.txt
@@ -118,48 +118,6 @@ else(BUILDING_FROM_VCS)
 endif(BUILDING_FROM_VCS)
 dist_add_generated (${BUILDING_FROM_VCS} gnc-vcs-info.h)
 
-# Command to generate the swig-core-utils-python.c wrapper file
-gnc_add_swig_python_command (swig-core-utils-python
-    SWIG_CORE_UTILS_PYTHON_C SWIG_CORE_UTILS_PYTHON_PY
-    swig-core-utils-python.c sw_core_utils.py
-    ${CMAKE_SOURCE_DIR}/bindings/core-utils.i ${CMAKE_CURRENT_SOURCE_DIR}
-)
-
-if (WITH_PYTHON)
-  add_library (sw_core_utils MODULE ${SWIG_CORE_UTILS_PYTHON_C})
-
-  target_link_libraries(sw_core_utils gnc-core-utils ${PYTHON_LIBRARIES})
-  set_target_properties(sw_core_utils PROPERTIES PREFIX "_")
-
-  if (HAVE_STRINGOP_TRUNCATION)
-    target_compile_options(sw_core_utils PRIVATE -Wno-error=stringop-truncation)
-  endif()
-
-  target_include_directories (sw_core_utils
-    PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
-    PRIVATE ${PYTHON_INCLUDE_DIRS}
-  )
-  target_compile_definitions (sw_core_utils PRIVATE -DG_LOG_DOMAIN=\"gnc.core-utils\")
-
-  if (APPLE)
-    set_target_properties (sw_core_utils PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/gnucash")
-  endif()
-
-  install(TARGETS sw_core_utils
-    LIBRARY DESTINATION ${PYTHON_SYSCONFIG_OUTPUT}/gnucash
-    ARCHIVE DESTINATION ${PYTHON_SYSCONFIG_OUTPUT}/gnucash
-  )
-
-  add_custom_target(sw-core-utils-py ALL
-    COMMAND ${CMAKE_COMMAND} -E copy ${SWIG_CORE_UTILS_PYTHON_PY} ${PYTHON_SYSCONFIG_BUILD}/gnucash
-    DEPENDS ${SWIG_CORE_UTILS_PYTHON_C})
-
-  add_custom_target(sw-core-utils-build ALL
-    COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR_BUILD}/gnucash/_sw_core_utils${CMAKE_SHARED_MODULE_SUFFIX} ${PYTHON_SYSCONFIG_BUILD}/gnucash
-    DEPENDS sw_core_utils)
-
-endif()
-
 # Dist files
 set_local_dist(core_utils_DIST_local
     ${core_utils_SOURCES}

commit ad8c3882357125de3da9a445983cdd850ec74b8a
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Wed Oct 2 12:31:44 2019 +0200

    core-utils - rework link_libraries and include_directories propagation
    
    By properly marking certain parameters as private or public
    we can have cmake work out most of the link_libraries and
    include_directoris for other targets dependent on core-utils

diff --git a/bindings/guile/CMakeLists.txt b/bindings/guile/CMakeLists.txt
index 9c0159a8f..cf2b44ea6 100644
--- a/bindings/guile/CMakeLists.txt
+++ b/bindings/guile/CMakeLists.txt
@@ -22,23 +22,20 @@ add_dependencies(gnucash-guile
     swig-runtime-h)
 
 target_include_directories(gnucash-guile
-    PRIVATE
-        ${CMAKE_SOURCE_DIR}/common
-        ${CMAKE_BINARY_DIR}/common
-        ${CMAKE_SOURCE_DIR}/libgnucash/core-utils
-        ${CMAKE_BINARY_DIR}/libgnucash/core-utils # For gnc-version-info.h
-        ${GLIB2_INCLUDE_DIRS}
-        ${GTK_MAC_INCLUDE_DIRS}
     PUBLIC
         ${CMAKE_CURRENT_SOURCE_DIR}
-        ${GUILE_INCLUDE_DIRS})
+        ${GUILE_INCLUDE_DIRS}
+        ${GLIB2_INCLUDE_DIRS}
+    PRIVATE
+        ${CMAKE_SOURCE_DIR}/common
+        ${CMAKE_BINARY_DIR}/common)
 
 target_link_libraries(gnucash-guile
-    gnc-core-utils
-    ${GUILE_LDFLAGS}
-    ${GLIB2_LDFLAGS}
-    ${GOBJECT_LDFLAGS}
-    ${GTK_MAC_LDFLAGS})
+    PUBLIC
+        ${GUILE_LDFLAGS}
+    PRIVATE
+        gnc-core-utils
+        ${GLIB2_LDFLAGS})
 
 install(TARGETS gnucash-guile
     LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
diff --git a/gnucash/gnome/CMakeLists.txt b/gnucash/gnome/CMakeLists.txt
index 9e55dc48c..4df8422bd 100644
--- a/gnucash/gnome/CMakeLists.txt
+++ b/gnucash/gnome/CMakeLists.txt
@@ -146,6 +146,7 @@ target_link_libraries(gnc-gnome
     gncmod-gnome-utils
     gncmod-engine
     gnucash-guile
+    ${Boost_LIBRARIES}
     PkgConfig::GTK3
     ${GTK_MAC_LDFLAGS})
 
diff --git a/libgnucash/core-utils/CMakeLists.txt b/libgnucash/core-utils/CMakeLists.txt
index e303cfc00..039a46cf9 100644
--- a/libgnucash/core-utils/CMakeLists.txt
+++ b/libgnucash/core-utils/CMakeLists.txt
@@ -47,14 +47,16 @@ target_include_directories(gnc-core-utils
         ${CMAKE_CURRENT_BINARY_DIR}
         ${CMAKE_CURRENT_SOURCE_DIR}
         ${GLIB2_INCLUDE_DIRS}
+    PRIVATE
         ${GTK_MAC_INCLUDE_DIRS})
 
 target_link_libraries(gnc-core-utils
-    ${Boost_LIBRARIES}
-    ${GLIB2_LDFLAGS}
-    ${GOBJECT_LDFLAGS}
-    ${GTK_MAC_LDFLAGS}
-    "$<$<BOOL:${MAC_INTEGRATION}>:${OSX_EXTRA_LIBRARIES}>")
+    PRIVATE
+        ${Boost_LIBRARIES}
+        ${GLIB2_LDFLAGS}
+        ${GOBJECT_LDFLAGS}
+        ${GTK_MAC_LDFLAGS}
+        "$<$<BOOL:${MAC_INTEGRATION}>:${OSX_EXTRA_LIBRARIES}>")
 
 target_compile_definitions(gnc-core-utils
     PRIVATE

commit 36c19b4085a240d047048a7fc6e2f49a0db3dbfe
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Oct 1 14:42:48 2019 +0200

    core-utils - regroup build rules per target
    
    - first all rules and variables for libgnc-core-utils
    - then the rules to generate additional files (like
      gncla-dir.h or gnc-vcs-info.h)
    - next rules for the python bindings
    - finally rules for the dist targets
    
    Note this commit also eliminates variable
    core_utils_ALL_SOURCES, replacing its two
    uses directly with its value.

diff --git a/libgnucash/core-utils/CMakeLists.txt b/libgnucash/core-utils/CMakeLists.txt
index abbe95b48..e303cfc00 100644
--- a/libgnucash/core-utils/CMakeLists.txt
+++ b/libgnucash/core-utils/CMakeLists.txt
@@ -2,13 +2,8 @@
 
 add_subdirectory(test)
 
-# Command to generate the swig-core-utils-python.c wrapper file
-gnc_add_swig_python_command (swig-core-utils-python
-    SWIG_CORE_UTILS_PYTHON_C SWIG_CORE_UTILS_PYTHON_PY
-    swig-core-utils-python.c sw_core_utils.py
-    ${CMAKE_SOURCE_DIR}/bindings/core-utils.i ${CMAKE_CURRENT_SOURCE_DIR}
-)
 
+### libgnc-core-utils
 set (core_utils_SOURCES
   binreloc.c
   gnc-prefs.c
@@ -26,51 +21,6 @@ set (core_utils_SOURCES
 # Add dependency on config.h
 set_source_files_properties (${core_utils_SOURCES} PROPERTIES OBJECT_DEPENDS ${CONFIG_H})
 
-set(prefix ${CMAKE_INSTALL_PREFIX})
-set(datadir ${CMAKE_INSTALL_FULL_DATADIR})
-set(bindir ${CMAKE_INSTALL_FULL_BINDIR})
-set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
-set(sysconfdir ${CMAKE_INSTALL_FULL_SYSCONFDIR})
-set(localedir "${CMAKE_INSTALL_FULL_DATAROOTDIR}/locale")
-configure_file(gncla-dir.h.in gncla-dir.h)
-
-
-
-# ---
-if (BUILDING_FROM_VCS)
-  set(VCS_INFO_BASE_DIR ${CMAKE_BINARY_DIR})
-else()
-  set(VCS_INFO_BASE_DIR ${CMAKE_SOURCE_DIR})
-endif()
-set(VCS_INFO_FILE ${VCS_INFO_BASE_DIR}/libgnucash/core-utils/gnc-vcs-info.h CACHE STRING "path to gnc-vcs-info.h file")
-
-### Create gnc-vcs-info.h
-# This can only be done when building from a vcs (git/svn/bzr/svk) working directory.
-# This file is shipped in the distribution tarball, so no need to generate it in that case anyway.
-# The meta-cmake gymnastics here come from https://cmake.org/pipermail/cmake/2010-July/038015.html
-if (BUILDING_FROM_VCS)
-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gnc-vcs-info.h.in
-"/* Autogenerated. Do not change. */
-#define GNC_VCS_REV \"@GNC_VCS_REV@\"
-#define GNC_VCS_REV_DATE \"@GNC_VCS_REV_DATE@\"
-#define GNC_VCS_REV_YEAR \"@GNC_VCS_REV_YEAR@\"
-#define GNC_VCS_REV_Y_M \"@GNC_VCS_REV_Y_M@\"
-")
-
-add_custom_target(gnc-vcs-info ALL
-    BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/gnc-vcs-info.h
-    COMMAND ${CMAKE_COMMAND} -D SRC=${CMAKE_CURRENT_BINARY_DIR}/gnc-vcs-info.h.in
-                             -D DST=${CMAKE_CURRENT_BINARY_DIR}/gnc-vcs-info.h
-                             -D SRC_DIR=${CMAKE_SOURCE_DIR}
-                             -D SHELL="${SHELL}"
-                             -P ${CMAKE_SOURCE_DIR}/cmake/git2version-info.cmake
-)
-else(BUILDING_FROM_VCS)
-  add_custom_target(gnc-vcs-info DEPENDS ${VCS_INFO_FILE})
-endif(BUILDING_FROM_VCS)
-dist_add_generated (${BUILDING_FROM_VCS} gnc-vcs-info.h)
-### Compile library
-
 set(core_utils_noinst_HEADERS
   binreloc.h
   gnc-prefs.h
@@ -86,13 +36,8 @@ set(core_utils_noinst_HEADERS
   gnc-version.h
 )
 
-set(core_utils_ALL_SOURCES ${core_utils_SOURCES} ${core_utils_noinst_HEADERS})
-
-set_local_dist(core_utils_DIST_local ${core_utils_ALL_SOURCES} CMakeLists.txt gncla-dir.h.in)
-set(core_utils_DIST ${core_utils_DIST_local} ${test_core_utils_DIST} PARENT_SCOPE)
-
+add_library(gnc-core-utils ${core_utils_SOURCES} ${core_utils_noinst_HEADERS})
 
-add_library(gnc-core-utils ${core_utils_ALL_SOURCES})
 add_dependencies(gnc-core-utils gnc-vcs-info)
 
 target_include_directories(gnc-core-utils
@@ -127,6 +72,57 @@ install(TARGETS gnc-core-utils
   RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
 )
 
+
+### gncla-dir.h
+set(prefix ${CMAKE_INSTALL_PREFIX})
+set(datadir ${CMAKE_INSTALL_FULL_DATADIR})
+set(bindir ${CMAKE_INSTALL_FULL_BINDIR})
+set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
+set(sysconfdir ${CMAKE_INSTALL_FULL_SYSCONFDIR})
+set(localedir "${CMAKE_INSTALL_FULL_DATAROOTDIR}/locale")
+configure_file(gncla-dir.h.in gncla-dir.h)
+
+
+### Create gnc-vcs-info.h
+# This can only be done when building from a vcs (git/svn/bzr/svk) working directory.
+# This file is shipped in the distribution tarball, so no need to generate it in that case anyway.
+# The meta-cmake gymnastics here come from https://cmake.org/pipermail/cmake/2010-July/038015.html
+if (BUILDING_FROM_VCS)
+  set(VCS_INFO_BASE_DIR ${CMAKE_BINARY_DIR})
+else()
+  set(VCS_INFO_BASE_DIR ${CMAKE_SOURCE_DIR})
+endif()
+set(VCS_INFO_FILE ${VCS_INFO_BASE_DIR}/libgnucash/core-utils/gnc-vcs-info.h CACHE STRING "path to gnc-vcs-info.h file")
+
+if (BUILDING_FROM_VCS)
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gnc-vcs-info.h.in
+"/* Autogenerated. Do not change. */
+#define GNC_VCS_REV \"@GNC_VCS_REV@\"
+#define GNC_VCS_REV_DATE \"@GNC_VCS_REV_DATE@\"
+#define GNC_VCS_REV_YEAR \"@GNC_VCS_REV_YEAR@\"
+#define GNC_VCS_REV_Y_M \"@GNC_VCS_REV_Y_M@\"
+")
+
+add_custom_target(gnc-vcs-info ALL
+    BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/gnc-vcs-info.h
+    COMMAND ${CMAKE_COMMAND} -D SRC=${CMAKE_CURRENT_BINARY_DIR}/gnc-vcs-info.h.in
+                             -D DST=${CMAKE_CURRENT_BINARY_DIR}/gnc-vcs-info.h
+                             -D SRC_DIR=${CMAKE_SOURCE_DIR}
+                             -D SHELL="${SHELL}"
+                             -P ${CMAKE_SOURCE_DIR}/cmake/git2version-info.cmake
+)
+else(BUILDING_FROM_VCS)
+  add_custom_target(gnc-vcs-info DEPENDS ${VCS_INFO_FILE})
+endif(BUILDING_FROM_VCS)
+dist_add_generated (${BUILDING_FROM_VCS} gnc-vcs-info.h)
+
+# Command to generate the swig-core-utils-python.c wrapper file
+gnc_add_swig_python_command (swig-core-utils-python
+    SWIG_CORE_UTILS_PYTHON_C SWIG_CORE_UTILS_PYTHON_PY
+    swig-core-utils-python.c sw_core_utils.py
+    ${CMAKE_SOURCE_DIR}/bindings/core-utils.i ${CMAKE_CURRENT_SOURCE_DIR}
+)
+
 if (WITH_PYTHON)
   add_library (sw_core_utils MODULE ${SWIG_CORE_UTILS_PYTHON_C})
 
@@ -162,5 +158,10 @@ if (WITH_PYTHON)
 
 endif()
 
-# No headers to install
-
+# Dist files
+set_local_dist(core_utils_DIST_local
+    ${core_utils_SOURCES}
+    ${core_utils_noinst_HEADERS}
+    CMakeLists.txt
+    gncla-dir.h.in)
+set(core_utils_DIST ${core_utils_DIST_local} ${test_core_utils_DIST} PARENT_SCOPE)

commit 94fc5233ea0505fa9ace33029738fa407c85c2e5
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Oct 1 14:30:24 2019 +0200

    core-utils - cleanup build rules for target library gnc-core-utils
    
    * Eliminate redundant variables (core_utils_ALL_INCLUDES, core_utils_ALL_LIBRARIES)
      Their values are used directly in target_include_directories and
      target_link_libraries respectively.
      They have been eliminated from the python target because target_include_directories
      and target_link_libraries will correctly propagate these values.
    * Use generator expressions for a few conditional compile defines and options

diff --git a/libgnucash/core-utils/CMakeLists.txt b/libgnucash/core-utils/CMakeLists.txt
index b726ec87f..abbe95b48 100644
--- a/libgnucash/core-utils/CMakeLists.txt
+++ b/libgnucash/core-utils/CMakeLists.txt
@@ -42,7 +42,7 @@ if (BUILDING_FROM_VCS)
 else()
   set(VCS_INFO_BASE_DIR ${CMAKE_SOURCE_DIR})
 endif()
-set(VCS_INFO_FILE ${VCS_INFO_BASE_DIR}/libgnucash/core-utils/gnc-vcs-info.h CACHE STRING "path to gnc-vcs-dir")
+set(VCS_INFO_FILE ${VCS_INFO_BASE_DIR}/libgnucash/core-utils/gnc-vcs-info.h CACHE STRING "path to gnc-vcs-info.h file")
 
 ### Create gnc-vcs-info.h
 # This can only be done when building from a vcs (git/svn/bzr/svk) working directory.
@@ -87,38 +87,39 @@ set(core_utils_noinst_HEADERS
 )
 
 set(core_utils_ALL_SOURCES ${core_utils_SOURCES} ${core_utils_noinst_HEADERS})
-set(core_utils_ALL_LIBRARIES ${Boost_LIBRARIES} ${GLIB2_LDFLAGS} ${GOBJECT_LDFLAGS} ${GTK_MAC_LDFLAGS})
-set(core_utils_ALL_INCLUDES
-  ${CMAKE_SOURCE_DIR}/common
-  ${CMAKE_BINARY_DIR}/common
-  ${CMAKE_CURRENT_BINARY_DIR}
-  ${CMAKE_CURRENT_SOURCE_DIR}
-  ${GLIB2_INCLUDE_DIRS}
-  ${GTK_MAC_INCLUDE_DIRS})
 
 set_local_dist(core_utils_DIST_local ${core_utils_ALL_SOURCES} CMakeLists.txt gncla-dir.h.in)
 set(core_utils_DIST ${core_utils_DIST_local} ${test_core_utils_DIST} PARENT_SCOPE)
 
-if (MAC_INTEGRATION)
-  list(APPEND core_utils_ALL_LIBRARIES ${OSX_EXTRA_LIBRARIES})
-endif()
 
 add_library(gnc-core-utils ${core_utils_ALL_SOURCES})
 add_dependencies(gnc-core-utils gnc-vcs-info)
 
-target_link_libraries(gnc-core-utils ${core_utils_ALL_LIBRARIES})
+target_include_directories(gnc-core-utils
+    PUBLIC
+        ${CMAKE_SOURCE_DIR}/common
+        ${CMAKE_BINARY_DIR}/common
+        ${CMAKE_CURRENT_BINARY_DIR}
+        ${CMAKE_CURRENT_SOURCE_DIR}
+        ${GLIB2_INCLUDE_DIRS}
+        ${GTK_MAC_INCLUDE_DIRS})
+
+target_link_libraries(gnc-core-utils
+    ${Boost_LIBRARIES}
+    ${GLIB2_LDFLAGS}
+    ${GOBJECT_LDFLAGS}
+    ${GTK_MAC_LDFLAGS}
+    "$<$<BOOL:${MAC_INTEGRATION}>:${OSX_EXTRA_LIBRARIES}>")
 
 target_compile_definitions(gnc-core-utils
-    PRIVATE -DG_LOG_DOMAIN=\"gnc.core-utils\" ${GTK_MAC_CFLAGS_OTHER})
-
-target_include_directories(gnc-core-utils PUBLIC ${core_utils_ALL_INCLUDES})
+    PRIVATE
+        G_LOG_DOMAIN=\"gnc.core-utils\"
+        $<$<BOOL:${BUILDING_FROM_VCS}>:GNC_VCS=\"git\">
+        ${GTK_MAC_CFLAGS_OTHER})
 
-if (MAC_INTEGRATION)
-  target_compile_options(gnc-core-utils PRIVATE ${OSX_EXTRA_COMPILE_FLAGS})
-endif(MAC_INTEGRATION)
-if (BUILDING_FROM_VCS)
-  target_compile_definitions(gnc-core-utils PRIVATE -DGNC_VCS=\"git\")
-endif (BUILDING_FROM_VCS)
+target_compile_options(gnc-core-utils
+    PRIVATE
+        $<$<BOOL:${MAC_INTEGRATION}>:${OSX_EXTRA_COMPILE_FLAGS}>)
 
 install(TARGETS gnc-core-utils
   LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
@@ -129,7 +130,7 @@ install(TARGETS gnc-core-utils
 if (WITH_PYTHON)
   add_library (sw_core_utils MODULE ${SWIG_CORE_UTILS_PYTHON_C})
 
-  target_link_libraries(sw_core_utils gnc-core-utils ${core_utils_ALL_LIBRARIES} ${PYTHON_LIBRARIES})
+  target_link_libraries(sw_core_utils gnc-core-utils ${PYTHON_LIBRARIES})
   set_target_properties(sw_core_utils PROPERTIES PREFIX "_")
 
   if (HAVE_STRINGOP_TRUNCATION)
@@ -138,7 +139,7 @@ if (WITH_PYTHON)
 
   target_include_directories (sw_core_utils
     PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
-    PRIVATE ${core_utils_ALL_INCLUDES} ${PYTHON_INCLUDE_DIRS}
+    PRIVATE ${PYTHON_INCLUDE_DIRS}
   )
   target_compile_definitions (sw_core_utils PRIVATE -DG_LOG_DOMAIN=\"gnc.core-utils\")
 

commit 28fa4c64653d8bb2620c886a60cc102a48168710
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Oct 1 12:51:38 2019 +0200

    core-utils - move wrapper code to bindings/guile
    
    Note core-utils.i is used by both the guile and the python bindings so
    it is moved up to the common bindings directory, while guile
    specific changes are in bindings/guile.

diff --git a/bindings/CMakeLists.txt b/bindings/CMakeLists.txt
index 268222cbd..79f9d27e7 100644
--- a/bindings/CMakeLists.txt
+++ b/bindings/CMakeLists.txt
@@ -1,5 +1,5 @@
 add_subdirectory(guile)
 add_subdirectory(python)
 
-set_local_dist(bindings_DIST_local CMakeLists.txt )
+set_local_dist(bindings_DIST_local CMakeLists.txt core-utils.i)
 set(bindings_DIST ${bindings_DIST_local} ${guile_DIST} ${python_bindings_DIST} PARENT_SCOPE)
diff --git a/libgnucash/core-utils/core-utils.i b/bindings/core-utils.i
similarity index 100%
rename from libgnucash/core-utils/core-utils.i
rename to bindings/core-utils.i
diff --git a/bindings/guile/CMakeLists.txt b/bindings/guile/CMakeLists.txt
index bb42184ff..9c0159a8f 100644
--- a/bindings/guile/CMakeLists.txt
+++ b/bindings/guile/CMakeLists.txt
@@ -1,5 +1,11 @@
 add_subdirectory(test)
 
+# Command to generate the swig-core-utils-guile.c wrapper file
+gnc_add_swig_guile_command (swig-core-utils-guile-c
+    SWIG_CORE_UTILS_GUILE_C swig-core-utils-guile.c
+    ${CMAKE_SOURCE_DIR}/bindings/core-utils.i ${CMAKE_SOURCE_DIR}/libgnucash/core-utils
+)
+
 set(guile_HEADERS
     gnc-guile-utils.h)
 
@@ -7,19 +13,28 @@ set(guile_SOURCES
     gnc-guile-bindings.c
     gnc-guile-utils.c)
 
+add_library(gnucash-guile SHARED
+    ${guile_SOURCES}
+    ${guile_HEADERS}
+    ${SWIG_CORE_UTILS_GUILE_C})
 
-add_library(gnucash-guile SHARED ${guile_SOURCES} ${guile_HEADERS})
+add_dependencies(gnucash-guile
+    swig-runtime-h)
 
 target_include_directories(gnucash-guile
     PRIVATE
         ${CMAKE_SOURCE_DIR}/common
         ${CMAKE_BINARY_DIR}/common
+        ${CMAKE_SOURCE_DIR}/libgnucash/core-utils
+        ${CMAKE_BINARY_DIR}/libgnucash/core-utils # For gnc-version-info.h
         ${GLIB2_INCLUDE_DIRS}
-        ${GUILE_INCLUDE_DIRS}
+        ${GTK_MAC_INCLUDE_DIRS}
     PUBLIC
-        ${CMAKE_CURRENT_SOURCE_DIR})
+        ${CMAKE_CURRENT_SOURCE_DIR}
+        ${GUILE_INCLUDE_DIRS})
 
 target_link_libraries(gnucash-guile
+    gnc-core-utils
     ${GUILE_LDFLAGS}
     ${GLIB2_LDFLAGS}
     ${GOBJECT_LDFLAGS}
@@ -31,6 +46,8 @@ install(TARGETS gnucash-guile
     RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
 )
 
+# Scheme
+
 set(GUILE_DEPENDS      scm-core-utils scm-gnc-module gncmod-engine)
 
 gnc_add_scheme_targets(scm-scm
@@ -47,10 +64,25 @@ gnc_add_scheme_targets(price-quotes
   "scm-scm;scm-app-utils"
   FALSE)
 
+set (core_utils_SCHEME core-utils.scm)
 
-set_local_dist(guile_DIST_local CMakeLists.txt utilities.scm price-quotes.scm
-    ${guile_SOURCES} ${guile_HEADERS}
+set(GUILE_OUTPUT_DIR   gnucash)
+set(GUILE_DEPENDS      gnc-core-utils gnucash-guile)
+
+gnc_add_scheme_targets(scm-core-utils
+    "${core_utils_SCHEME}"
+    ${GUILE_OUTPUT_DIR}
+    "${GUILE_DEPENDS}"
+    FALSE
 )
+
+set_local_dist(guile_DIST_local
+    CMakeLists.txt
+    core-utils.scm
+    utilities.scm
+    price-quotes.scm
+    ${guile_SOURCES}
+    ${guile_HEADERS})
 set(guile_DIST ${guile_DIST_local} ${test_guile_DIST} PARENT_SCOPE)
 
 
diff --git a/libgnucash/core-utils/core-utils.scm b/bindings/guile/core-utils.scm
similarity index 96%
rename from libgnucash/core-utils/core-utils.scm
rename to bindings/guile/core-utils.scm
index 302e6bf31..5feaf1420 100644
--- a/libgnucash/core-utils/core-utils.scm
+++ b/bindings/guile/core-utils.scm
@@ -29,7 +29,7 @@
 ;; Guile 2 needs to find the symbols from the extension at compile time already
 (eval-when
       (compile load eval expand)
-      (load-extension "libgnc-core-utils" "scm_init_sw_core_utils_module"))
+      (load-extension "libgnucash-guile" "gnc_guile_bindings_init"))
 
 (use-modules (sw_core_utils))
 
diff --git a/bindings/guile/gnc-guile-bindings.c b/bindings/guile/gnc-guile-bindings.c
index 42c3fe085..0f762682e 100644
--- a/bindings/guile/gnc-guile-bindings.c
+++ b/bindings/guile/gnc-guile-bindings.c
@@ -32,12 +32,17 @@ void gnc_guile_bindings_init(void);
 
 static int is_initialized = 0;
 
+extern SCM
+scm_init_sw_core_utils_module (void);
+
 void
 gnc_guile_bindings_init(void)
 {
     if (!is_initialized)
     {
         /* Do what's necessary to initialize the bindings */
+        scm_init_sw_core_utils_module();
+
         is_initialized = 1;
     }
 }
diff --git a/libgnucash/core-utils/CMakeLists.txt b/libgnucash/core-utils/CMakeLists.txt
index ff17edf0f..b726ec87f 100644
--- a/libgnucash/core-utils/CMakeLists.txt
+++ b/libgnucash/core-utils/CMakeLists.txt
@@ -2,17 +2,11 @@
 
 add_subdirectory(test)
 
-# Command to generate the swig-core-utils-guile.c wrapper file
-gnc_add_swig_guile_command (swig-core-utils-guile-c
-    SWIG_CORE_UTILS_GUILE_C swig-core-utils-guile.c
-    ${CMAKE_CURRENT_SOURCE_DIR}/core-utils.i ""
-)
-
 # Command to generate the swig-core-utils-python.c wrapper file
 gnc_add_swig_python_command (swig-core-utils-python
     SWIG_CORE_UTILS_PYTHON_C SWIG_CORE_UTILS_PYTHON_PY
     swig-core-utils-python.c sw_core_utils.py
-    ${CMAKE_CURRENT_SOURCE_DIR}/core-utils.i ""
+    ${CMAKE_SOURCE_DIR}/bindings/core-utils.i ${CMAKE_CURRENT_SOURCE_DIR}
 )
 
 set (core_utils_SOURCES
@@ -93,25 +87,24 @@ set(core_utils_noinst_HEADERS
 )
 
 set(core_utils_ALL_SOURCES ${core_utils_SOURCES} ${core_utils_noinst_HEADERS})
-set(core_utils_ALL_LIBRARIES ${Boost_LIBRARIES} ${GUILE_LDFLAGS} ${GLIB2_LDFLAGS} ${GOBJECT_LDFLAGS} ${GTK_MAC_LDFLAGS})
+set(core_utils_ALL_LIBRARIES ${Boost_LIBRARIES} ${GLIB2_LDFLAGS} ${GOBJECT_LDFLAGS} ${GTK_MAC_LDFLAGS})
 set(core_utils_ALL_INCLUDES
   ${CMAKE_SOURCE_DIR}/common
   ${CMAKE_BINARY_DIR}/common
   ${CMAKE_CURRENT_BINARY_DIR}
   ${CMAKE_CURRENT_SOURCE_DIR}
   ${GLIB2_INCLUDE_DIRS}
-  ${GUILE_INCLUDE_DIRS}
   ${GTK_MAC_INCLUDE_DIRS})
 
-set_local_dist(core_utils_DIST_local ${core_utils_ALL_SOURCES} CMakeLists.txt core-utils.i core-utils.scm gncla-dir.h.in)
+set_local_dist(core_utils_DIST_local ${core_utils_ALL_SOURCES} CMakeLists.txt gncla-dir.h.in)
 set(core_utils_DIST ${core_utils_DIST_local} ${test_core_utils_DIST} PARENT_SCOPE)
 
 if (MAC_INTEGRATION)
   list(APPEND core_utils_ALL_LIBRARIES ${OSX_EXTRA_LIBRARIES})
 endif()
 
-add_library(gnc-core-utils ${core_utils_ALL_SOURCES} ${SWIG_CORE_UTILS_GUILE_C})
-add_dependencies(gnc-core-utils gnc-vcs-info swig-runtime-h)
+add_library(gnc-core-utils ${core_utils_ALL_SOURCES})
+add_dependencies(gnc-core-utils gnc-vcs-info)
 
 target_link_libraries(gnc-core-utils ${core_utils_ALL_LIBRARIES})
 
@@ -170,17 +163,3 @@ endif()
 
 # No headers to install
 
-# Scheme
-
-set (core_utils_SCHEME core-utils.scm)
-
-set(GUILE_OUTPUT_DIR   gnucash)
-set(GUILE_DEPENDS      gnc-core-utils)
-
-gnc_add_scheme_targets(scm-core-utils
-    "${core_utils_SCHEME}"
-    ${GUILE_OUTPUT_DIR}
-    "${GUILE_DEPENDS}"
-    FALSE
-)
-
diff --git a/po/POTFILES.in b/po/POTFILES.in
index b9a340914..48fae6f58 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,5 +1,6 @@
 # This is a list of files which contain translatable strings.
 # This file was autogenerated by cmake.
+bindings/guile/core-utils.scm
 bindings/guile/gnc-guile-bindings.c
 bindings/guile/gnc-guile-utils.c
 bindings/guile/price-quotes.scm
@@ -603,7 +604,6 @@ libgnucash/backend/xml/sixtp-stack.cpp
 libgnucash/backend/xml/sixtp-to-dom-parser.cpp
 libgnucash/backend/xml/sixtp-utils.cpp
 libgnucash/core-utils/binreloc.c
-libgnucash/core-utils/core-utils.scm
 libgnucash/core-utils/gnc-environment.c
 libgnucash/core-utils/gnc-filepath-utils.cpp
 libgnucash/core-utils/gnc-gkeyfile-utils.c

commit 18093b5e8214d647d9a75c781cdb780ee9c19624
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Oct 1 11:57:56 2019 +0200

    core-utils - move guile utils to bindings/guile

diff --git a/bindings/guile/CMakeLists.txt b/bindings/guile/CMakeLists.txt
index 39dbf4337..bb42184ff 100644
--- a/bindings/guile/CMakeLists.txt
+++ b/bindings/guile/CMakeLists.txt
@@ -1,15 +1,29 @@
 add_subdirectory(test)
 
-set(guile_HEADERS )
+set(guile_HEADERS
+    gnc-guile-utils.h)
 
 set(guile_SOURCES
-    gnc-guile-bindings.c)
-set(guile_bindings_ALL_INCLUDES
-    ${CMAKE_BINARY_DIR}/common
-    ${CMAKE_CURRENT_SOURCE_DIR})
+    gnc-guile-bindings.c
+    gnc-guile-utils.c)
+
 
 add_library(gnucash-guile SHARED ${guile_SOURCES} ${guile_HEADERS})
-target_include_directories(gnucash-guile PUBLIC ${guile_bindings_ALL_INCLUDES})
+
+target_include_directories(gnucash-guile
+    PRIVATE
+        ${CMAKE_SOURCE_DIR}/common
+        ${CMAKE_BINARY_DIR}/common
+        ${GLIB2_INCLUDE_DIRS}
+        ${GUILE_INCLUDE_DIRS}
+    PUBLIC
+        ${CMAKE_CURRENT_SOURCE_DIR})
+
+target_link_libraries(gnucash-guile
+    ${GUILE_LDFLAGS}
+    ${GLIB2_LDFLAGS}
+    ${GOBJECT_LDFLAGS}
+    ${GTK_MAC_LDFLAGS})
 
 install(TARGETS gnucash-guile
     LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
diff --git a/libgnucash/core-utils/gnc-guile-utils.c b/bindings/guile/gnc-guile-utils.c
similarity index 100%
rename from libgnucash/core-utils/gnc-guile-utils.c
rename to bindings/guile/gnc-guile-utils.c
diff --git a/libgnucash/core-utils/gnc-guile-utils.h b/bindings/guile/gnc-guile-utils.h
similarity index 100%
rename from libgnucash/core-utils/gnc-guile-utils.h
rename to bindings/guile/gnc-guile-utils.h
diff --git a/gnucash/gnome-utils/CMakeLists.txt b/gnucash/gnome-utils/CMakeLists.txt
index fe7b29ca5..db261366a 100644
--- a/gnucash/gnome-utils/CMakeLists.txt
+++ b/gnucash/gnome-utils/CMakeLists.txt
@@ -204,9 +204,15 @@ add_library (gncmod-gnome-utils
   ${gnome_utils_noinst_HEADERS}
 )
 
-target_link_libraries(gncmod-gnome-utils gncmod-app-utils gncmod-engine
-  gnc-backend-xml-utils PkgConfig::GTK3 ${CMAKE_DL_LIBS} ${LIBSECRET_LDFLAGS}
-  ${GTK_MAC_LDFLAGS})
+target_link_libraries(gncmod-gnome-utils
+    gncmod-app-utils
+    gncmod-engine
+    gnc-backend-xml-utils
+    gnucash-guile
+    PkgConfig::GTK3
+    ${CMAKE_DL_LIBS}
+    ${LIBSECRET_LDFLAGS}
+    ${GTK_MAC_LDFLAGS})
 
 target_compile_options(gncmod-gnome-utils PRIVATE -Wno-deprecated-declarations)
 target_compile_definitions(gncmod-gnome-utils PUBLIC ${GTK_MAC_CFLAGS_OTHER}
diff --git a/gnucash/gnome/CMakeLists.txt b/gnucash/gnome/CMakeLists.txt
index 45e28a330..9e55dc48c 100644
--- a/gnucash/gnome/CMakeLists.txt
+++ b/gnucash/gnome/CMakeLists.txt
@@ -136,9 +136,18 @@ set (gnc_gnome_SOURCES
 set_source_files_properties (${gnc_gnome_SOURCES} PROPERTIES OBJECT_DEPENDS ${CONFIG_H})
 
 add_library (gnc-gnome ${gnc_gnome_SOURCES} ${gnc_gnome_noinst_HEADERS} ${SWIG_GNOME_C})
-target_link_libraries(gnc-gnome gncmod-gnome-search gncmod-ledger-core
-  gncmod-html gncmod-report gncmod-register-gnome gncmod-register-core
-  gncmod-gnome-utils gncmod-engine PkgConfig::GTK3 ${GTK_MAC_LDFLAGS})
+target_link_libraries(gnc-gnome
+    gncmod-gnome-search
+    gncmod-ledger-core
+    gncmod-html
+    gncmod-report
+    gncmod-register-gnome
+    gncmod-register-core
+    gncmod-gnome-utils
+    gncmod-engine
+    gnucash-guile
+    PkgConfig::GTK3
+    ${GTK_MAC_LDFLAGS})
 
 target_compile_definitions (gnc-gnome PRIVATE -DG_LOG_DOMAIN=\"gnc.gui\" ${GTK_MAC_CFLAGS_OTHER})
 target_compile_options(gnc-gnome PRIVATE -Wno-deprecated-declarations)
diff --git a/gnucash/import-export/qif-imp/CMakeLists.txt b/gnucash/import-export/qif-imp/CMakeLists.txt
index 8322bbdc5..c6f666079 100644
--- a/gnucash/import-export/qif-imp/CMakeLists.txt
+++ b/gnucash/import-export/qif-imp/CMakeLists.txt
@@ -20,7 +20,11 @@ set (qif_import_noinst_HEADERS
 
 add_library	(gncmod-qif-import ${qif_import_SOURCES} ${qif_import_noinst_HEADERS})
 
-target_link_libraries(gncmod-qif-import gncmod-app-utils gncmod-gnome-utils gnc-gnome)
+target_link_libraries(gncmod-qif-import
+    gncmod-app-utils
+    gncmod-gnome-utils
+    gnc-gnome
+    gnucash-guile)
 
 target_compile_definitions(gncmod-qif-import PRIVATE -DG_LOG_DOMAIN=\"gnc.import.qif.import\")
 
diff --git a/gnucash/report/CMakeLists.txt b/gnucash/report/CMakeLists.txt
index 2c30a6377..859aa7223 100644
--- a/gnucash/report/CMakeLists.txt
+++ b/gnucash/report/CMakeLists.txt
@@ -27,10 +27,15 @@ add_library (gncmod-report
 
 target_compile_definitions(gncmod-report PRIVATE -DG_LOG_DOMAIN=\"gnc.report.core\")
 
-target_link_libraries(gncmod-report gnc-module gncmod-app-utils PkgConfig::GTK3 ${GUILE_LDFLAGS})
+target_link_libraries(gncmod-report
+    gnc-module
+    gncmod-app-utils
+    gnucash-guile
+    PkgConfig::GTK3
+    ${GUILE_LDFLAGS})
 
 target_include_directories (gncmod-report
-    PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} 
+    PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
 )
 
 
diff --git a/libgnucash/app-utils/CMakeLists.txt b/libgnucash/app-utils/CMakeLists.txt
index dca49c237..42946ce5c 100644
--- a/libgnucash/app-utils/CMakeLists.txt
+++ b/libgnucash/app-utils/CMakeLists.txt
@@ -78,9 +78,20 @@ set (app_utils_SOURCES
 set_source_files_properties (${app_utils_SOURCES} PROPERTIES OBJECT_DEPENDS ${CONFIG_H})
 
 set(app_utils_ALL_SOURCES ${app_utils_SOURCES} ${app_utils_HEADERS} ${app_utils_noinst_HEADERS})
-set(app_utils_ALL_LIBRARIES gncmod-engine gnc-module ${GIO_LDFLAGS} ${LIBXML2_LDFLAGS} ${LIBXSLT_LDFLAGS})
-set(app_utils_ALL_INCLUDES  ${CMAKE_CURRENT_SOURCE_DIR}/calculation ${GIO_INCLUDE_DIRS} ${LIBXML2_INCLUDE_DIRS}
-    ${LIBXSLT_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/libgnucash/backend ${CMAKE_SOURCE_DIR}/libgnucash/engine)
+set(app_utils_ALL_LIBRARIES
+    gncmod-engine
+    gnc-module
+    gnucash-guile
+    ${GIO_LDFLAGS}
+    ${LIBXML2_LDFLAGS}
+    ${LIBXSLT_LDFLAGS})
+set(app_utils_ALL_INCLUDES
+    ${CMAKE_CURRENT_SOURCE_DIR}/calculation
+    ${GIO_INCLUDE_DIRS}
+    ${LIBXML2_INCLUDE_DIRS}
+    ${LIBXSLT_INCLUDE_DIRS}
+    ${CMAKE_SOURCE_DIR}/libgnucash/backend
+    ${CMAKE_SOURCE_DIR}/libgnucash/engine)
 
 if (WIN32)
   list(APPEND app_utils_ALL_SOURCES gnc-help-utils.c)
diff --git a/libgnucash/core-utils/CMakeLists.txt b/libgnucash/core-utils/CMakeLists.txt
index ac4850cd3..ff17edf0f 100644
--- a/libgnucash/core-utils/CMakeLists.txt
+++ b/libgnucash/core-utils/CMakeLists.txt
@@ -22,7 +22,6 @@ set (core_utils_SOURCES
   gnc-filepath-utils.cpp
   gnc-gkeyfile-utils.c
   gnc-glib-utils.c
-  gnc-guile-utils.c
   gnc-jalali.c
   gnc-locale-utils.c
   gnc-locale-utils.cpp
@@ -86,7 +85,6 @@ set(core_utils_noinst_HEADERS
   gnc-filepath-utils.h
   gnc-gkeyfile-utils.h
   gnc-glib-utils.h
-  gnc-guile-utils.h
   gnc-jalali.h
   gnc-locale-utils.h
   gnc-locale-utils.hpp
diff --git a/libgnucash/engine/CMakeLists.txt b/libgnucash/engine/CMakeLists.txt
index 4f9c92296..6c1a33a94 100644
--- a/libgnucash/engine/CMakeLists.txt
+++ b/libgnucash/engine/CMakeLists.txt
@@ -237,12 +237,25 @@ else()
   set(BCRYPT "")
 endif()
 
-target_link_libraries(gncmod-engine gnc-core-utils gnc-module ${Boost_DATE_TIME_LIBRARIES}  ${Boost_REGEX_LIBRARIES}  ${ICU4C_I18N_LDFLAGS} ${BCRYPT} ${REGEX_LDFLAGS} ${GMODULE_LDFLAGS} ${GLIB2_LDFLAGS} ${GOBJECT_LDFLAGS} ${GUILE_LDFLAGS})
+target_link_libraries(gncmod-engine
+    gnc-core-utils
+    gnc-module
+    gnucash-guile
+    ${Boost_DATE_TIME_LIBRARIES}
+    ${Boost_REGEX_LIBRARIES}
+    ${ICU4C_I18N_LDFLAGS}
+    ${BCRYPT}
+    ${REGEX_LDFLAGS}
+    ${GMODULE_LDFLAGS}
+    ${GLIB2_LDFLAGS}
+    ${GOBJECT_LDFLAGS}
+    ${GUILE_LDFLAGS})
 
 target_compile_definitions (gncmod-engine PRIVATE -DG_LOG_DOMAIN=\"gnc.engine\")
 
 target_include_directories (gncmod-engine
-    PRIVATE ${CMAKE_CURRENT_BINARY_DIR} # for iso-4217-currencies.c
+    PRIVATE
+        ${CMAKE_CURRENT_BINARY_DIR} # for iso-4217-currencies.c
     PUBLIC
         ${CMAKE_CURRENT_SOURCE_DIR}
         ${CMAKE_BINARY_DIR}/common # for config.h
diff --git a/po/POTFILES.in b/po/POTFILES.in
index aa9394cf5..b9a340914 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,6 +1,7 @@
 # This is a list of files which contain translatable strings.
 # This file was autogenerated by cmake.
 bindings/guile/gnc-guile-bindings.c
+bindings/guile/gnc-guile-utils.c
 bindings/guile/price-quotes.scm
 bindings/guile/utilities.scm
 borrowed/goffice/go-charmap-sel.c
@@ -607,7 +608,6 @@ libgnucash/core-utils/gnc-environment.c
 libgnucash/core-utils/gnc-filepath-utils.cpp
 libgnucash/core-utils/gnc-gkeyfile-utils.c
 libgnucash/core-utils/gnc-glib-utils.c
-libgnucash/core-utils/gnc-guile-utils.c
 libgnucash/core-utils/gnc-jalali.c
 libgnucash/core-utils/gnc-locale-utils.c
 libgnucash/core-utils/gnc-locale-utils.cpp

commit 33e1ff645c741d4900eac3c343a203a5f77d1e67
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Mon Sep 30 22:31:46 2019 +0200

    Allow to pass include directories to the add_swig_xyz commands
    
    This will be needed when the wrappers no longer live in
    the same directory as the objects they are wrapping.

diff --git a/bindings/python/CMakeLists.txt b/bindings/python/CMakeLists.txt
index 83509209c..324255bdf 100644
--- a/bindings/python/CMakeLists.txt
+++ b/bindings/python/CMakeLists.txt
@@ -40,6 +40,7 @@ gnc_add_swig_python_command (swig-gnucash-core
     SWIG_GNUCASH_CORE_C SWIG_GNUCASH_CORE_PY
     gnucash_core.c gnucash_core_c.py
     ${SWIG_FILES}
+    ""
     ${CMAKE_SOURCE_DIR}/common/base-typemaps.i
     ${CMAKE_SOURCE_DIR}/libgnucash/engine/engine-common.i
     ${GNUCASH_CORE_C_INCLUDES}
diff --git a/common/cmake_modules/GncAddSwigCommand.cmake b/common/cmake_modules/GncAddSwigCommand.cmake
index 4b96b415b..75edd5233 100644
--- a/common/cmake_modules/GncAddSwigCommand.cmake
+++ b/common/cmake_modules/GncAddSwigCommand.cmake
@@ -10,18 +10,35 @@
 # - _out_var will be set to the full path to the generated wrapper file
 # - _output is the name of the wrapper file to generate
 # - _input is the swig interface file (*.i) to generate this wrapper from
+# - _include_dirs is an optional list of include directories to pass to the swig command
+#    For guile two directories are always passed by default:
+#    ${CMAKE_SOURCE_DIR}/common and ${CMAKE_SOURCE_DIR}/libgnucash/engine
 # Any additional parameters will be used as dependencies for this wrapper target
-macro (gnc_add_swig_guile_command _target _out_var _output _input)
+macro (gnc_add_swig_guile_command _target _out_var _output _input _include_dirs)
 
     set(SW_CURR_BUILD_SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR})
     set(SW_BUILD_SOURCE_DIR ${CMAKE_BINARY_DIR})
     set(outfile ${SW_CURR_BUILD_SOURCE_DIR}/${_output})
     set(${_out_var} ${outfile}) # This variable is set for convenience to use in the calling CMakeLists.txt
 
+
+    set (DEFAULT_SWIG_GUILE_FLAGS
+        -guile -Linkage module
+        ${SWIG_ARGS}
+    )
+    set (DEFAULT_SWIG_GUILE_C_INCLUDES
+        ${CMAKE_SOURCE_DIR}/common
+        ${CMAKE_SOURCE_DIR}/libgnucash/engine
+    )
+    set (GUILE_SWIG_FLAGS ${DEFAULT_SWIG_GUILE_FLAGS})
+    foreach (dir ${DEFAULT_SWIG_GUILE_C_INCLUDES} ${_include_dirs})
+        list (APPEND GUILE_SWIG_FLAGS "-I${dir}")
+    endforeach (dir)
+
     add_custom_command (
         OUTPUT ${outfile}
         DEPENDS ${_input} ${CMAKE_SOURCE_DIR}/common/base-typemaps.i ${ARGN}
-        COMMAND ${SWIG_EXECUTABLE} -guile ${SWIG_ARGS} -Linkage module -I${CMAKE_SOURCE_DIR}/libgnucash/engine -I${CMAKE_SOURCE_DIR}/common  -o ${outfile} ${_input}
+        COMMAND ${SWIG_EXECUTABLE} ${GUILE_SWIG_FLAGS}  -o ${outfile} ${_input}
     )
     add_custom_target(${_target} DEPENDS ${outfile})
 endmacro (gnc_add_swig_guile_command)
@@ -36,8 +53,12 @@ endmacro (gnc_add_swig_guile_command)
 # - _output is the name of the wrapper file to generate
 # - _py_output is the name of the python module associated with this wrapper
 # - _input is the swig interface file (*.i) to generate this wrapper from
+# - _include_dirs is an optional list of include directories to pass to the swig command
+#    For python four directories are always passed by default:
+#    ${GLIB2_INCLUDE_DIRS}, ${CMAKE_SOURCE_DIR}/common,
+#    ${CMAKE_SOURCE_DIR}/libgnucash/app-utils and ${CMAKE_SOURCE_DIR}/libgnucash/engine
 # Any additional parameters will be used as dependencies for this wrapper target
-macro (gnc_add_swig_python_command _target _out_var _py_out_var _output _py_output _input)
+macro (gnc_add_swig_python_command _target _out_var _py_out_var _output _py_output _input _include_dirs)
 
     set(SW_CURR_BUILD_SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR})
     set(SW_BUILD_SOURCE_DIR ${CMAKE_BINARY_DIR})
@@ -60,7 +81,7 @@ macro (gnc_add_swig_python_command _target _out_var _py_out_var _output _py_outp
     )
 
     set (PYTHON_SWIG_FLAGS ${DEFAULT_SWIG_PYTHON_FLAGS})
-    foreach (dir ${DEFAULT_SWIG_PYTHON_C_INCLUDES})
+    foreach (dir ${DEFAULT_SWIG_PYTHON_C_INCLUDES} ${_include_dirs})
         list (APPEND PYTHON_SWIG_FLAGS "-I${dir}")
     endforeach (dir)
     add_custom_command(OUTPUT ${outfile} ${py_outfile}
diff --git a/common/test-core/CMakeLists.txt b/common/test-core/CMakeLists.txt
index 42c13461e..34fde1e7e 100644
--- a/common/test-core/CMakeLists.txt
+++ b/common/test-core/CMakeLists.txt
@@ -30,14 +30,14 @@ endif()
 # Command to generate the swig-unittest-support-guile.c wrapper file
 gnc_add_swig_guile_command (swig-unittest-support-guile-c
     SWIG_UNITTEST_SUPPORT_GUILE_C swig-unittest-support-guile.c
-    ${CMAKE_CURRENT_SOURCE_DIR}/unittest-support.i ${test_core_HEADERS}
+    ${CMAKE_CURRENT_SOURCE_DIR}/unittest-support.i "" ${test_core_HEADERS}
 )
 
 # Command to generate the swig-unittest-support-python.c wrapper file
 gnc_add_swig_python_command (swig-unittest-support-python
     SWIG_UNITTEST_SUPPORT_PYTHON_C SWIG_UNITTEST_SUPPORT_PYTHON_PY
     swig-unittest-support-python.c unittest_support.py
-    ${CMAKE_CURRENT_SOURCE_DIR}/unittest-support.i
+    ${CMAKE_CURRENT_SOURCE_DIR}/unittest-support.i ""
 )
 
 add_library(test-core-guile ${SWIG_UNITTEST_SUPPORT_GUILE_C})
diff --git a/gnucash/gnome-utils/CMakeLists.txt b/gnucash/gnome-utils/CMakeLists.txt
index 7f6caf2a8..fe7b29ca5 100644
--- a/gnucash/gnome-utils/CMakeLists.txt
+++ b/gnucash/gnome-utils/CMakeLists.txt
@@ -5,7 +5,7 @@ add_subdirectory(test)
 # Command to generate the swig-gnome-utils.c wrapper file
 gnc_add_swig_guile_command (swig-gnome-utils-c
     SWIG_GNOME_UTILS_C swig-gnome-utils.c
-    ${CMAKE_CURRENT_SOURCE_DIR}/gnome-utils.i
+    ${CMAKE_CURRENT_SOURCE_DIR}/gnome-utils.i ""
 )
 
 set (WARNINGS_SCHEMA ${DATADIR_BUILD}/glib-2.0/schemas/org.gnucash.warnings.gschema.xml)
diff --git a/gnucash/gnome/CMakeLists.txt b/gnucash/gnome/CMakeLists.txt
index 01c466398..45e28a330 100644
--- a/gnucash/gnome/CMakeLists.txt
+++ b/gnucash/gnome/CMakeLists.txt
@@ -64,7 +64,7 @@ set (gnc_gnome_noinst_HEADERS
 # Command to generate the swig-gnome.c wrapper file
 gnc_add_swig_guile_command (swig-gnome-c
     SWIG_GNOME_C swig-gnome.c
-    ${CMAKE_CURRENT_SOURCE_DIR}/gnome.i ${gnc_gnome_HEADERS}
+    ${CMAKE_CURRENT_SOURCE_DIR}/gnome.i "" ${gnc_gnome_HEADERS}
 )
 
 set (gnc_gnome_SOURCES
diff --git a/gnucash/html/CMakeLists.txt b/gnucash/html/CMakeLists.txt
index 834cc8f4a..466949572 100644
--- a/gnucash/html/CMakeLists.txt
+++ b/gnucash/html/CMakeLists.txt
@@ -12,7 +12,7 @@ set (html_HEADERS
 # Command to generate the swig-gnc-html.c wrapper file
 gnc_add_swig_guile_command (swig-gnc-html-c
     SWIG_GNC_HTML_C swig-gnc-html.c
-    ${CMAKE_CURRENT_SOURCE_DIR}/gnc-html.i "${gncmod_html_HEADERS}"
+    ${CMAKE_CURRENT_SOURCE_DIR}/gnc-html.i "" "${gncmod_html_HEADERS}"
 )
 
 set (html_SOURCES
diff --git a/gnucash/report/CMakeLists.txt b/gnucash/report/CMakeLists.txt
index c7456f691..2c30a6377 100644
--- a/gnucash/report/CMakeLists.txt
+++ b/gnucash/report/CMakeLists.txt
@@ -11,7 +11,7 @@ set (report_HEADERS
 # Command to generate the swig-report.c wrapper file
 gnc_add_swig_guile_command (swig-report-c
     SWIG_REPORT_C swig-report.c
-    ${CMAKE_CURRENT_SOURCE_DIR}/report.i ${report_HEADERS}
+    ${CMAKE_CURRENT_SOURCE_DIR}/report.i "" ${report_HEADERS}
 )
 
 set (report_SOURCES
diff --git a/libgnucash/app-utils/CMakeLists.txt b/libgnucash/app-utils/CMakeLists.txt
index b34ca641c..dca49c237 100644
--- a/libgnucash/app-utils/CMakeLists.txt
+++ b/libgnucash/app-utils/CMakeLists.txt
@@ -38,14 +38,14 @@ set (app_utils_HEADERS
 # Command to generate the swig-app-utils-guile.c wrapper file
 gnc_add_swig_guile_command (swig-apputils-guile-c
     SWIG_APP_UTILS_GUILE_C swig-app-utils-guile.c
-    ${CMAKE_CURRENT_SOURCE_DIR}/app-utils.i
+    ${CMAKE_CURRENT_SOURCE_DIR}/app-utils.i ""
 )
 
 # Command to generate the swig-app-utils-python.c wrapper file
 gnc_add_swig_python_command (swig-app-utils-python
     SWIG_APP_UTILS_PYTHON_C SWIG_APP_UTILS_PYTHON_PY
     swig-app-utils-python.c sw_app_utils.py
-    ${CMAKE_CURRENT_SOURCE_DIR}/app-utils.i
+    ${CMAKE_CURRENT_SOURCE_DIR}/app-utils.i ""
 )
 
 set (app_utils_SOURCES
diff --git a/libgnucash/core-utils/CMakeLists.txt b/libgnucash/core-utils/CMakeLists.txt
index a999f15e2..ac4850cd3 100644
--- a/libgnucash/core-utils/CMakeLists.txt
+++ b/libgnucash/core-utils/CMakeLists.txt
@@ -5,14 +5,14 @@ add_subdirectory(test)
 # Command to generate the swig-core-utils-guile.c wrapper file
 gnc_add_swig_guile_command (swig-core-utils-guile-c
     SWIG_CORE_UTILS_GUILE_C swig-core-utils-guile.c
-    ${CMAKE_CURRENT_SOURCE_DIR}/core-utils.i
+    ${CMAKE_CURRENT_SOURCE_DIR}/core-utils.i ""
 )
 
 # Command to generate the swig-core-utils-python.c wrapper file
 gnc_add_swig_python_command (swig-core-utils-python
     SWIG_CORE_UTILS_PYTHON_C SWIG_CORE_UTILS_PYTHON_PY
     swig-core-utils-python.c sw_core_utils.py
-    ${CMAKE_CURRENT_SOURCE_DIR}/core-utils.i
+    ${CMAKE_CURRENT_SOURCE_DIR}/core-utils.i ""
 )
 
 set (core_utils_SOURCES
diff --git a/libgnucash/engine/CMakeLists.txt b/libgnucash/engine/CMakeLists.txt
index 19e429b9c..4f9c92296 100644
--- a/libgnucash/engine/CMakeLists.txt
+++ b/libgnucash/engine/CMakeLists.txt
@@ -121,7 +121,7 @@ set (engine_HEADERS
 # Command to generate the swig-engine.c wrapper file
 gnc_add_swig_guile_command (swig-engine-c
     SWIG_ENGINE_C swig-engine.c
-    ${CMAKE_CURRENT_SOURCE_DIR}/engine.i ${engine_HEADERS}
+    ${CMAKE_CURRENT_SOURCE_DIR}/engine.i "" ${engine_HEADERS}
 )
 
 # Command to generate the iso-4217-currencies.c file
diff --git a/libgnucash/gnc-module/CMakeLists.txt b/libgnucash/gnc-module/CMakeLists.txt
index b84654b2c..01d0b2cb7 100644
--- a/libgnucash/gnc-module/CMakeLists.txt
+++ b/libgnucash/gnc-module/CMakeLists.txt
@@ -5,7 +5,7 @@ add_subdirectory(example)
 # Command to generate the swig-gnc-module.c wrapper file
 gnc_add_swig_guile_command (swig-gnc-module-c
     SWIG_GNC_MODULE_C swig-gnc-module.c
-    ${CMAKE_CURRENT_SOURCE_DIR}/gnc-module.i
+    ${CMAKE_CURRENT_SOURCE_DIR}/gnc-module.i ""
 )
 
 set (gnc_module_SOURCES gnc-module.c)
diff --git a/libgnucash/gnc-module/test/mod-bar/CMakeLists.txt b/libgnucash/gnc-module/test/mod-bar/CMakeLists.txt
index ddeefb786..0912b23db 100644
--- a/libgnucash/gnc-module/test/mod-bar/CMakeLists.txt
+++ b/libgnucash/gnc-module/test/mod-bar/CMakeLists.txt
@@ -1,7 +1,7 @@
 
 gnc_add_swig_guile_command (swig-bar-c
     SWIG_BAR_C swig-bar.c
-    ${CMAKE_CURRENT_SOURCE_DIR}/bar.i bar.h
+    ${CMAKE_CURRENT_SOURCE_DIR}/bar.i "" bar.h
 )
 
 add_library(bar EXCLUDE_FROM_ALL bar.c bar.h)
diff --git a/libgnucash/gnc-module/test/mod-baz/CMakeLists.txt b/libgnucash/gnc-module/test/mod-baz/CMakeLists.txt
index f83fed30e..f39d658e1 100644
--- a/libgnucash/gnc-module/test/mod-baz/CMakeLists.txt
+++ b/libgnucash/gnc-module/test/mod-baz/CMakeLists.txt
@@ -1,7 +1,7 @@
 
 gnc_add_swig_guile_command (swig-baz-c
     SWIG_BAZ_C swig-baz.c
-    ${CMAKE_CURRENT_SOURCE_DIR}/baz.i baz.h
+    ${CMAKE_CURRENT_SOURCE_DIR}/baz.i "" baz.h
 )
 
 add_library(baz EXCLUDE_FROM_ALL baz.c baz.h)
diff --git a/libgnucash/gnc-module/test/mod-foo/CMakeLists.txt b/libgnucash/gnc-module/test/mod-foo/CMakeLists.txt
index c184eef7d..583115770 100644
--- a/libgnucash/gnc-module/test/mod-foo/CMakeLists.txt
+++ b/libgnucash/gnc-module/test/mod-foo/CMakeLists.txt
@@ -1,7 +1,7 @@
 
 gnc_add_swig_guile_command (swig-foo-c
     SWIG_FOO_C swig-foo.c
-    ${CMAKE_CURRENT_SOURCE_DIR}/foo.i foo.h
+    ${CMAKE_CURRENT_SOURCE_DIR}/foo.i "" foo.h
 )
 
 add_library(foo EXCLUDE_FROM_ALL foo.c foo.h)

commit e493d42def129ea597d4b6db659a6814cd3eeb96
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Mon Sep 30 20:41:54 2019 +0200

    Introduce gnucash-guile shared library
    
    This (currently empty) library is intented to become
    the standard api library for guile code that wants
    to use the libgnucash functionality.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e5784612a..54e72a9bc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -868,7 +868,7 @@ configure_file(
 add_custom_target(uninstall
         COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
 
-set(_MODULES gnc-core-utils gnc-module gnc-backend-xml-utils)
+set(_MODULES gnc-core-utils gnc-module gnc-backend-xml-utils gnucash-guile)
 
 if (WITH_SQL)
   list(APPEND _MODULES gnc-backend-sql)
diff --git a/bindings/guile/CMakeLists.txt b/bindings/guile/CMakeLists.txt
index 7d1aae964..39dbf4337 100644
--- a/bindings/guile/CMakeLists.txt
+++ b/bindings/guile/CMakeLists.txt
@@ -1,7 +1,23 @@
 add_subdirectory(test)
 
-set(GUILE_DEPENDS      scm-core-utils scm-gnc-module gncmod-engine)
+set(guile_HEADERS )
+
+set(guile_SOURCES
+    gnc-guile-bindings.c)
+set(guile_bindings_ALL_INCLUDES
+    ${CMAKE_BINARY_DIR}/common
+    ${CMAKE_CURRENT_SOURCE_DIR})
 
+add_library(gnucash-guile SHARED ${guile_SOURCES} ${guile_HEADERS})
+target_include_directories(gnucash-guile PUBLIC ${guile_bindings_ALL_INCLUDES})
+
+install(TARGETS gnucash-guile
+    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+)
+
+set(GUILE_DEPENDS      scm-core-utils scm-gnc-module gncmod-engine)
 
 gnc_add_scheme_targets(scm-scm
   "utilities.scm"
@@ -18,7 +34,9 @@ gnc_add_scheme_targets(price-quotes
   FALSE)
 
 
-set_local_dist(guile_DIST_local CMakeLists.txt utilities.scm price-quotes.scm)
+set_local_dist(guile_DIST_local CMakeLists.txt utilities.scm price-quotes.scm
+    ${guile_SOURCES} ${guile_HEADERS}
+)
 set(guile_DIST ${guile_DIST_local} ${test_guile_DIST} PARENT_SCOPE)
 
 
diff --git a/bindings/guile/gnc-guile-bindings.c b/bindings/guile/gnc-guile-bindings.c
new file mode 100644
index 000000000..42c3fe085
--- /dev/null
+++ b/bindings/guile/gnc-guile-bindings.c
@@ -0,0 +1,43 @@
+/*********************************************************************
+ * gnc-guile-bindings.c
+ * library to enable guile bindings for libgnucash
+ *
+ * Copyright (c) 2019 GnuCash Development Team
+ *********************************************************************/
+/********************************************************************\
+ * This program is free software; you can redistribute it and/or    *
+ * modify it under the terms of the GNU General Public License as   *
+ * published by the Free Software Foundation; either version 2 of   *
+ * the License, or (at your option) any later version.              *
+ *                                                                  *
+ * This program is distributed in the hope that it will be useful,  *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
+ * GNU General Public License for more details.                     *
+ *                                                                  *
+ * You should have received a copy of the GNU General Public License*
+ * along with this program; if not, contact:                        *
+ *                                                                  *
+ * Free Software Foundation           Voice:  +1-617-542-5942       *
+ * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
+ * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
+ *                                                                  *
+\********************************************************************/
+
+
+#include <config.h>
+#include <libguile.h>
+
+void gnc_guile_bindings_init(void);
+
+static int is_initialized = 0;
+
+void
+gnc_guile_bindings_init(void)
+{
+    if (!is_initialized)
+    {
+        /* Do what's necessary to initialize the bindings */
+        is_initialized = 1;
+    }
+}
diff --git a/po/POTFILES.in b/po/POTFILES.in
index e55d034e5..aa9394cf5 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,5 +1,6 @@
 # This is a list of files which contain translatable strings.
 # This file was autogenerated by cmake.
+bindings/guile/gnc-guile-bindings.c
 bindings/guile/price-quotes.scm
 bindings/guile/utilities.scm
 borrowed/goffice/go-charmap-sel.c

commit a0aa105826264430da63428eefd067b161f3a7bd
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Mon Sep 30 19:33:58 2019 +0200

    libgnucash/scm - move to bindings/guile
    
    A small step in the direction of making libgnucash guile-free.

diff --git a/bindings/CMakeLists.txt b/bindings/CMakeLists.txt
index 61450f669..268222cbd 100644
--- a/bindings/CMakeLists.txt
+++ b/bindings/CMakeLists.txt
@@ -1,4 +1,5 @@
+add_subdirectory(guile)
 add_subdirectory(python)
 
 set_local_dist(bindings_DIST_local CMakeLists.txt )
-set(bindings_DIST ${bindings_DIST_local} ${python_bindings_DIST} PARENT_SCOPE)
+set(bindings_DIST ${bindings_DIST_local} ${guile_DIST} ${python_bindings_DIST} PARENT_SCOPE)
diff --git a/libgnucash/scm/CMakeLists.txt b/bindings/guile/CMakeLists.txt
similarity index 66%
rename from libgnucash/scm/CMakeLists.txt
rename to bindings/guile/CMakeLists.txt
index 5b3ce0e86..7d1aae964 100644
--- a/libgnucash/scm/CMakeLists.txt
+++ b/bindings/guile/CMakeLists.txt
@@ -18,7 +18,7 @@ gnc_add_scheme_targets(price-quotes
   FALSE)
 
 
-set_local_dist(scm_DIST_local CMakeLists.txt utilities.scm price-quotes.scm)
-set(scm_DIST ${scm_DIST_local} ${scm_gnumeric_DIST} ${test_scm_DIST} PARENT_SCOPE)
+set_local_dist(guile_DIST_local CMakeLists.txt utilities.scm price-quotes.scm)
+set(guile_DIST ${guile_DIST_local} ${test_guile_DIST} PARENT_SCOPE)
 
 
diff --git a/libgnucash/scm/price-quotes.scm b/bindings/guile/price-quotes.scm
similarity index 100%
rename from libgnucash/scm/price-quotes.scm
rename to bindings/guile/price-quotes.scm
diff --git a/libgnucash/scm/test/CMakeLists.txt b/bindings/guile/test/CMakeLists.txt
similarity index 92%
rename from libgnucash/scm/test/CMakeLists.txt
rename to bindings/guile/test/CMakeLists.txt
index 544e446ab..df1d3a692 100644
--- a/libgnucash/scm/test/CMakeLists.txt
+++ b/bindings/guile/test/CMakeLists.txt
@@ -1,5 +1,5 @@
 set(scm_test_SCHEME
-  test-libgnucash-scm-utilities.scm
+  test-scm-utilities.scm
   test-module-deprecation.scm
   )
 
@@ -24,7 +24,7 @@ if (HAVE_SRFI64)
 
 endif (HAVE_SRFI64)
 
-set_dist_list(test_scm_DIST
+set_dist_list(test_guile_DIST
   CMakeLists.txt
   ${scm_test_SCHEME}
   )
diff --git a/libgnucash/scm/test/test-module-deprecation.scm b/bindings/guile/test/test-module-deprecation.scm
similarity index 100%
rename from libgnucash/scm/test/test-module-deprecation.scm
rename to bindings/guile/test/test-module-deprecation.scm
diff --git a/libgnucash/scm/test/test-libgnucash-scm-utilities.scm b/bindings/guile/test/test-scm-utilities.scm
similarity index 97%
rename from libgnucash/scm/test/test-libgnucash-scm-utilities.scm
rename to bindings/guile/test/test-scm-utilities.scm
index 9c73336a1..a335fb13c 100644
--- a/libgnucash/scm/test/test-libgnucash-scm-utilities.scm
+++ b/bindings/guile/test/test-scm-utilities.scm
@@ -6,13 +6,13 @@
 
 (define (run-test)
   (test-runner-factory gnc:test-runner)
-  (test-begin "test-libgnucash-scm-utilities.scm")
+  (test-begin "test-scm-utilities.scm")
   (test-traverse-vec)
   (test-substring-replace)
   (test-sort-and-delete-duplicates)
   (test-gnc:html-string-sanitize)
   (test-gnc:list-flatten)
-  (test-begin "test-libgnucash-scm-utilities.scm"))
+  (test-begin "test-scm-utilities.scm"))
 
 (define (test-traverse-vec)
   (test-begin "traverse-vec")
diff --git a/libgnucash/scm/utilities.scm b/bindings/guile/utilities.scm
similarity index 100%
rename from libgnucash/scm/utilities.scm
rename to bindings/guile/utilities.scm
diff --git a/libgnucash/CMakeLists.txt b/libgnucash/CMakeLists.txt
index f6e6ef6a5..a0ea47cf4 100644
--- a/libgnucash/CMakeLists.txt
+++ b/libgnucash/CMakeLists.txt
@@ -8,7 +8,6 @@ add_subdirectory (doc)
 add_subdirectory (engine)
 add_subdirectory (gnc-module)
 add_subdirectory (quotes)
-add_subdirectory (scm)
 add_subdirectory (tax)
 
 add_definitions (-DHAVE_CONFIG_H)
@@ -17,4 +16,4 @@ set_local_dist(libgnucash_DIST_local CMakeLists.txt ${libgnucash_EXTRA_DIST})
 
 set(libgnucash_DIST ${libgnucash_DIST_local} ${app_utils_DIST} ${backend_DIST}
              ${core_utils_DIST} ${doc_DIST} ${engine_DIST} ${gnc_module_DIST}
-             ${quotes_DIST} ${scm_DIST} ${tax_DIST} PARENT_SCOPE)
+             ${quotes_DIST} ${tax_DIST} PARENT_SCOPE)
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 1c147ff05..e55d034e5 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,5 +1,7 @@
 # This is a list of files which contain translatable strings.
 # This file was autogenerated by cmake.
+bindings/guile/price-quotes.scm
+bindings/guile/utilities.scm
 borrowed/goffice/go-charmap-sel.c
 borrowed/goffice/go-glib-extras.c
 borrowed/goffice/go-optionmenu.c
@@ -692,8 +694,6 @@ libgnucash/engine/TransLog.c
 libgnucash/gnc-module/example/gncmod-example.c
 libgnucash/gnc-module/gnc-module.c
 libgnucash/gnc-module/gnc-module.scm
-libgnucash/scm/price-quotes.scm
-libgnucash/scm/utilities.scm
 libgnucash/tax/de_DE/tax.scm
 libgnucash/tax/de_DE/txf-help.scm
 libgnucash/tax/de_DE/txf.scm

commit f5e28c3d0fc9e1f57d24e133cc14311f54751a9a
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Fri Dec 6 19:18:27 2019 +0100

    split register - drop scm copy interface

diff --git a/gnucash/register/ledger-core/CMakeLists.txt b/gnucash/register/ledger-core/CMakeLists.txt
index 158764f3a..0b671cee2 100644
--- a/gnucash/register/ledger-core/CMakeLists.txt
+++ b/gnucash/register/ledger-core/CMakeLists.txt
@@ -8,7 +8,6 @@ set (ledger_core_SOURCES
   split-register.c
   split-register-control.c
   split-register-copy-ops.c
-  split-register-copy-ops-internals.c
   split-register-layout.c
   split-register-load.c
   split-register-model.c
@@ -29,7 +28,6 @@ set (ledger_core_HEADERS
   split-register.h
   split-register-control.h
   split-register-copy-ops.h
-  split-register-copy-ops-internals.h
   split-register-layout.h
   split-register-model.h
   split-register-model-save.h
diff --git a/gnucash/register/ledger-core/split-register-copy-ops-internals.c b/gnucash/register/ledger-core/split-register-copy-ops-internals.c
deleted file mode 100644
index a7a241e94..000000000
--- a/gnucash/register/ledger-core/split-register-copy-ops-internals.c
+++ /dev/null
@@ -1,429 +0,0 @@
-/********************************************************************\
- * split-register-copy-ops-internals.c -- internal details of       *
- *                 copy/paste semantics for transactions and splits *
- * Port to C of engine-interface                                    *
- * originally written by Dave Peticolas <dave at krondo.com>           *
- * © 2019 Geert Janssens
- *                                                                  *
- * This program is free software; you can redistribute it and/or    *
- * modify it under the terms of the GNU General Public License as   *
- * published by the Free Software Foundation; either version 2 of   *
- * the License, or (at your option) any later version.              *
- *                                                                  *
- * This program is distributed in the hope that it will be useful,  *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
- * GNU General Public License for more details.                     *
- *                                                                  *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, write to the Free Software      *
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.        *
-\********************************************************************/
-
-#include <glib.h>
-
-#include "config.h"
-#include "split-register-copy-ops-internals.h"
-
-/* accessors */
-Split *gnc_float_split_get_split (const FloatingSplit *fs)
-{
-    g_return_val_if_fail (fs, NULL);
-    return fs->m_split;
-}
-
-Account *gnc_float_split_get_account (const FloatingSplit *fs) /* direct account pointer rather than account guid */
-{
-    g_return_val_if_fail (fs, NULL);
-    return fs->m_account;
-}
-
-Transaction *gnc_float_split_get_transaction (const FloatingSplit *fs) /* direct transaction pointer rather than transaction guid */
-{
-    g_return_val_if_fail (fs, NULL);
-    return fs->m_transaction;
-}
-
-const char *gnc_float_split_get_memo (const FloatingSplit *fs)
-{
-    g_return_val_if_fail (fs, NULL);
-    return fs->m_memo;
-}
-
-const char *gnc_float_split_get_action (const FloatingSplit *fs)
-{
-    g_return_val_if_fail (fs, NULL);
-    return fs->m_action;
-}
-
-char gnc_float_split_get_reconcile_state (const FloatingSplit *fs)
-{
-    g_return_val_if_fail (fs, '\0');
-    return fs->m_reconcile_state;
-}
-
-time64 gnc_float_split_get_reconcile_date (const FloatingSplit *fs)
-{
-    g_return_val_if_fail (fs, G_MAXINT64);
-    return fs->m_reconcile_date;
-}
-
-gnc_numeric gnc_float_split_get_amount (const FloatingSplit *fs)
-{
-    g_return_val_if_fail (fs, gnc_numeric_zero());
-    return fs->m_amount;
-}
-
-gnc_numeric gnc_float_split_get_value (const FloatingSplit *fs)
-{
-    g_return_val_if_fail (fs, gnc_numeric_zero());
-    return fs->m_value;
-}
-
-
-/* modifiers */
-void gnc_float_split_set_split(FloatingSplit *fs, Split *split)
-{
-    g_return_if_fail (fs);
-    fs->m_split = split;
-};
-
-void gnc_float_split_set_account (FloatingSplit *fs, Account *account) /* direct account pointer rather than account guid */
-{
-    g_return_if_fail (fs);
-    fs->m_account = account;
-};
-
-void gnc_float_split_set_transaction (FloatingSplit *fs, Transaction *transaction) /* direct transaction pointer rather than transaction guid */
-{
-    g_return_if_fail (fs);
-    fs->m_transaction = transaction;
-};
-
-void gnc_float_split_set_memo (FloatingSplit *fs, const char *memo)
-{
-    g_return_if_fail (fs);
-    fs->m_memo = memo;
-};
-
-void gnc_float_split_set_action (FloatingSplit *fs, const char *action)
-{
-    g_return_if_fail (fs);
-    fs->m_action = action;
-};
-
-void gnc_float_split_set_reconcile_state (FloatingSplit *fs, char reconcile_state)
-{
-    g_return_if_fail (fs);
-    fs->m_reconcile_state = reconcile_state;
-};
-
-void gnc_float_split_set_reconcile_date (FloatingSplit *fs, time64 reconcile_date)
-{
-    g_return_if_fail (fs);
-    fs->m_reconcile_date = reconcile_date;
-};
-
-void gnc_float_split_set_amount (FloatingSplit *fs, const gnc_numeric amount)
-{
-    g_return_if_fail (fs);
-
-    fs->m_amount = amount;
-};
-
-void gnc_float_split_set_value (FloatingSplit *fs, const gnc_numeric value)
-{
-    g_return_if_fail (fs);
-
-    fs->m_value = value;
-};
-
-/* This function takes a split and returns a representation
-   of it as a floating_split structure. Assumes the transaction is open
-   for editing.
-*/
-FloatingSplit *gnc_split_to_float_split (Split *split)
-{
-    FloatingSplit *fs;
-
-    g_return_val_if_fail (split, NULL);
-
-    fs = g_new0 (FloatingSplit, 1);
-    fs->m_split = split;
-    fs->m_account = xaccSplitGetAccount (split);
-    fs->m_transaction = xaccSplitGetParent (split);
-    fs->m_memo = xaccSplitGetMemo (split);
-    fs->m_action = xaccSplitGetAction (split);
-    fs->m_reconcile_state = xaccSplitGetReconcile (split);
-    fs->m_reconcile_date = xaccSplitGetDateReconciled (split);
-    fs->m_amount = xaccSplitGetAmount (split);
-    fs->m_value = xaccSplitGetValue (split);
-
-    return fs;
-}
-
-/* Copy a temporary split representation onto a real split.
-   If possible, insert the split into the account of the
-   split representation. Not all values are copied. The reconcile
-   status and date are not copied. The split's guid is,
-   of course, unchanged.
-*/
-void gnc_float_split_to_split (const FloatingSplit *fs, Split *split)
-{
-    g_return_if_fail(split);
-
-    if (fs->m_memo)
-        xaccSplitSetMemo (split, fs->m_memo);
-    if (fs->m_action)
-        xaccSplitSetAction (split, fs->m_action);
-    xaccSplitSetAmount (split, fs->m_amount);
-    xaccSplitSetValue (split, fs->m_value);
-    if (fs->m_account)
-    {
-        xaccAccountBeginEdit (fs->m_account);
-        xaccSplitSetAccount (split, fs->m_account);
-        xaccAccountCommitEdit (fs->m_account);
-    }
-}
-
-/* accessors */
-Transaction *gnc_float_txn_get_txn (const FloatingTxn *ft)
-{
-    g_return_val_if_fail (ft, NULL);
-    return ft->m_txn;
-}
-
-gnc_commodity *gnc_float_txn_get_currency (const FloatingTxn *ft)
-{
-    g_return_val_if_fail (ft, NULL);
-    return ft->m_currency;
-}
-
-time64 gnc_float_txn_get_date_entered (const FloatingTxn *ft)
-{
-    g_return_val_if_fail (ft, G_MAXINT64);
-    return ft->m_date_entered;
-}
-
-time64 gnc_float_txn_get_date_posted (const FloatingTxn *ft)
-{
-    g_return_val_if_fail (ft, G_MAXINT64);
-    return ft->m_date_posted;
-}
-
-const char *gnc_float_txn_get_num (const FloatingTxn *ft)
-{
-    g_return_val_if_fail (ft, NULL);
-    return ft->m_num;
-}
-
-const char *gnc_float_txn_get_description (const FloatingTxn *ft)
-{
-    g_return_val_if_fail (ft, NULL);
-    return ft->m_description;
-}
-
-const char *gnc_float_txn_get_notes (const FloatingTxn *ft)
-{
-    g_return_val_if_fail (ft, NULL);
-    return ft->m_notes;
-}
-
-const char *gnc_float_txn_get_association (const FloatingTxn *ft)
-{
-    g_return_val_if_fail (ft, NULL);
-    return ft->m_association;
-}
-
-SplitList *gnc_float_txn_get_splits (const FloatingTxn *ft)
-{
-    g_return_val_if_fail (ft, NULL);
-    return ft->m_splits;
-}
-
-FloatingSplit *gnc_float_txn_get_float_split (const FloatingTxn *ft, guint index)
-{
-    FloatingSplit *fs = NULL;
-    guint size = 0;
-
-    g_return_val_if_fail (ft, NULL);
-    g_return_val_if_fail (ft->m_splits, NULL);
-    g_return_val_if_fail (index < g_list_length (ft->m_splits) , NULL);
-    return g_list_nth_data (ft->m_splits, index);
-}
-
-FloatingSplit *gnc_float_txn_get_other_float_split (const FloatingTxn *ft, FloatingSplit *fs)
-{
-    guint size = 0, other = 0;
-
-    g_return_val_if_fail (ft, NULL);
-    g_return_val_if_fail (ft->m_splits, NULL);
-    g_return_val_if_fail (g_list_length (ft->m_splits) == 2 , NULL);
-
-    if (g_list_nth_data (ft->m_splits, 0) == fs)
-        other = 1;
-
-    return g_list_nth_data (ft->m_splits, other);
-}
-
-/* modifiers */
-void gnc_float_txn_set_txn (FloatingTxn *ft, Transaction *txn)
-{
-    g_return_if_fail (ft);
-    ft->m_txn = txn;
-};
-
-void gnc_float_txn_set_currency (FloatingTxn *ft, gnc_commodity *currency)
-{
-    g_return_if_fail (ft);
-    ft->m_currency = currency;
-};
-
-void gnc_float_txn_set_date_entered (FloatingTxn *ft, time64 date_entered)
-{
-    g_return_if_fail (ft);
-    ft->m_date_entered = date_entered;
-};
-
-void gnc_float_txn_set_date_posted (FloatingTxn *ft, time64 date_posted)
-{
-    g_return_if_fail (ft);
-    ft->m_date_posted = date_posted;
-};
-
-void gnc_float_txn_set_num (FloatingTxn *ft, const char *num)
-{
-    g_return_if_fail (ft);
-    ft->m_num = num;
-};
-
-void gnc_float_txn_set_description (FloatingTxn *ft, const char *description)
-{
-    g_return_if_fail (ft);
-    ft->m_description = description;
-};
-
-void gnc_float_txn_set_notes (FloatingTxn *ft, const char *notes)
-{
-    g_return_if_fail (ft);
-    ft->m_notes = notes;
-};
-
-void gnc_float_txn_set_association (FloatingTxn *ft, const char *association)
-{
-    g_return_if_fail (ft);
-    ft->m_association = association;
-};
-
-void gnc_float_txn_set_splits (FloatingTxn *ft, SplitList *splits)
-{
-    g_return_if_fail (ft);
-    ft->m_splits = splits;
-};
-
-void gnc_float_txn_append_float_split (FloatingTxn *ft, FloatingSplit *fs)
-{
-    g_return_if_fail (ft);
-    g_return_if_fail (fs);
-    ft->m_splits = g_list_append (ft->m_splits, fs);
-}
-
-/* This function takes a C transaction and returns
-   a representation of it as a floating_txn. */
-FloatingTxn *gnc_txn_to_float_txn (Transaction *txn, gboolean use_cut_semantics)
-{
-    GList *iter;
-
-    FloatingTxn *ft = g_new0 (FloatingTxn, 1);
-
-    ft->m_txn = txn;
-    ft->m_currency = xaccTransGetCurrency (txn);
-    ft->m_date_entered = xaccTransGetDateEntered (txn);
-    if (use_cut_semantics)
-    {
-        ft->m_date_posted = xaccTransGetDate (txn);
-        ft->m_num = xaccTransGetNum (txn);
-    }
-    ft->m_description = xaccTransGetDescription (txn);
-    ft->m_notes = xaccTransGetNotes (txn);
-    ft->m_association = xaccTransGetAssociation (txn);
-
-    for (iter = xaccTransGetSplitList (txn); iter ; iter = iter->next)
-    {
-        Split *split = iter->data;
-        if (split)
-        {
-            FloatingSplit *fs = gnc_split_to_float_split (split);
-            ft->m_splits = g_list_prepend (ft->m_splits, fs);
-        }
-    }
-    ft->m_splits = g_list_reverse (ft->m_splits);
-
-    return ft;
-}
-
-void gnc_float_txn_to_txn (const FloatingTxn *ft, Transaction *txn, gboolean do_commit)
-{
-    gnc_float_txn_to_txn_swap_accounts (ft, txn, NULL, NULL, do_commit);
-}
-
-/* Copy a temporary representation of a transaction onto a real transaction.
- I f they exist the two account*s (acct1 and acct2) are used to swap accounts
- when when creating splits. */
-void gnc_float_txn_to_txn_swap_accounts (const FloatingTxn *ft, Transaction *txn, Account *acct1, Account *acct2, gboolean do_commit)
-{
-    GList *iter;
-
-    g_return_if_fail (ft);
-    g_return_if_fail (txn);
-
-    if (!xaccTransIsOpen (txn))
-        xaccTransBeginEdit (txn);
-
-    if (ft->m_currency)
-        xaccTransSetCurrency (txn, ft->m_currency);
-    if (ft->m_description)
-        xaccTransSetDescription (txn, ft->m_description);
-    if (ft->m_num)
-        xaccTransSetNum (txn, ft->m_num);
-    if (ft->m_notes)
-        xaccTransSetNotes (txn, ft->m_notes);
-    if (ft->m_association)
-        xaccTransSetAssociation (txn, ft->m_association);
-    if (ft->m_date_posted)
-        xaccTransSetDatePostedSecs (txn, ft->m_date_posted);
-
-    /* strip off the old splits */
-    while (xaccTransCountSplits (txn))
-        xaccSplitDestroy (xaccTransGetSplit (txn, 0));
-
-    /* and put on the new ones! Please note they go in the *same*
-       order as in the original transaction. This is important. */
-    for (iter = ft->m_splits; iter; iter = iter->next)
-    {
-        Account *old_acc, *new_acc;
-        Split *split;
-        FloatingSplit *fs = iter->data;
-        if (!fs)
-            continue;
-
-        split = xaccMallocSplit (xaccTransGetBook (txn));
-
-        old_acc = fs->m_account;
-        if (fs->m_account == acct1)
-            new_acc = acct2;
-        else if  (fs->m_account == acct2)
-            new_acc = acct1;
-        else
-            new_acc = fs->m_account;
-
-        fs->m_account = new_acc;
-        gnc_float_split_to_split (fs, split);
-        fs->m_account = old_acc;
-        xaccSplitSetParent (split, txn);
-    }
-
-    /* close the transaction */
-    if (do_commit)
-        xaccTransCommitEdit (txn);
-}
diff --git a/gnucash/register/ledger-core/split-register-copy-ops-internals.h b/gnucash/register/ledger-core/split-register-copy-ops-internals.h
deleted file mode 100644
index 2f4976566..000000000
--- a/gnucash/register/ledger-core/split-register-copy-ops-internals.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/********************************************************************\
- * split-register-copy-ops-internals.c -- internal details of       *
- *                 copy/paste semantics for transactions and splits *
- * Port to C of engine-interface                                    *
- * originally written by Dave Peticolas <dave at krondo.com>           *
- * © 2019 Geert Janssens
- *                                                                  *
- * This program is free software; you can redistribute it and/or    *
- * modify it under the terms of the GNU General Public License as   *
- * published by the Free Software Foundation; either version 2 of   *
- * the License, or (at your option) any later version.              *
- *                                                                  *
- * This program is distributed in the hope that it will be useful,  *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
- * GNU General Public License for more details.                     *
- *                                                                  *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, write to the Free Software      *
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.        *
- * \********************************************************************/
-
-#ifndef SPLIT_REGISTER_COPY_OPS_INTERNAL_H
-#define SPLIT_REGISTER_COPY_OPS_INTERNAL_H
-
-#include <glib.h>
-
-#include "gnc-engine.h"   /* for typedefs */
-#include "qof.h"
-
-#include "guid.h"
-#include "Split.h"
-#include "Account.h"
-#include "Transaction.h"
-
-typedef struct
-{
-    Split       *m_split;
-    Account     *m_account;
-    Transaction *m_transaction;
-    const char  *m_memo;
-    const char  *m_action;
-    time64       m_reconcile_date;
-    char         m_reconcile_state;
-    gnc_numeric  m_value;
-    gnc_numeric  m_amount;
-} FloatingSplit;
-
-typedef struct
-{
-    Transaction *m_txn;
-    gnc_commodity *m_currency;
-    time64 m_date_entered;
-    time64 m_date_posted;
-    const char *m_num;
-    const char *m_description;
-    const char *m_notes;
-    const char *m_association;
-    SplitList *m_splits;
-} FloatingTxn;
-
-/* accessors */
-Split *gnc_float_split_get_split(const FloatingSplit* fs);
-Account *gnc_float_split_get_account (const FloatingSplit *fs); /* direct account pointer rather than account guid */
-Transaction *gnc_float_split_get_transaction (const FloatingSplit *fs); /* direct transaction pointer rather than transaction guid */
-const char *gnc_float_split_get_memo (const FloatingSplit *fs);
-const char *gnc_float_split_get_action (const FloatingSplit *fs);
-char gnc_float_split_get_reconcile_state (const FloatingSplit *fs);
-time64 gnc_float_split_get_reconcile_date (const FloatingSplit *fs);
-gnc_numeric gnc_float_split_get_amount (const FloatingSplit *fs);
-gnc_numeric gnc_float_split_get_value (const FloatingSplit *fs);
-
-/* modifiers */
-void gnc_float_split_set_split (FloatingSplit *fs, Split *split);
-void gnc_float_split_set_account (FloatingSplit *fs, Account *account); /* direct account pointer rather than account guid */
-void gnc_float_split_set_transaction (FloatingSplit *fs, Transaction *transaction); /* direct transaction pointer rather than transaction guid */
-void gnc_float_split_set_memo (FloatingSplit *fs, const char *memo);
-void gnc_float_split_set_action (FloatingSplit *fs, const char *action);
-void gnc_float_split_set_reconcile_state (FloatingSplit *fs, char reconcile_state);
-void gnc_float_split_set_reconcile_date (FloatingSplit *fs, time64 reconcile_date);
-void gnc_float_split_set_amount (FloatingSplit *fs, gnc_numeric amount);
-void gnc_float_split_set_value (FloatingSplit *fs, gnc_numeric value);
-
-FloatingSplit *gnc_split_to_float_split (Split *split);
-void gnc_float_split_to_split (const FloatingSplit *fs, Split *split);
-
-/* accessors */
-Transaction *gnc_float_txn_get_txn (const FloatingTxn *ft);
-gnc_commodity *gnc_float_txn_get_currency (const FloatingTxn *ft);
-time64 gnc_float_txn_get_date_entered (const FloatingTxn *ft);
-time64 gnc_float_txn_get_date_posted (const FloatingTxn *ft);
-const char *gnc_float_txn_get_num (const FloatingTxn *ft);
-const char *gnc_float_txn_get_description (const FloatingTxn *ft);
-const char *gnc_float_txn_get_notes (const FloatingTxn *ft);
-const char *gnc_float_txn_get_association (const FloatingTxn *ft);
-SplitList *gnc_float_txn_get_splits (const FloatingTxn *ft);
-
-FloatingSplit *gnc_float_txn_get_float_split (const FloatingTxn *ft, guint index);
-FloatingSplit *gnc_float_txn_get_other_float_split (const FloatingTxn *ft, FloatingSplit *fs);
-
-/* modifiers */
-void gnc_float_txn_set_txn (FloatingTxn *ft, Transaction *txn);
-void gnc_float_txn_set_currency (FloatingTxn *ft, gnc_commodity *currency);
-void gnc_float_txn_set_date_entered (FloatingTxn *ft, time64 date_entered);
-void gnc_float_txn_set_date_posted (FloatingTxn *ft, time64 date_posted);
-void gnc_float_txn_set_num (FloatingTxn *ft, const char *num);
-void gnc_float_txn_set_description (FloatingTxn *ft, const char *description);
-void gnc_float_txn_set_notes (FloatingTxn *ft, const char *notes);
-void gnc_float_txn_set_association (FloatingTxn *ft, const char *association);
-void gnc_float_txn_set_splits (FloatingTxn *ft, SplitList *splits);
-
-void gnc_float_txn_append_float_split (FloatingTxn *ft, FloatingSplit *fs);
-
-FloatingTxn *gnc_txn_to_float_txn (Transaction *txn, gboolean use_cut_semantics);
-
-void gnc_float_txn_to_txn (const FloatingTxn *ft, Transaction *txn, gboolean do_commit);
-void gnc_float_txn_to_txn_swap_accounts (const FloatingTxn *ft, Transaction *txn, Account *acct1, Account *acct2, gboolean do_commit);
-
-#endif
diff --git a/gnucash/register/ledger-core/split-register-copy-ops.c b/gnucash/register/ledger-core/split-register-copy-ops.c
index 8efe5e71c..22c36f6bb 100644
--- a/gnucash/register/ledger-core/split-register-copy-ops.c
+++ b/gnucash/register/ledger-core/split-register-copy-ops.c
@@ -1,9 +1,9 @@
 /********************************************************************\
- * split-register-copy-ops.c -- implement copy/paste semantics for  *
- *                              transactions and splits             *
- * Copyright (C) 1999 Linas Vepstas                                 *
- * Copyright (C) 2000 Dave Peticolas                                *
- * Copyright (C) 2017 Aaron Laws                                    *
+ * split-register-copy-ops.c -- copy/paste semantics for            *
+ *                                         transactions and splits  *
+ * Port to C of engine-interface                                    *
+ * originally written by Dave Peticolas <dave at krondo.com>           *
+ * © 2019 Geert Janssens
  *                                                                  *
  * This program is free software; you can redistribute it and/or    *
  * modify it under the terms of the GNU General Public License as   *
@@ -20,692 +20,410 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.        *
 \********************************************************************/
 
-#include <config.h>
-
-#include "swig-runtime.h"
-#include <platform.h>
-#if PLATFORM(WINDOWS)
-#include <winsock.h>
-#include <windows.h>
-#endif
-
 #include <glib.h>
-#include <glib/gi18n.h>
-#include <string.h>
-#ifdef __MINGW32__
-#define _GL_UNISTD_H //Deflect poisonous define of close in Guile's GnuLib
-#endif
-#include <libguile.h>
-#include <errno.h>
-#ifdef HAVE_UNISTD_H
-# ifdef close
-#  undef close
-# endif
-# include <unistd.h>
-#else
-# include <io.h>
-# define close _close
-#endif
-#ifndef HAVE_STRPTIME
-#    include "strptime.h"
-#endif
-
-#include "qof.h"
-#include "gnc-engine-guile.h"
-#include "glib-guile.h"
-#include "gnc-glib-utils.h"
-#include "gnc-guile-utils.h"
-#include "gnc-prefs.h"
-#include "guile-mappings.h"
-#include "split-register-copy-ops.h"
-
-#define UNUSED_VAR     __attribute__ ((unused))
 
-/* This static indicates the debugging module this .o belongs to.  */
-static QofLogModule UNUSED_VAR log_module = GNC_MOD_GUILE;
+#include "config.h"
+#include "split-register-copy-ops.h"
 
-struct _setters
+/* accessors */
+Split *gnc_float_split_get_split (const FloatingSplit *fs)
 {
-    SCM split_scm_account_guid;
-    SCM split_scm_memo;
-    SCM split_scm_action;
-    SCM split_scm_reconcile_state;
-    SCM split_scm_amount;
-    SCM split_scm_value;
-
-    SCM trans_scm_date;
-    SCM trans_scm_num;
-    SCM trans_scm_description;
-    SCM trans_scm_notes;
-    SCM trans_scm_append_split_scm;
-} setters;
+    g_return_val_if_fail (fs, NULL);
+    return fs->m_split;
+}
 
-struct _getters
+Account *gnc_float_split_get_account (const FloatingSplit *fs) /* direct account pointer rather than account guid */
 {
-    SCM split_scm_memo;
-    SCM split_scm_action;
-    SCM split_scm_amount;
-    SCM split_scm_value;
-
-    SCM trans_scm_split_scms;
-    SCM trans_scm_split_scm;
-    SCM trans_scm_other_split_scm;
-} getters;
+    g_return_val_if_fail (fs, NULL);
+    return fs->m_account;
+}
 
-struct _predicates
+Transaction *gnc_float_split_get_transaction (const FloatingSplit *fs) /* direct transaction pointer rather than transaction guid */
 {
-    SCM is_split_scm;
-    SCM is_trans_scm;
-} predicates;
+    g_return_val_if_fail (fs, NULL);
+    return fs->m_transaction;
+}
 
-struct _Process
+const char *gnc_float_split_get_memo (const FloatingSplit *fs)
 {
-    GPid pid;
-    gint fd_stdin;
-    gint fd_stdout;
-    gint fd_stderr;
-    gboolean dead;
-    gboolean detached;
-};
-
-static void
-initialize_scm_functions()
-{
-    static gboolean scm_funcs_inited = FALSE;
-
-    if (scm_funcs_inited)
-        return;
-
-    setters.split_scm_account_guid =
-        scm_c_eval_string("gnc:split-scm-set-account-guid");
-    setters.split_scm_memo = scm_c_eval_string("gnc:split-scm-set-memo");
-    setters.split_scm_action = scm_c_eval_string("gnc:split-scm-set-action");
-    setters.split_scm_reconcile_state =
-        scm_c_eval_string("gnc:split-scm-set-reconcile-state");
-    setters.split_scm_amount = scm_c_eval_string("gnc:split-scm-set-amount");
-    setters.split_scm_value = scm_c_eval_string("gnc:split-scm-set-value");
-
-    setters.trans_scm_date = scm_c_eval_string("gnc:transaction-scm-set-date-posted");
-    setters.trans_scm_num = scm_c_eval_string("gnc:transaction-scm-set-num");
-    setters.trans_scm_description =
-        scm_c_eval_string("gnc:transaction-scm-set-description");
-    setters.trans_scm_notes = scm_c_eval_string("gnc:transaction-scm-set-notes");
-    setters.trans_scm_append_split_scm =
-        scm_c_eval_string("gnc:transaction-scm-append-split-scm");
-
-    getters.split_scm_memo = scm_c_eval_string("gnc:split-scm-get-memo");
-    getters.split_scm_action = scm_c_eval_string("gnc:split-scm-get-action");
-    getters.split_scm_amount = scm_c_eval_string("gnc:split-scm-get-amount");
-    getters.split_scm_value = scm_c_eval_string("gnc:split-scm-get-value");
-
-    getters.trans_scm_split_scms =
-        scm_c_eval_string("gnc:transaction-scm-get-split-scms");
-    getters.trans_scm_split_scm =
-        scm_c_eval_string("gnc:transaction-scm-get-split-scm");
-    getters.trans_scm_other_split_scm =
-        scm_c_eval_string("gnc:transaction-scm-get-other-split-scm");
-
-    predicates.is_split_scm = scm_c_eval_string("gnc:split-scm?");
-    predicates.is_trans_scm = scm_c_eval_string("gnc:transaction-scm?");
-
-    scm_funcs_inited = TRUE;
+    g_return_val_if_fail (fs, NULL);
+    return fs->m_memo;
 }
 
-/********************************************************************\
- * gnc_copy_split                                                   *
- *   returns a scheme representation of a split. If the split is    *
- *   NULL, SCM_UNDEFINED is returned.                               *
- *                                                                  *
- * Args: split             - the split to copy                      *
- *       use_cut_semantics - if TRUE, copy is for a 'cut' operation *
- * Returns: SCM representation of split or SCM_UNDEFINED            *
-\********************************************************************/
-SCM
-gnc_copy_split(Split *split, gboolean use_cut_semantics)
+const char *gnc_float_split_get_action (const FloatingSplit *fs)
 {
-    static swig_type_info *split_type = NULL;
-    SCM func;
-    SCM arg;
-
-    if (split == NULL)
-        return SCM_UNDEFINED;
-
-    func = scm_c_eval_string("gnc:split->split-scm");
-    if (!scm_is_procedure(func))
-        return SCM_UNDEFINED;
-
-    if (!split_type)
-        split_type = SWIG_TypeQuery("_p_Split");
-
-    arg = SWIG_NewPointerObj(split, split_type, 0);
-
-    return scm_call_2(func, arg, SCM_BOOL(use_cut_semantics));
+    g_return_val_if_fail (fs, NULL);
+    return fs->m_action;
 }
 
-
-/********************************************************************\
- * gnc_copy_split_scm_onto_split                                    *
- *   copies a scheme representation of a split onto an actual split.*
- *                                                                  *
- * Args: split_scm - the scheme representation of a split           *
- *       split     - the split to copy onto                         *
- * Returns: Nothing                                                 *
-\********************************************************************/
-void
-gnc_copy_split_scm_onto_split(SCM split_scm, Split *split,
-                              QofBook * book)
+char gnc_float_split_get_reconcile_state (const FloatingSplit *fs)
 {
-    static swig_type_info *split_type = NULL;
-    SCM result;
-    SCM func;
-    SCM arg;
-
-    if (split_scm == SCM_UNDEFINED)
-        return;
-
-    if (split == NULL)
-        return;
-
-    g_return_if_fail (book);
-
-    func = scm_c_eval_string("gnc:split-scm?");
-    if (!scm_is_procedure(func))
-        return;
-
-    result = scm_call_1(func, split_scm);
-    if (!scm_is_true(result))
-        return;
-
-    func = scm_c_eval_string("gnc:split-scm-onto-split");
-    if (!scm_is_procedure(func))
-        return;
-
-    if (!split_type)
-        split_type = SWIG_TypeQuery("_p_Split");
-
-    arg = SWIG_NewPointerObj(split, split_type, 0);
-
-    scm_call_3(func, split_scm, arg, gnc_book_to_scm (book));
+    g_return_val_if_fail (fs, '\0');
+    return fs->m_reconcile_state;
 }
 
-
-/********************************************************************\
- * gnc_is_split_scm                                                 *
- *   returns true if the scm object is a scheme split               *
- *                                                                  *
- * Args: scm - a scheme object                                      *
- * Returns: true if scm is a scheme split                           *
-\********************************************************************/
-static gboolean
-gnc_is_split_scm(SCM scm)
+time64 gnc_float_split_get_reconcile_date (const FloatingSplit *fs)
 {
-    initialize_scm_functions();
-
-    return scm_is_true(scm_call_1(predicates.is_split_scm, scm));
+    g_return_val_if_fail (fs, G_MAXINT64);
+    return fs->m_reconcile_date;
 }
 
-
-/********************************************************************\
- * gnc_is_trans_scm                                                 *
- *   returns true if the scm object is a scheme transaction         *
- *                                                                  *
- * Args: scm - a scheme object                                      *
- * Returns: true if scm is a scheme transaction                     *
-\********************************************************************/
-static gboolean
-gnc_is_trans_scm(SCM scm)
+gnc_numeric gnc_float_split_get_amount (const FloatingSplit *fs)
 {
-    initialize_scm_functions();
+    g_return_val_if_fail (fs, gnc_numeric_zero());
+    return fs->m_amount;
+}
 
-    return scm_is_true(scm_call_1(predicates.is_trans_scm, scm));
+gnc_numeric gnc_float_split_get_value (const FloatingSplit *fs)
+{
+    g_return_val_if_fail (fs, gnc_numeric_zero());
+    return fs->m_value;
 }
 
 
-/********************************************************************\
- * gnc_split_scm_set_account                                        *
- *   set the account of a scheme representation of a split.         *
- *                                                                  *
- * Args: split_scm - the scheme split                               *
- *       account   - the account to set                             *
- * Returns: Nothing                                                 *
-\********************************************************************/
-void
-gnc_split_scm_set_account(SCM split_scm, Account *account)
+/* modifiers */
+void gnc_float_split_set_split(FloatingSplit *fs, Split *split)
 {
-    gchar guid_string[GUID_ENCODING_LENGTH+1];
-    SCM arg;
+    g_return_if_fail (fs);
+    fs->m_split = split;
+};
 
-    initialize_scm_functions();
+void gnc_float_split_set_account (FloatingSplit *fs, Account *account) /* direct account pointer rather than account guid */
+{
+    g_return_if_fail (fs);
+    fs->m_account = account;
+};
 
-    if (!gnc_is_split_scm(split_scm))
-        return;
-    if (account == NULL)
-        return;
+void gnc_float_split_set_transaction (FloatingSplit *fs, Transaction *transaction) /* direct transaction pointer rather than transaction guid */
+{
+    g_return_if_fail (fs);
+    fs->m_transaction = transaction;
+};
 
-    guid_to_string_buff(xaccAccountGetGUID(account), guid_string);
-    if (strlen(guid_string) == 0)
-        return;
+void gnc_float_split_set_memo (FloatingSplit *fs, const char *memo)
+{
+    g_return_if_fail (fs);
+    fs->m_memo = memo;
+};
 
-    arg = scm_from_utf8_string(guid_string);
+void gnc_float_split_set_action (FloatingSplit *fs, const char *action)
+{
+    g_return_if_fail (fs);
+    fs->m_action = action;
+};
 
-    scm_call_2(setters.split_scm_account_guid, split_scm, arg);
-}
+void gnc_float_split_set_reconcile_state (FloatingSplit *fs, char reconcile_state)
+{
+    g_return_if_fail (fs);
+    fs->m_reconcile_state = reconcile_state;
+};
 
+void gnc_float_split_set_reconcile_date (FloatingSplit *fs, time64 reconcile_date)
+{
+    g_return_if_fail (fs);
+    fs->m_reconcile_date = reconcile_date;
+};
 
-/********************************************************************\
- * gnc_split_scm_set_memo                                           *
- *   set the memo of a scheme representation of a split.            *
- *                                                                  *
- * Args: split_scm - the scheme split                               *
- *       memo      - the memo to set                                *
- * Returns: Nothing                                                 *
-\********************************************************************/
-void
-gnc_split_scm_set_memo(SCM split_scm, const char *memo)
+void gnc_float_split_set_amount (FloatingSplit *fs, const gnc_numeric amount)
 {
-    SCM arg;
+    g_return_if_fail (fs);
 
-    initialize_scm_functions();
+    fs->m_amount = amount;
+};
 
-    if (!gnc_is_split_scm(split_scm))
-        return;
-    if (memo == NULL)
-        return;
+void gnc_float_split_set_value (FloatingSplit *fs, const gnc_numeric value)
+{
+    g_return_if_fail (fs);
 
-    arg = scm_from_utf8_string(memo);
+    fs->m_value = value;
+};
 
-    scm_call_2(setters.split_scm_memo, split_scm, arg);
+/* This function takes a split and returns a representation
+   of it as a floating_split structure. Assumes the transaction is open
+   for editing.
+*/
+FloatingSplit *gnc_split_to_float_split (Split *split)
+{
+    FloatingSplit *fs;
+
+    g_return_val_if_fail (split, NULL);
+
+    fs = g_new0 (FloatingSplit, 1);
+    fs->m_split = split;
+    fs->m_account = xaccSplitGetAccount (split);
+    fs->m_transaction = xaccSplitGetParent (split);
+    fs->m_memo = xaccSplitGetMemo (split);
+    fs->m_action = xaccSplitGetAction (split);
+    fs->m_reconcile_state = xaccSplitGetReconcile (split);
+    fs->m_reconcile_date = xaccSplitGetDateReconciled (split);
+    fs->m_amount = xaccSplitGetAmount (split);
+    fs->m_value = xaccSplitGetValue (split);
+
+    return fs;
 }
 
-
-/********************************************************************\
- * gnc_split_scm_set_action                                         *
- *   set the action of a scheme representation of a split.          *
- *                                                                  *
- * Args: split_scm - the scheme split                               *
- *       action    - the action to set                              *
- * Returns: Nothing                                                 *
-\********************************************************************/
-void
-gnc_split_scm_set_action(SCM split_scm, const char *action)
+/* Copy a temporary split representation onto a real split.
+   If possible, insert the split into the account of the
+   split representation. Not all values are copied. The reconcile
+   status and date are not copied. The split's guid is,
+   of course, unchanged.
+*/
+void gnc_float_split_to_split (const FloatingSplit *fs, Split *split)
 {
-    SCM arg;
-
-    initialize_scm_functions();
-
-    if (!gnc_is_split_scm(split_scm))
-        return;
-    if (action == NULL)
-        return;
-
-    arg = scm_from_utf8_string(action);
-
-    scm_call_2(setters.split_scm_action, split_scm, arg);
+    g_return_if_fail(split);
+
+    if (fs->m_memo)
+        xaccSplitSetMemo (split, fs->m_memo);
+    if (fs->m_action)
+        xaccSplitSetAction (split, fs->m_action);
+    xaccSplitSetAmount (split, fs->m_amount);
+    xaccSplitSetValue (split, fs->m_value);
+    if (fs->m_account)
+    {
+        xaccAccountBeginEdit (fs->m_account);
+        xaccSplitSetAccount (split, fs->m_account);
+        xaccAccountCommitEdit (fs->m_account);
+    }
 }
 
-
-/********************************************************************\
- * gnc_split_scm_set_reconcile_state                                *
- *   set the reconcile state of a scheme split.                     *
- *                                                                  *
- * Args: split_scm       - the scheme split                         *
- *       reconcile_state - the reconcile state to set               *
- * Returns: Nothing                                                 *
-\********************************************************************/
-void
-gnc_split_scm_set_reconcile_state(SCM split_scm, char reconcile_state)
+/* accessors */
+Transaction *gnc_float_txn_get_txn (const FloatingTxn *ft)
 {
-    SCM arg;
-
-    initialize_scm_functions();
-
-    if (!gnc_is_split_scm(split_scm))
-        return;
-
-    arg = SCM_MAKE_CHAR(reconcile_state);
-
-    scm_call_2(setters.split_scm_reconcile_state, split_scm, arg);
+    g_return_val_if_fail (ft, NULL);
+    return ft->m_txn;
 }
 
-
-/********************************************************************\
- * gnc_split_scm_set_amount                                         *
- *   set the amount of a scheme split                               *
- *                                                                  *
- * Args: split_scm - the scheme split                               *
- *       amount    - the amount to set                              *
- * Returns: Nothing                                                 *
-\********************************************************************/
-void
-gnc_split_scm_set_amount(SCM split_scm, gnc_numeric amount)
+gnc_commodity *gnc_float_txn_get_currency (const FloatingTxn *ft)
 {
-    SCM arg;
-
-    initialize_scm_functions();
-
-    if (!gnc_is_split_scm(split_scm))
-        return;
-
-    arg = gnc_numeric_to_scm(amount);
-    scm_call_2(setters.split_scm_amount, split_scm, arg);
+    g_return_val_if_fail (ft, NULL);
+    return ft->m_currency;
 }
 
-
-/********************************************************************\
- * gnc_split_scm_set_value                                          *
- *   set the value of a scheme split                                *
- *                                                                  *
- * Args: split_scm - the scheme split                               *
- *       value     - the value to set                               *
- * Returns: Nothing                                                 *
-\********************************************************************/
-void
-gnc_split_scm_set_value(SCM split_scm, gnc_numeric value)
+time64 gnc_float_txn_get_date_entered (const FloatingTxn *ft)
 {
-    SCM arg;
-
-    initialize_scm_functions();
-
-    if (!gnc_is_split_scm(split_scm))
-        return;
-
-    arg = gnc_numeric_to_scm(value);
-    scm_call_2(setters.split_scm_value, split_scm, arg);
+    g_return_val_if_fail (ft, G_MAXINT64);
+    return ft->m_date_entered;
 }
 
-
-/********************************************************************\
- * gnc_split_scm_get_amount                                         *
- *   return the amount of a scheme split                            *
- *                                                                  *
- * Args: split_scm - the scheme split                               *
- * Returns: amount of scheme split                                  *
-\********************************************************************/
-gnc_numeric
-gnc_split_scm_get_amount(SCM split_scm)
+time64 gnc_float_txn_get_date_posted (const FloatingTxn *ft)
 {
-    SCM result;
-
-    initialize_scm_functions();
-
-    if (!gnc_is_split_scm(split_scm))
-        return gnc_numeric_zero ();
-
-    result = scm_call_1(getters.split_scm_amount, split_scm);
-    if (!scm_rational_p(result))
-        return gnc_numeric_zero ();
-
-    return gnc_scm_to_numeric(result);
+    g_return_val_if_fail (ft, G_MAXINT64);
+    return ft->m_date_posted;
 }
 
-
-/********************************************************************\
- * gnc_split_scm_get_value                                          *
- *   return the value of a scheme split                             *
- *                                                                  *
- * Args: split_scm - the scheme split                               *
- * Returns: value of scheme split                                   *
-\********************************************************************/
-gnc_numeric
-gnc_split_scm_get_value(SCM split_scm)
+const char *gnc_float_txn_get_num (const FloatingTxn *ft)
 {
-    SCM result;
-
-    initialize_scm_functions();
-
-    if (!gnc_is_split_scm(split_scm))
-        return gnc_numeric_zero ();
-
-    result = scm_call_1(getters.split_scm_value, split_scm);
-    if (!scm_rational_p(result))
-        return gnc_numeric_zero ();
-
-    return gnc_scm_to_numeric(result);
+    g_return_val_if_fail (ft, NULL);
+    return ft->m_num;
 }
 
-
-/********************************************************************\
- * gnc_copy_trans                                                   *
- *   returns a scheme representation of a transaction. If the       *
- *   transaction is NULL, SCM_UNDEFINED is returned.                *
- *                                                                  *
- * Args: trans             - the transaction to copy                *
- *       use_cut_semantics - if TRUE, copy is for a 'cut' operation *
- * Returns: SCM representation of transaction or SCM_UNDEFINED      *
-\********************************************************************/
-SCM
-gnc_copy_trans(Transaction *trans, gboolean use_cut_semantics)
+const char *gnc_float_txn_get_description (const FloatingTxn *ft)
 {
-    static swig_type_info *trans_type = NULL;
-    SCM func;
-    SCM arg;
-
-    if (trans == NULL)
-        return SCM_UNDEFINED;
-
-    func = scm_c_eval_string("gnc:transaction->transaction-scm");
-    if (!scm_is_procedure(func))
-        return SCM_UNDEFINED;
-
-    if (!trans_type)
-        trans_type = SWIG_TypeQuery("_p_Transaction");
-
-    arg = SWIG_NewPointerObj(trans, trans_type, 0);
-
-    return scm_call_2(func, arg, SCM_BOOL(use_cut_semantics));
+    g_return_val_if_fail (ft, NULL);
+    return ft->m_description;
 }
 
-
-/********************************************************************\
- * gnc_copy_trans_scm_onto_trans                                    *
- *   copies a scheme representation of a transaction onto           *
- *   an actual transaction.                                         *
- *                                                                  *
- * Args: trans_scm - the scheme representation of a transaction     *
- *       trans     - the transaction to copy onto                   *
- * Returns: Nothing                                                 *
-\********************************************************************/
-void
-gnc_copy_trans_scm_onto_trans(SCM trans_scm, Transaction *trans,
-                              gboolean do_commit, QofBook *book)
+const char *gnc_float_txn_get_notes (const FloatingTxn *ft)
 {
-    gnc_copy_trans_scm_onto_trans_swap_accounts(trans_scm, trans, NULL, NULL,
-            do_commit, book);
+    g_return_val_if_fail (ft, NULL);
+    return ft->m_notes;
 }
 
-
-/********************************************************************\
- * gnc_copy_trans_scm_onto_trans_swap_accounts                      *
- *   copies a scheme representation of a transaction onto           *
- *   an actual transaction. If guid_1 and guid_2 are not NULL,      *
- *   the account guids of the splits are swapped accordingly.       *
- *                                                                  *
- * Args: trans_scm - the scheme representation of a transaction     *
- *       trans     - the transaction to copy onto                   *
- *       guid_1    - account guid to swap with guid_2               *
- *       guid_2    - account guid to swap with guid_1               *
- *       do_commit - whether to commit the edits                    *
- * Returns: Nothing                                                 *
-\********************************************************************/
-void
-gnc_copy_trans_scm_onto_trans_swap_accounts(SCM trans_scm,
-        Transaction *trans,
-        const GncGUID *guid_1,
-        const GncGUID *guid_2,
-        gboolean do_commit,
-        QofBook *book)
+const char *gnc_float_txn_get_association (const FloatingTxn *ft)
 {
-    static swig_type_info *trans_type = NULL;
-    SCM result;
-    SCM func;
-    SCM arg;
-
-    if (trans_scm == SCM_UNDEFINED)
-        return;
-
-    if (trans == NULL)
-        return;
-
-    g_return_if_fail (book);
-
-    func = scm_c_eval_string("gnc:transaction-scm?");
-    if (!scm_is_procedure(func))
-        return;
-
-    result = scm_call_1(func, trans_scm);
-    if (!scm_is_true(result))
-        return;
+    g_return_val_if_fail (ft, NULL);
+    return ft->m_association;
+}
 
-    func = scm_c_eval_string("gnc:transaction-scm-onto-transaction");
-    if (!scm_is_procedure(func))
-        return;
+SplitList *gnc_float_txn_get_splits (const FloatingTxn *ft)
+{
+    g_return_val_if_fail (ft, NULL);
+    return ft->m_splits;
+}
 
-    if (!trans_type)
-        trans_type = SWIG_TypeQuery("_p_Transaction");
+FloatingSplit *gnc_float_txn_get_float_split (const FloatingTxn *ft, guint index)
+{
+    FloatingSplit *fs = NULL;
+    guint size = 0;
 
-    arg = SWIG_NewPointerObj(trans, trans_type, 0);
+    g_return_val_if_fail (ft, NULL);
+    g_return_val_if_fail (ft->m_splits, NULL);
+    g_return_val_if_fail (index < g_list_length (ft->m_splits) , NULL);
+    return g_list_nth_data (ft->m_splits, index);
+}
 
-    if ((guid_1 == NULL) || (guid_2 == NULL))
-    {
-        SCM args = SCM_EOL;
-        SCM commit;
+FloatingSplit *gnc_float_txn_get_other_float_split (const FloatingTxn *ft, FloatingSplit *fs)
+{
+    guint size = 0, other = 0;
 
-        commit = SCM_BOOL(do_commit);
+    g_return_val_if_fail (ft, NULL);
+    g_return_val_if_fail (ft->m_splits, NULL);
+    g_return_val_if_fail (g_list_length (ft->m_splits) == 2 , NULL);
 
-        args = scm_cons(gnc_book_to_scm (book), args);
-        args = scm_cons(commit, args);
-        args = scm_cons(SCM_EOL, args);
-        args = scm_cons(arg, args);
-        args = scm_cons(trans_scm, args);
+    if (g_list_nth_data (ft->m_splits, 0) == fs)
+        other = 1;
 
-        scm_apply(func, args, SCM_EOL);
-    }
-    else
-    {
-        gchar guidstr[GUID_ENCODING_LENGTH+1];
-        SCM from, to;
-        SCM map = SCM_EOL;
-        SCM args = SCM_EOL;
-        SCM commit;
+    return g_list_nth_data (ft->m_splits, other);
+}
 
-        args = scm_cons(gnc_book_to_scm (book), args);
+/* modifiers */
+void gnc_float_txn_set_txn (FloatingTxn *ft, Transaction *txn)
+{
+    g_return_if_fail (ft);
+    ft->m_txn = txn;
+};
 
-        commit = SCM_BOOL(do_commit);
+void gnc_float_txn_set_currency (FloatingTxn *ft, gnc_commodity *currency)
+{
+    g_return_if_fail (ft);
+    ft->m_currency = currency;
+};
 
-        args = scm_cons(commit, args);
+void gnc_float_txn_set_date_entered (FloatingTxn *ft, time64 date_entered)
+{
+    g_return_if_fail (ft);
+    ft->m_date_entered = date_entered;
+};
 
-        guid_to_string_buff(guid_1, guidstr);
-        from = scm_from_utf8_string(guidstr);
-        guid_to_string_buff(guid_2, guidstr);
-        to = scm_from_utf8_string(guidstr);
+void gnc_float_txn_set_date_posted (FloatingTxn *ft, time64 date_posted)
+{
+    g_return_if_fail (ft);
+    ft->m_date_posted = date_posted;
+};
 
-        map = scm_cons(scm_cons(from, to), map);
-        map = scm_cons(scm_cons(to, from), map);
+void gnc_float_txn_set_num (FloatingTxn *ft, const char *num)
+{
+    g_return_if_fail (ft);
+    ft->m_num = num;
+};
 
-        args = scm_cons(map, args);
-        args = scm_cons(arg, args);
-        args = scm_cons(trans_scm, args);
+void gnc_float_txn_set_description (FloatingTxn *ft, const char *description)
+{
+    g_return_if_fail (ft);
+    ft->m_description = description;
+};
 
-        scm_apply(func, args, SCM_EOL);
-    }
-}
+void gnc_float_txn_set_notes (FloatingTxn *ft, const char *notes)
+{
+    g_return_if_fail (ft);
+    ft->m_notes = notes;
+};
 
-/********************************************************************\
- * gnc_trans_scm_append_split_scm                                   *
- *   append the scheme split onto the scheme transaction            *
- *                                                                  *
- * Args: trans_scm - the scheme transaction                         *
- *       split_scm - the scheme split to append                     *
- * Returns: Nothing                                                 *
-\********************************************************************/
-void
-gnc_trans_scm_append_split_scm(SCM trans_scm, SCM split_scm)
+void gnc_float_txn_set_association (FloatingTxn *ft, const char *association)
 {
-    initialize_scm_functions();
+    g_return_if_fail (ft);
+    ft->m_association = association;
+};
 
-    if (!gnc_is_trans_scm(trans_scm))
-        return;
-    if (!gnc_is_split_scm(split_scm))
-        return;
+void gnc_float_txn_set_splits (FloatingTxn *ft, SplitList *splits)
+{
+    g_return_if_fail (ft);
+    ft->m_splits = splits;
+};
 
-    scm_call_2(setters.trans_scm_append_split_scm, trans_scm, split_scm);
+void gnc_float_txn_append_float_split (FloatingTxn *ft, FloatingSplit *fs)
+{
+    g_return_if_fail (ft);
+    g_return_if_fail (fs);
+    ft->m_splits = g_list_append (ft->m_splits, fs);
 }
 
-
-/********************************************************************\
- * gnc_trans_scm_get_split_scm                                      *
- *   get the indexth scheme split of a scheme transaction.          *
- *                                                                  *
- * Args: trans_scm - the scheme transaction                         *
- *       index     - the index of the split to get                  *
- * Returns: scheme split to get, or SCM_UNDEFINED if none           *
-\********************************************************************/
-SCM
-gnc_trans_scm_get_split_scm(SCM trans_scm, int index)
+/* This function takes a C transaction and returns
+   a representation of it as a floating_txn. */
+FloatingTxn *gnc_txn_to_float_txn (Transaction *txn, gboolean use_cut_semantics)
 {
-    SCM arg;
+    GList *iter;
 
-    initialize_scm_functions();
+    FloatingTxn *ft = g_new0 (FloatingTxn, 1);
 
-    if (!gnc_is_trans_scm(trans_scm))
-        return SCM_UNDEFINED;
+    ft->m_txn = txn;
+    ft->m_currency = xaccTransGetCurrency (txn);
+    ft->m_date_entered = xaccTransGetDateEntered (txn);
+    if (use_cut_semantics)
+    {
+        ft->m_date_posted = xaccTransGetDate (txn);
+        ft->m_num = xaccTransGetNum (txn);
+    }
+    ft->m_description = xaccTransGetDescription (txn);
+    ft->m_notes = xaccTransGetNotes (txn);
+    ft->m_association = xaccTransGetAssociation (txn);
 
-    arg = scm_from_int (index);
+    for (iter = xaccTransGetSplitList (txn); iter ; iter = iter->next)
+    {
+        Split *split = iter->data;
+        if (split)
+        {
+            FloatingSplit *fs = gnc_split_to_float_split (split);
+            ft->m_splits = g_list_prepend (ft->m_splits, fs);
+        }
+    }
+    ft->m_splits = g_list_reverse (ft->m_splits);
 
-    return scm_call_2(getters.trans_scm_split_scm, trans_scm, arg);
+    return ft;
 }
 
-
-/********************************************************************\
- * gnc_trans_scm_get_other_split_scm                                *
- *   get the other scheme split of a scheme transaction.            *
- *                                                                  *
- * Args: trans_scm - the scheme transaction                         *
- *       split_scm - the split not to get                           *
- * Returns: other scheme split, or SCM_UNDEFINED if none            *
-\********************************************************************/
-SCM
-gnc_trans_scm_get_other_split_scm(SCM trans_scm, SCM split_scm)
+void gnc_float_txn_to_txn (const FloatingTxn *ft, Transaction *txn, gboolean do_commit)
 {
-    SCM result;
-
-    initialize_scm_functions();
-
-    if (!gnc_is_trans_scm(trans_scm))
-        return SCM_UNDEFINED;
-    if (!gnc_is_split_scm(split_scm))
-        return SCM_UNDEFINED;
-
-    result = scm_call_2(getters.trans_scm_other_split_scm, trans_scm, split_scm);
-
-    if (!gnc_is_split_scm(result))
-        return SCM_UNDEFINED;
-
-    return result;
+    gnc_float_txn_to_txn_swap_accounts (ft, txn, NULL, NULL, do_commit);
 }
 
-
-/********************************************************************\
- * gnc_trans_scm_get_num_splits                                     *
- *   get the number of scheme splits in a scheme transaction.       *
- *                                                                  *
- * Args: trans_scm - the scheme transaction                         *
- * Returns: number of scheme splits in the transaction              *
-\********************************************************************/
-int
-gnc_trans_scm_get_num_splits(SCM trans_scm)
+/* Copy a temporary representation of a transaction onto a real transaction.
+ I f they exist the two account*s (acct1 and acct2) are used to swap accounts
+ when when creating splits. */
+void gnc_float_txn_to_txn_swap_accounts (const FloatingTxn *ft, Transaction *txn, Account *acct1, Account *acct2, gboolean do_commit)
 {
-    SCM result;
-
-    initialize_scm_functions();
-
-    if (!gnc_is_trans_scm(trans_scm))
-        return 0;
-
-    result = scm_call_1(getters.trans_scm_split_scms, trans_scm);
-
-    if (!scm_is_list(result))
-        return 0;
+    GList *iter;
+
+    g_return_if_fail (ft);
+    g_return_if_fail (txn);
+
+    if (!xaccTransIsOpen (txn))
+        xaccTransBeginEdit (txn);
+
+    if (ft->m_currency)
+        xaccTransSetCurrency (txn, ft->m_currency);
+    if (ft->m_description)
+        xaccTransSetDescription (txn, ft->m_description);
+    if (ft->m_num)
+        xaccTransSetNum (txn, ft->m_num);
+    if (ft->m_notes)
+        xaccTransSetNotes (txn, ft->m_notes);
+    if (ft->m_association)
+        xaccTransSetAssociation (txn, ft->m_association);
+    if (ft->m_date_posted)
+        xaccTransSetDatePostedSecs (txn, ft->m_date_posted);
+
+    /* strip off the old splits */
+    while (xaccTransCountSplits (txn))
+        xaccSplitDestroy (xaccTransGetSplit (txn, 0));
+
+    /* and put on the new ones! Please note they go in the *same*
+       order as in the original transaction. This is important. */
+    for (iter = ft->m_splits; iter; iter = iter->next)
+    {
+        Account *old_acc, *new_acc;
+        Split *split;
+        FloatingSplit *fs = iter->data;
+        if (!fs)
+            continue;
+
+        split = xaccMallocSplit (xaccTransGetBook (txn));
+
+        old_acc = fs->m_account;
+        if (fs->m_account == acct1)
+            new_acc = acct2;
+        else if  (fs->m_account == acct2)
+            new_acc = acct1;
+        else
+            new_acc = fs->m_account;
+
+        fs->m_account = new_acc;
+        gnc_float_split_to_split (fs, split);
+        fs->m_account = old_acc;
+        xaccSplitSetParent (split, txn);
+    }
 
-    return scm_to_int(scm_length(result));
+    /* close the transaction */
+    if (do_commit)
+        xaccTransCommitEdit (txn);
 }
diff --git a/gnucash/register/ledger-core/split-register-copy-ops.h b/gnucash/register/ledger-core/split-register-copy-ops.h
index b417f434a..ea1e340b2 100644
--- a/gnucash/register/ledger-core/split-register-copy-ops.h
+++ b/gnucash/register/ledger-core/split-register-copy-ops.h
@@ -1,8 +1,9 @@
 /********************************************************************\
- * split-register-copy-ops.h -- implement copy/paste semantics for  *
- *                              transactions and splits             *
- * Copyright (C) 1999 Linas Vepstas                                 *
- * Copyright (C) 2017 Aaron Laws                                    *
+ * split-register-copy-ops.c -- copy/paste semantics for            *
+ *                                         transactions and splits  *
+ * Port to C of engine-interface                                    *
+ * originally written by Dave Peticolas <dave at krondo.com>           *
+ * © 2019 Geert Janssens
  *                                                                  *
  * This program is free software; you can redistribute it and/or    *
  * modify it under the terms of the GNU General Public License as   *
@@ -15,55 +16,104 @@
  * GNU General Public License for more details.                     *
  *                                                                  *
  * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact:                        *
- *                                                                  *
- * Free Software Foundation           Voice:  +1-617-542-5942       *
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
- * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
- *                                                                  *
-\********************************************************************/
+ * along with this program; if not, write to the Free Software      *
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.        *
+ * \********************************************************************/
 
 #ifndef SPLIT_REGISTER_COPY_OPS_H
 #define SPLIT_REGISTER_COPY_OPS_H
 
 #include <glib.h>
-#include <libguile.h>
 
+#include "gnc-engine.h"   /* for typedefs */
 #include "qof.h"
+
+#include "guid.h"
+#include "Split.h"
 #include "Account.h"
-#include "gnc-guile-utils.h"
-
-/* The next set of functions is for manipulating scheme
- * representations of splits and transactions. */
-
-SCM    gnc_copy_split(Split *split, gboolean use_cut_semantics);
-void   gnc_copy_split_scm_onto_split(SCM split_scm, Split *split,
-                                     QofBook *book);
-
-void   gnc_split_scm_set_account(SCM split_scm, Account *account);
-void   gnc_split_scm_set_memo(SCM split_scm, const char *memo);
-void   gnc_split_scm_set_action(SCM split_scm, const char *action);
-void   gnc_split_scm_set_reconcile_state(SCM split_scm, char reconcile_state);
-void   gnc_split_scm_set_amount(SCM split_scm, gnc_numeric amount);
-void   gnc_split_scm_set_value(SCM split_scm, gnc_numeric value);
-
-gnc_numeric gnc_split_scm_get_amount(SCM split_scm);
-gnc_numeric gnc_split_scm_get_value(SCM split_scm);
-
-SCM    gnc_copy_trans(Transaction *trans, gboolean use_cut_semantics);
-void   gnc_copy_trans_scm_onto_trans(SCM trans_scm, Transaction *trans,
-                                     gboolean do_commit, QofBook *book);
-void   gnc_copy_trans_scm_onto_trans_swap_accounts(SCM trans_scm,
-        Transaction *trans,
-        const GncGUID *guid_1,
-        const GncGUID *guid_2,
-        gboolean do_commit,
-        QofBook *book);
-
-void   gnc_trans_scm_append_split_scm(SCM trans_scm, SCM split_scm);
-
-SCM    gnc_trans_scm_get_split_scm(SCM trans_scm, int index);
-SCM    gnc_trans_scm_get_other_split_scm(SCM trans_scm, SCM split_scm);
-int    gnc_trans_scm_get_num_splits(SCM trans_scm);
+#include "Transaction.h"
+
+typedef struct
+{
+    Split       *m_split;
+    Account     *m_account;
+    Transaction *m_transaction;
+    const char  *m_memo;
+    const char  *m_action;
+    time64       m_reconcile_date;
+    char         m_reconcile_state;
+    gnc_numeric  m_value;
+    gnc_numeric  m_amount;
+} FloatingSplit;
+
+typedef struct
+{
+    Transaction *m_txn;
+    gnc_commodity *m_currency;
+    time64 m_date_entered;
+    time64 m_date_posted;
+    const char *m_num;
+    const char *m_description;
+    const char *m_notes;
+    const char *m_association;
+    SplitList *m_splits;
+} FloatingTxn;
+
+/* accessors */
+Split *gnc_float_split_get_split(const FloatingSplit* fs);
+Account *gnc_float_split_get_account (const FloatingSplit *fs); /* direct account pointer rather than account guid */
+Transaction *gnc_float_split_get_transaction (const FloatingSplit *fs); /* direct transaction pointer rather than transaction guid */
+const char *gnc_float_split_get_memo (const FloatingSplit *fs);
+const char *gnc_float_split_get_action (const FloatingSplit *fs);
+char gnc_float_split_get_reconcile_state (const FloatingSplit *fs);
+time64 gnc_float_split_get_reconcile_date (const FloatingSplit *fs);
+gnc_numeric gnc_float_split_get_amount (const FloatingSplit *fs);
+gnc_numeric gnc_float_split_get_value (const FloatingSplit *fs);
+
+/* modifiers */
+void gnc_float_split_set_split (FloatingSplit *fs, Split *split);
+void gnc_float_split_set_account (FloatingSplit *fs, Account *account); /* direct account pointer rather than account guid */
+void gnc_float_split_set_transaction (FloatingSplit *fs, Transaction *transaction); /* direct transaction pointer rather than transaction guid */
+void gnc_float_split_set_memo (FloatingSplit *fs, const char *memo);
+void gnc_float_split_set_action (FloatingSplit *fs, const char *action);
+void gnc_float_split_set_reconcile_state (FloatingSplit *fs, char reconcile_state);
+void gnc_float_split_set_reconcile_date (FloatingSplit *fs, time64 reconcile_date);
+void gnc_float_split_set_amount (FloatingSplit *fs, gnc_numeric amount);
+void gnc_float_split_set_value (FloatingSplit *fs, gnc_numeric value);
+
+FloatingSplit *gnc_split_to_float_split (Split *split);
+void gnc_float_split_to_split (const FloatingSplit *fs, Split *split);
+
+/* accessors */
+Transaction *gnc_float_txn_get_txn (const FloatingTxn *ft);
+gnc_commodity *gnc_float_txn_get_currency (const FloatingTxn *ft);
+time64 gnc_float_txn_get_date_entered (const FloatingTxn *ft);
+time64 gnc_float_txn_get_date_posted (const FloatingTxn *ft);
+const char *gnc_float_txn_get_num (const FloatingTxn *ft);
+const char *gnc_float_txn_get_description (const FloatingTxn *ft);
+const char *gnc_float_txn_get_notes (const FloatingTxn *ft);
+const char *gnc_float_txn_get_association (const FloatingTxn *ft);
+SplitList *gnc_float_txn_get_splits (const FloatingTxn *ft);
+
+FloatingSplit *gnc_float_txn_get_float_split (const FloatingTxn *ft, guint index);
+FloatingSplit *gnc_float_txn_get_other_float_split (const FloatingTxn *ft, FloatingSplit *fs);
+
+/* modifiers */
+void gnc_float_txn_set_txn (FloatingTxn *ft, Transaction *txn);
+void gnc_float_txn_set_currency (FloatingTxn *ft, gnc_commodity *currency);
+void gnc_float_txn_set_date_entered (FloatingTxn *ft, time64 date_entered);
+void gnc_float_txn_set_date_posted (FloatingTxn *ft, time64 date_posted);
+void gnc_float_txn_set_num (FloatingTxn *ft, const char *num);
+void gnc_float_txn_set_description (FloatingTxn *ft, const char *description);
+void gnc_float_txn_set_notes (FloatingTxn *ft, const char *notes);
+void gnc_float_txn_set_association (FloatingTxn *ft, const char *association);
+void gnc_float_txn_set_splits (FloatingTxn *ft, SplitList *splits);
+
+void gnc_float_txn_append_float_split (FloatingTxn *ft, FloatingSplit *fs);
+
+FloatingTxn *gnc_txn_to_float_txn (Transaction *txn, gboolean use_cut_semantics);
+
+void gnc_float_txn_to_txn (const FloatingTxn *ft, Transaction *txn, gboolean do_commit);
+void gnc_float_txn_to_txn_swap_accounts (const FloatingTxn *ft, Transaction *txn, Account *acct1, Account *acct2, gboolean do_commit);
 
 #endif
diff --git a/gnucash/register/ledger-core/split-register.c b/gnucash/register/ledger-core/split-register.c
index 03cefca56..3bb9dc990 100644
--- a/gnucash/register/ledger-core/split-register.c
+++ b/gnucash/register/ledger-core/split-register.c
@@ -39,7 +39,7 @@
 #include "gnc-ui.h"
 #include "gnc-warnings.h"
 #include "guile-util.h"
-#include "split-register-copy-ops-internals.h"
+#include "split-register-copy-ops.h"
 #include "numcell.h"
 #include "pricecell.h"
 #include "quickfillcell.h"
diff --git a/libgnucash/engine/CMakeLists.txt b/libgnucash/engine/CMakeLists.txt
index 29a19f082..19e429b9c 100644
--- a/libgnucash/engine/CMakeLists.txt
+++ b/libgnucash/engine/CMakeLists.txt
@@ -273,7 +273,6 @@ set (engine_SCHEME_0
 
 set (engine_SCHEME_1
     commodity-table.scm
-    engine-interface.scm
     engine-utilities.scm
     gnc-numeric.scm
 )
diff --git a/libgnucash/engine/engine-interface.scm b/libgnucash/engine/engine-interface.scm
deleted file mode 100644
index 34a176884..000000000
--- a/libgnucash/engine/engine-interface.scm
+++ /dev/null
@@ -1,295 +0,0 @@
-;; engine-interface.scm -- support for working with the GnuCash
-;;                         engine data structures
-;; Copyright (C) 2000 Dave Peticolas <dave at krondo.com>
-;;                                                                  
-;; This program is free software; you can redistribute it and/or    
-;; modify it under the terms of the GNU General Public License as   
-;; published by the Free Software Foundation; either version 2 of   
-;; the License, or (at your option) any later version.              
-;;                                                                  
-;; This program is distributed in the hope that it will be useful,  
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of   
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    
-;; GNU General Public License for more details.                     
-;;                                                                  
-;; You should have received a copy of the GNU General Public License
-;; along with this program; if not, contact:
-;;
-;; Free Software Foundation           Voice:  +1-617-542-5942
-;; 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652
-;; Boston, MA  02110-1301,  USA       gnu at gnu.org
-
-;; This defines a scheme representation of splits.
-(define gnc:split-structure
-  (make-record-type
-   "gnc:split-structure"
-   '(split-guid account-guid transaction-guid memo action
-                reconcile-state reconciled-date amount value)))
-
-;; constructor
-(define gnc:make-split-scm
-  (record-constructor gnc:split-structure))
-
-;; type predicate
-(define gnc:split-scm?
-  (record-predicate gnc:split-structure))
-
-;; accessors
-(define gnc:split-scm-get-split-guid
-  (record-accessor gnc:split-structure 'split-guid))
-
-(define gnc:split-scm-get-account-guid
-  (record-accessor gnc:split-structure 'account-guid))
-
-(define gnc:split-scm-get-transaction-guid
-  (record-accessor gnc:split-structure 'transaction-guid))
-
-(define gnc:split-scm-get-memo
-  (record-accessor gnc:split-structure 'memo))
-
-(define gnc:split-scm-get-action
-  (record-accessor gnc:split-structure 'action))
-
-(define gnc:split-scm-get-reconcile-state
-  (record-accessor gnc:split-structure 'reconcile-state))
-
-(define gnc:split-scm-get-reconciled-date
-  (record-accessor gnc:split-structure 'reconciled-date))
-
-(define gnc:split-scm-get-amount
-  (record-accessor gnc:split-structure 'amount))
-
-(define gnc:split-scm-get-value
-  (record-accessor gnc:split-structure 'value))
-
-;; modifiers
-(define gnc:split-scm-set-split-guid
-  (record-modifier gnc:split-structure 'split-guid))
-
-(define gnc:split-scm-set-account-guid
-  (record-modifier gnc:split-structure 'account-guid))
-
-(define gnc:split-scm-set-transaction-guid
-  (record-modifier gnc:split-structure 'transaction-guid))
-
-(define gnc:split-scm-set-memo
-  (record-modifier gnc:split-structure 'memo))
-
-(define gnc:split-scm-set-action
-  (record-modifier gnc:split-structure 'action))
-
-(define gnc:split-scm-set-reconcile-state
-  (record-modifier gnc:split-structure 'reconcile-state))
-
-(define gnc:split-scm-set-reconciled-date
-  (record-modifier gnc:split-structure 'reconciled-date))
-
-(define gnc:split-scm-set-amount
-  (record-modifier gnc:split-structure 'amount))
-
-(define gnc:split-scm-set-value
-  (record-modifier gnc:split-structure 'value))
-
-;; This function take a C split and returns a representation
-;; of it as a split-structure. Assumes the transaction is open
-;; for editing.
-(define (gnc:split->split-scm split use-cut-semantics?)
-  (gnc:make-split-scm
-   (gncSplitGetGUID split)
-   (gncAccountGetGUID (xaccSplitGetAccount split))
-   (gncTransGetGUID (xaccSplitGetParent split))
-   (xaccSplitGetMemo split)
-   (xaccSplitGetAction split)
-   (xaccSplitGetReconcile split)
-   (xaccSplitGetDateReconciled split)
-   (xaccSplitGetAmount split)
-   (xaccSplitGetValue split)))
-
-;; Copy a scheme representation of a split onto a C split.
-;; If possible, insert the C split into the account of the
-;; scheme split. Not all values are copied. The reconcile
-;; status and date are not copied. The C split's guid is,
-;; of course, unchanged.
-(define (gnc:split-scm-onto-split split-scm split book)
-  (if (null? split)
-      #f
-      (begin
-        (let ((memo     (gnc:split-scm-get-memo split-scm))
-              (action   (gnc:split-scm-get-action split-scm))
-              (amount   (gnc:split-scm-get-amount split-scm))
-              (value    (gnc:split-scm-get-value split-scm)))
-          (if memo     (xaccSplitSetMemo split memo))
-          (if action   (xaccSplitSetAction split action))
-          (if amount   (xaccSplitSetAmount split amount))
-          (if value    (xaccSplitSetValue split value)))
-        (let ((account (xaccAccountLookup
-                        (gnc:split-scm-get-account-guid split-scm)
-                        book)))
-          (if (not (null? account))
-              (begin
-                (xaccAccountBeginEdit account)
-                (xaccSplitSetAccount split account)
-                (xaccAccountCommitEdit account)))))))
-
-;; Defines a scheme representation of a transaction.
-(define gnc:transaction-structure
-  (make-record-type
-   "gnc:transaction-structure"
-   '(transaction-guid currency date-entered date-posted
-                      num description notes association split-scms)))
-
-;; constructor
-(define gnc:make-transaction-scm
-  (record-constructor gnc:transaction-structure))
-
-;; type predicate
-(define gnc:transaction-scm?
-  (record-predicate gnc:transaction-structure))
-
-;; accessors
-(define gnc:transaction-scm-get-transaction-guid
-  (record-accessor gnc:transaction-structure 'transaction-guid))
-
-(define gnc:transaction-scm-get-currency
-  (record-accessor gnc:transaction-structure 'currency))
-
-(define gnc:transaction-scm-get-date-entered
-  (record-accessor gnc:transaction-structure 'date-entered))
-
-(define gnc:transaction-scm-get-date-posted
-  (record-accessor gnc:transaction-structure 'date-posted))
-
-(define gnc:transaction-scm-get-num
-  (record-accessor gnc:transaction-structure 'num))
-
-(define gnc:transaction-scm-get-description
-  (record-accessor gnc:transaction-structure 'description))
-
-(define gnc:transaction-scm-get-notes
-  (record-accessor gnc:transaction-structure 'notes))
-
-(define gnc:transaction-scm-get-association
-  (record-accessor gnc:transaction-structure 'association))
-
-(define gnc:transaction-scm-get-split-scms
-  (record-accessor gnc:transaction-structure 'split-scms))
-
-(define (gnc:transaction-scm-get-split-scm trans-scm index)
-  (let ((split-scms (gnc:transaction-scm-get-split-scms trans-scm)))
-    (cond ((< index 0) #f)
-          ((not (pair? split-scms)) #f)
-          ((>= index (length split-scms)) #f)
-          (else (list-ref split-scms index)))))
-
-(define (gnc:transaction-scm-get-other-split-scm trans-scm split-scm)
-  (let ((split-scms (gnc:transaction-scm-get-split-scms trans-scm)))
-  (cond ((not (= (length split-scms) 2)) #f)
-        ((eq? split-scm (car split-scms)) (cadr split-scms))
-        (else (car split-scms)))))
-
-;; modifiers
-(define gnc:transaction-scm-set-transaction-guid
-  (record-modifier gnc:transaction-structure 'transaction-guid))
-
-(define gnc:transaction-scm-set-currency
-  (record-modifier gnc:transaction-structure 'currency))
-
-(define gnc:transaction-scm-set-date-entered
-  (record-modifier gnc:transaction-structure 'date-entered))
-
-(define gnc:transaction-scm-set-date-posted
-  (record-modifier gnc:transaction-structure 'date-posted))
-
-(define gnc:transaction-scm-set-num
-  (record-modifier gnc:transaction-structure 'num))
-
-(define gnc:transaction-scm-set-description
-  (record-modifier gnc:transaction-structure 'description))
-
-(define gnc:transaction-scm-set-notes
-  (record-modifier gnc:transaction-structure 'notes))
-
-(define gnc:transaction-scm-set-association
-  (record-modifier gnc:transaction-structure 'association))
-
-(define gnc:transaction-scm-set-split-scms
-  (record-modifier gnc:transaction-structure 'split-scms))
-
-(define (gnc:transaction-scm-append-split-scm trans-scm split-scm)
-  (let ((split-scms (gnc:transaction-scm-get-split-scms trans-scm)))
-    (gnc:transaction-scm-set-split-scms
-     trans-scm (append split-scms (list split-scm)))))
-
-;; This function takes a C transaction and returns
-;; a representation of it as a transaction-structure.
-(define (gnc:transaction->transaction-scm trans use-cut-semantics?)
-  (define (trans-splits i)
-    (let ((split (xaccTransGetSplit trans i)))
-      (if (null? split)
-          '()
-          (cons (gnc:split->split-scm split use-cut-semantics?)
-                (trans-splits (+ i 1))))))
-  (gnc:make-transaction-scm
-   (gncTransGetGUID trans)
-   (xaccTransGetCurrency trans)
-   (xaccTransGetDateEntered trans)
-   (if use-cut-semantics?
-       (xaccTransGetDate trans)
-       #f)
-   (if use-cut-semantics?
-       (xaccTransGetNum trans)
-       #f)
-   (xaccTransGetDescription trans)
-   (xaccTransGetNotes trans)
-   (xaccTransGetAssociation trans)
-   (trans-splits 0)))
-
-;; Copy a scheme representation of a transaction onto a C transaction.
-;; guid-mapping must be an alist, mapping guids to guids. This list is
-;; used to use alternate account guids when creating splits.
-(define (gnc:transaction-scm-onto-transaction trans-scm trans guid-mapping
-                                              commit? book)
-  (if (null? trans)
-      #f
-      (begin
-        ;; open the transaction for editing
-        (if (not (xaccTransIsOpen trans))
-            (xaccTransBeginEdit trans))
-
-        ;; copy in the transaction values
-        (let ((currency    (gnc:transaction-scm-get-currency trans-scm))
-              (description (gnc:transaction-scm-get-description trans-scm))
-              (num         (gnc:transaction-scm-get-num trans-scm))
-              (notes       (gnc:transaction-scm-get-notes trans-scm))
-              (association (gnc:transaction-scm-get-association trans-scm))
-              (date-posted (gnc:transaction-scm-get-date-posted trans-scm)))
-          (if currency    (xaccTransSetCurrency trans currency))
-          (if description (xaccTransSetDescription trans description))
-          (if num         (xaccTransSetNum trans num))
-          (if notes       (xaccTransSetNotes trans notes))
-          (if association (xaccTransSetAssociation trans association))
-          (if date-posted (xaccTransSetDatePostedSecs trans date-posted)))
-
-        ;; strip off the old splits
-        (for-each (lambda (split)
-                    (xaccSplitDestroy split))
-                  (xaccTransGetSplitList trans))
-
-        ;; and put on the new ones! Please note they go in the *same*
-        ;; order as in the original transaction. This is important.
-        (for-each 
-         (lambda (split-scm) 
-           (let* ((new-split (xaccMallocSplit book))
-                  (old-guid  (gnc:split-scm-get-account-guid split-scm))
-                  (new-guid  (assoc-ref guid-mapping old-guid)))
-             (if (not new-guid)
-                 (set! new-guid old-guid))
-             (gnc:split-scm-set-account-guid split-scm new-guid)
-             (gnc:split-scm-onto-split split-scm new-split book)
-             (gnc:split-scm-set-account-guid split-scm old-guid)
-             (xaccSplitSetParent new-split trans)))
-         (gnc:transaction-scm-get-split-scms trans-scm))
-        
-        ;; close the transaction
-        (if commit?
-            (xaccTransCommitEdit trans)))))
diff --git a/libgnucash/engine/engine.scm b/libgnucash/engine/engine.scm
index 71e39fa96..f9f1a10f9 100644
--- a/libgnucash/engine/engine.scm
+++ b/libgnucash/engine/engine.scm
@@ -66,56 +66,6 @@
 (export account-full-name<?)
 (export accounts-get-children-depth)
 
-(export gnc:split-structure)
-(export gnc:make-split-scm)
-(export gnc:split-scm?)
-(export gnc:split-scm-get-split-guid)
-(export gnc:split-scm-get-account-guid)
-(export gnc:split-scm-get-transaction-guid)
-(export gnc:split-scm-get-memo)
-(export gnc:split-scm-get-action)
-(export gnc:split-scm-get-reconcile-state)
-(export gnc:split-scm-get-reconciled-date)
-(export gnc:split-scm-get-amount)
-(export gnc:split-scm-get-value)
-(export gnc:split-scm-set-split-guid)
-(export gnc:split-scm-set-account-guid)
-(export gnc:split-scm-set-transaction-guid)
-(export gnc:split-scm-set-memo)
-(export gnc:split-scm-set-action)
-(export gnc:split-scm-set-reconcile-state)
-(export gnc:split-scm-set-reconciled-date)
-(export gnc:split-scm-set-amount)
-(export gnc:split-scm-set-value)
-(export gnc:split->split-scm)
-(export gnc:split-scm-onto-split)
-(export gnc:transaction-structure)
-(export gnc:make-transaction-scm)
-(export gnc:transaction-scm?)
-(export gnc:transaction-scm-get-transaction-guid)
-(export gnc:transaction-scm-get-currency)
-(export gnc:transaction-scm-get-date-entered)
-(export gnc:transaction-scm-get-date-posted)
-(export gnc:transaction-scm-get-num)
-(export gnc:transaction-scm-get-description)
-(export gnc:transaction-scm-get-notes)
-(export gnc:transaction-scm-get-split-scms)
-(export gnc:transaction-scm-get-split-scm)
-(export gnc:transaction-scm-get-other-split-scm)
-(export gnc:transaction-scm-set-transaction-guid)
-(export gnc:transaction-scm-set-currency)
-(export gnc:transaction-scm-set-date-entered)
-(export gnc:transaction-scm-set-date-posted)
-(export gnc:transaction-scm-set-num)
-(export gnc:transaction-scm-set-description)
-(export gnc:transaction-scm-set-notes)
-(export gnc:transaction-scm-set-split-scms)
-(export gnc:transaction-scm-append-split-scm)
-(export gnc:transaction->transaction-scm)
-(export trans-splits)
-(export gnc:transaction-scm-onto-transaction)
-
 (load-from-path "gnucash/engine/gnc-numeric")
 (load-from-path "gnucash/engine/commodity-table")
-(load-from-path "gnucash/engine/engine-interface")
 (load-from-path "gnucash/engine/engine-utilities")
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 4a1ce9936..1c147ff05 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -381,7 +381,6 @@ gnucash/register/ledger-core/gncmod-ledger-core.c
 gnucash/register/ledger-core/split-register.c
 gnucash/register/ledger-core/split-register-control.c
 gnucash/register/ledger-core/split-register-copy-ops.c
-gnucash/register/ledger-core/split-register-copy-ops-internals.c
 gnucash/register/ledger-core/split-register-layout.c
 gnucash/register/ledger-core/split-register-load.c
 gnucash/register/ledger-core/split-register-model.c

commit cb273b13a1269cf089c27e21192da444297fe3ae
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Fri Dec 6 18:52:12 2019 +0100

    split register - use C copy interface instead of scm copy interface

diff --git a/gnucash/register/ledger-core/split-register.c b/gnucash/register/ledger-core/split-register.c
index 37c384724..03cefca56 100644
--- a/gnucash/register/ledger-core/split-register.c
+++ b/gnucash/register/ledger-core/split-register.c
@@ -27,7 +27,6 @@
 
 #include <glib.h>
 #include <glib/gi18n.h>
-#include <libguile.h>
 
 #include "combocell.h"
 #include "datecell.h"
@@ -40,7 +39,7 @@
 #include "gnc-ui.h"
 #include "gnc-warnings.h"
 #include "guile-util.h"
-#include "split-register-copy-ops.h"
+#include "split-register-copy-ops-internals.h"
 #include "numcell.h"
 #include "pricecell.h"
 #include "quickfillcell.h"
@@ -63,13 +62,24 @@
 static QofLogModule log_module = GNC_MOD_LEDGER;
 
 /* The copied split or transaction, if any */
+typedef struct
+{
+    GType ftype;
+    union
+    {
+        FloatingSplit *fs;
+        FloatingTxn *ft;
+    };
+} ft_fs_store;
+
+static ft_fs_store copied_item = { 0, { NULL } };
 static CursorClass copied_class = CURSOR_CLASS_NONE;
-static SCM copied_item = SCM_UNDEFINED;
 static GncGUID copied_leader_guid;
+
 /** static prototypes *****************************************************/
 
-static gboolean gnc_split_register_save_to_scm (SplitRegister *reg,
-        SCM trans_scm, SCM split_scm,
+static gboolean gnc_split_register_save_to_copy_buffer (SplitRegister *reg,
+        FloatingTxn *ft, FloatingSplit *fs,
         gboolean use_cut_semantics);
 static gboolean gnc_split_register_auto_calc (SplitRegister *reg,
         Split *split);
@@ -77,39 +87,36 @@ static gboolean gnc_split_register_auto_calc (SplitRegister *reg,
 
 /** implementations *******************************************************/
 
-/* Uses the scheme split copying routines */
 static void
 gnc_copy_split_onto_split(Split *from, Split *to, gboolean use_cut_semantics)
 {
-    SCM split_scm;
+    FloatingSplit *fs;
 
     if ((from == NULL) || (to == NULL))
         return;
 
-    split_scm = gnc_copy_split(from, use_cut_semantics);
-    if (split_scm == SCM_UNDEFINED)
+    fs = gnc_split_to_float_split (from);
+    if (!fs)
         return;
 
-    gnc_copy_split_scm_onto_split(split_scm, to, gnc_get_current_book ());
+    gnc_float_split_to_split (fs, to);
 }
 
-/* Uses the scheme transaction copying routines */
 void
 gnc_copy_trans_onto_trans(Transaction *from, Transaction *to,
                           gboolean use_cut_semantics,
                           gboolean do_commit)
 {
-    SCM trans_scm;
+    FloatingTxn *ft;
 
     if ((from == NULL) || (to == NULL))
         return;
 
-    trans_scm = gnc_copy_trans(from, use_cut_semantics);
-    if (trans_scm == SCM_UNDEFINED)
+    ft = gnc_txn_to_float_txn (from, use_cut_semantics);
+    if (!ft)
         return;
 
-    gnc_copy_trans_scm_onto_trans(trans_scm, to, do_commit,
-                                  gnc_get_current_book ());
+    gnc_float_txn_to_txn (ft, to, do_commit);
 }
 
 static int
@@ -706,7 +713,8 @@ gnc_split_register_copy_current_internal (SplitRegister *reg,
     Split *blank_split;
     gboolean changed;
     Split *split;
-    SCM new_item;
+    FloatingSplit *new_fs = NULL;
+    FloatingTxn *new_ft = NULL;
 
     g_return_if_fail(reg);
     ENTER("reg=%p, use_cut_semantics=%s", reg,
@@ -762,12 +770,12 @@ gnc_split_register_copy_current_internal (SplitRegister *reg,
     if (cursor_class == CURSOR_CLASS_SPLIT)
     {
         /* We are on a split in an expanded transaction. Just copy the split. */
-        new_item = gnc_copy_split(split, use_cut_semantics);
+        new_fs = gnc_split_to_float_split (split);
 
-        if (new_item != SCM_UNDEFINED)
+        if (new_fs)
         {
             if (changed)
-                gnc_split_register_save_to_scm (reg, SCM_UNDEFINED, new_item,
+                gnc_split_register_save_to_copy_buffer (reg, NULL, new_fs,
                                                 use_cut_semantics);
 
             copied_leader_guid = *guid_null();
@@ -776,22 +784,22 @@ gnc_split_register_copy_current_internal (SplitRegister *reg,
     else
     {
         /* We are on a transaction row. Copy the whole transaction. */
-        new_item = gnc_copy_trans(trans, use_cut_semantics);
+        new_ft = gnc_txn_to_float_txn (trans, use_cut_semantics);
 
-        if (new_item != SCM_UNDEFINED)
+        if (new_ft)
         {
             if (changed)
             {
                 int split_index;
-                SCM split_scm;
+                FloatingSplit *fs;
 
                 split_index = xaccTransGetSplitIndex(trans, split);
                 if (split_index >= 0)
-                    split_scm = gnc_trans_scm_get_split_scm(new_item, split_index);
+                    fs = gnc_float_txn_get_float_split(new_ft, split_index);
                 else
-                    split_scm = SCM_UNDEFINED;
+                    fs = NULL;
 
-                gnc_split_register_save_to_scm (reg, new_item, split_scm,
+                gnc_split_register_save_to_copy_buffer (reg, new_ft, fs,
                                                 use_cut_semantics);
             }
 
@@ -799,7 +807,7 @@ gnc_split_register_copy_current_internal (SplitRegister *reg,
         }
     }
 
-    if (new_item == SCM_UNDEFINED)
+    if (!new_fs && !new_ft)
     {
         g_warning("BUG DETECTED: copy failed");
         LEAVE("copy failed");
@@ -807,11 +815,22 @@ gnc_split_register_copy_current_internal (SplitRegister *reg,
     }
 
     /* unprotect the old object, if any */
-    if (copied_item != SCM_UNDEFINED)
-        scm_gc_unprotect_object(copied_item);
+    if (copied_item.ftype == GNC_TYPE_SPLIT)
+        g_free (copied_item.fs);
+    if (copied_item.ftype == GNC_TYPE_TRANSACTION)
+        g_free (copied_item.ft);
+    copied_item.ftype = 0;
 
-    copied_item = new_item;
-    scm_gc_protect_object(copied_item);
+    if (new_fs)
+    {
+        copied_item.fs = new_fs;
+        copied_item.ftype = GNC_TYPE_SPLIT;
+    }
+    else if (new_ft)
+    {
+        copied_item.ft = new_ft;
+        copied_item.ftype = GNC_TYPE_TRANSACTION;
+    }
 
     copied_class = cursor_class;
     LEAVE("%s %s", use_cut_semantics ? "cut" : "copied",
@@ -970,8 +989,13 @@ gnc_split_register_paste_current (SplitRegister *reg)
             xaccSplitSetParent(split, trans);
         }
 
-        gnc_copy_split_scm_onto_split(copied_item, split,
-                                      gnc_get_current_book ());
+        if (copied_item.ftype != GNC_TYPE_SPLIT)
+        {
+            LEAVE("copy buffer doesn't represent a split");
+            return;
+        }
+
+        gnc_float_split_to_split (copied_item.fs, split);
     }
     else
     {
@@ -979,6 +1003,7 @@ gnc_split_register_paste_current (SplitRegister *reg)
                                 "transaction. "
                                 "Are you sure you want to do that?");
         Account * copied_leader;
+        Account * default_account;
         const GncGUID *new_guid;
         int trans_split_index;
         int split_index;
@@ -990,6 +1015,13 @@ gnc_split_register_paste_current (SplitRegister *reg)
             return;
         }
 
+
+        if (copied_item.ftype != GNC_TYPE_TRANSACTION)
+        {
+            LEAVE("copy buffer doesn't represent a transaction");
+            return;
+        }
+
         /* Ask before overwriting an existing transaction. */
         if (split != blank_split &&
                 !gnc_verify_dialog (GTK_WINDOW (gnc_split_register_get_parent (reg)),
@@ -1016,17 +1048,15 @@ gnc_split_register_paste_current (SplitRegister *reg)
 
         copied_leader = xaccAccountLookup(&copied_leader_guid,
                                           gnc_get_current_book());
-        if (copied_leader && (gnc_split_register_get_default_account(reg) != NULL))
+        default_account = gnc_split_register_get_default_account(reg);
+        if (copied_leader && default_account)
         {
-            new_guid = &info->default_account;
-            gnc_copy_trans_scm_onto_trans_swap_accounts(copied_item, trans,
-                    &copied_leader_guid,
-                    new_guid, FALSE,
-                    gnc_get_current_book ());
+            gnc_float_txn_to_txn_swap_accounts (copied_item.ft, trans,
+                    copied_leader,
+                    default_account, FALSE);
         }
         else
-            gnc_copy_trans_scm_onto_trans(copied_item, trans, FALSE,
-                                          gnc_get_current_book ());
+            gnc_float_txn_to_txn (copied_item.ft, trans, FALSE);
 
         num_splits = xaccTransCountSplits(trans);
         if (split_index >= num_splits)
@@ -1445,11 +1475,11 @@ gnc_split_register_redraw (SplitRegister *reg)
 /* Copy from the register object to scheme. This needs to be
  * in sync with gnc_split_register_save and xaccSRSaveChangedCells. */
 static gboolean
-gnc_split_register_save_to_scm (SplitRegister *reg,
-                                SCM trans_scm, SCM split_scm,
+gnc_split_register_save_to_copy_buffer (SplitRegister *reg,
+                                FloatingTxn *ft, FloatingSplit *fs,
                                 gboolean use_cut_semantics)
 {
-    SCM other_split_scm = SCM_UNDEFINED;
+    FloatingSplit *other_fs = NULL;
     Transaction *trans;
 
     /* use the changed flag to avoid heavy-weight updates
@@ -1519,7 +1549,7 @@ gnc_split_register_save_to_scm (SplitRegister *reg,
         cell = gnc_table_layout_get_cell (reg->table->layout, RECN_CELL);
         flag = gnc_recn_cell_get_flag ((RecnCell *) cell);
 
-        gnc_split_scm_set_reconcile_state(split_scm, flag);
+        gnc_float_split_set_reconcile_state (fs, flag);
     }
 
     if (gnc_table_layout_get_cell_changed (reg->table->layout, ACTN_CELL, TRUE))
@@ -1527,7 +1557,7 @@ gnc_split_register_save_to_scm (SplitRegister *reg,
         const char *value;
 
         value = gnc_table_layout_get_cell_value (reg->table->layout, ACTN_CELL);
-        gnc_split_scm_set_action (split_scm, value);
+        gnc_float_split_set_action (fs, value);
     }
 
     if (gnc_table_layout_get_cell_changed (reg->table->layout, MEMO_CELL, TRUE))
@@ -1535,7 +1565,7 @@ gnc_split_register_save_to_scm (SplitRegister *reg,
         const char *value;
 
         value = gnc_table_layout_get_cell_value (reg->table->layout, MEMO_CELL);
-        gnc_split_scm_set_memo (split_scm, value);
+        gnc_float_split_set_memo (fs, value);
     }
 
     if (gnc_table_layout_get_cell_changed (reg->table->layout, XFRM_CELL, TRUE))
@@ -1545,38 +1575,38 @@ gnc_split_register_save_to_scm (SplitRegister *reg,
         new_account = gnc_split_register_get_account (reg, XFRM_CELL);
 
         if (new_account != NULL)
-            gnc_split_scm_set_account (split_scm, new_account);
+            gnc_float_split_set_account (fs, new_account);
     }
 
     if (reg->style == REG_STYLE_LEDGER)
-        other_split_scm = gnc_trans_scm_get_other_split_scm (trans_scm, split_scm);
+        other_fs = gnc_float_txn_get_other_float_split (ft, fs);
 
     if (gnc_table_layout_get_cell_changed (reg->table->layout, MXFRM_CELL, TRUE))
     {
-        other_split_scm = gnc_trans_scm_get_other_split_scm (trans_scm, split_scm);
+        other_fs = gnc_float_txn_get_other_float_split (ft, fs);
 
-        if (other_split_scm == SCM_UNDEFINED)
+        if (!other_fs)
         {
-            if (gnc_trans_scm_get_num_splits(trans_scm) == 1)
+            if (g_list_length (ft->m_splits) == 1)
             {
                 Split *temp_split;
 
                 temp_split = xaccMallocSplit (gnc_get_current_book ());
-                other_split_scm = gnc_copy_split (temp_split, use_cut_semantics);
+                other_fs = gnc_split_to_float_split (temp_split);
                 xaccSplitDestroy (temp_split);
 
-                gnc_trans_scm_append_split_scm (trans_scm, other_split_scm);
+                gnc_float_txn_append_float_split (ft, other_fs);
             }
         }
 
-        if (other_split_scm != SCM_UNDEFINED)
+        if (other_fs)
         {
             Account *new_account;
 
             new_account = gnc_split_register_get_account (reg, MXFRM_CELL);
 
             if (new_account != NULL)
-                gnc_split_scm_set_account (other_split_scm, new_account);
+                gnc_float_split_set_account (other_fs, new_account);
         }
     }
 
@@ -1598,7 +1628,7 @@ gnc_split_register_save_to_scm (SplitRegister *reg,
 
         new_value = gnc_numeric_sub_fixed (debit, credit);
 
-        gnc_split_scm_set_value (split_scm, new_value);
+        gnc_float_split_set_value (fs, new_value);
     }
 
     if (gnc_table_layout_get_cell_changed (reg->table->layout, PRIC_CELL, TRUE))
@@ -1615,7 +1645,7 @@ gnc_split_register_save_to_scm (SplitRegister *reg,
 
         shares = gnc_price_cell_get_value ((PriceCell *) cell);
 
-        gnc_split_scm_set_amount (split_scm, shares);
+        gnc_float_split_set_amount (fs, shares);
     }
 
     if (gnc_table_layout_get_cell_changed (reg->table->layout,
@@ -1627,15 +1657,15 @@ gnc_split_register_save_to_scm (SplitRegister *reg,
             gnc_table_layout_get_cell_changed (reg->table->layout,
                     SHRS_CELL, TRUE))
     {
-        if (other_split_scm != SCM_UNDEFINED)
+        if (other_fs)
         {
             gnc_numeric num;
 
-            num = gnc_split_scm_get_amount (split_scm);
-            gnc_split_scm_set_amount (other_split_scm, gnc_numeric_neg (num));
+            num = gnc_float_split_get_amount (fs);
+            gnc_float_split_set_amount (other_fs, gnc_numeric_neg (num));
 
-            num = gnc_split_scm_get_value (split_scm);
-            gnc_split_scm_set_value (other_split_scm, gnc_numeric_neg (num));
+            num = gnc_float_split_get_value (fs);
+            gnc_float_split_set_value (other_fs, gnc_numeric_neg (num));
         }
     }
 

commit 543fab25135d7f4b372d2d736436e4137f8442fe
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Thu Oct 10 18:08:42 2019 +0200

    split-register - port copy operations from scm to c
    
    This is done with minimal interpretation, to be able to easily
    compare with the original scheme code.
    It will most likely be optimized in future commits

diff --git a/gnucash/register/ledger-core/CMakeLists.txt b/gnucash/register/ledger-core/CMakeLists.txt
index 0b671cee2..158764f3a 100644
--- a/gnucash/register/ledger-core/CMakeLists.txt
+++ b/gnucash/register/ledger-core/CMakeLists.txt
@@ -8,6 +8,7 @@ set (ledger_core_SOURCES
   split-register.c
   split-register-control.c
   split-register-copy-ops.c
+  split-register-copy-ops-internals.c
   split-register-layout.c
   split-register-load.c
   split-register-model.c
@@ -28,6 +29,7 @@ set (ledger_core_HEADERS
   split-register.h
   split-register-control.h
   split-register-copy-ops.h
+  split-register-copy-ops-internals.h
   split-register-layout.h
   split-register-model.h
   split-register-model-save.h
diff --git a/gnucash/register/ledger-core/split-register-copy-ops-internals.c b/gnucash/register/ledger-core/split-register-copy-ops-internals.c
new file mode 100644
index 000000000..a7a241e94
--- /dev/null
+++ b/gnucash/register/ledger-core/split-register-copy-ops-internals.c
@@ -0,0 +1,429 @@
+/********************************************************************\
+ * split-register-copy-ops-internals.c -- internal details of       *
+ *                 copy/paste semantics for transactions and splits *
+ * Port to C of engine-interface                                    *
+ * originally written by Dave Peticolas <dave at krondo.com>           *
+ * © 2019 Geert Janssens
+ *                                                                  *
+ * This program is free software; you can redistribute it and/or    *
+ * modify it under the terms of the GNU General Public License as   *
+ * published by the Free Software Foundation; either version 2 of   *
+ * the License, or (at your option) any later version.              *
+ *                                                                  *
+ * This program is distributed in the hope that it will be useful,  *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
+ * GNU General Public License for more details.                     *
+ *                                                                  *
+ * You should have received a copy of the GNU General Public License*
+ * along with this program; if not, write to the Free Software      *
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.        *
+\********************************************************************/
+
+#include <glib.h>
+
+#include "config.h"
+#include "split-register-copy-ops-internals.h"
+
+/* accessors */
+Split *gnc_float_split_get_split (const FloatingSplit *fs)
+{
+    g_return_val_if_fail (fs, NULL);
+    return fs->m_split;
+}
+
+Account *gnc_float_split_get_account (const FloatingSplit *fs) /* direct account pointer rather than account guid */
+{
+    g_return_val_if_fail (fs, NULL);
+    return fs->m_account;
+}
+
+Transaction *gnc_float_split_get_transaction (const FloatingSplit *fs) /* direct transaction pointer rather than transaction guid */
+{
+    g_return_val_if_fail (fs, NULL);
+    return fs->m_transaction;
+}
+
+const char *gnc_float_split_get_memo (const FloatingSplit *fs)
+{
+    g_return_val_if_fail (fs, NULL);
+    return fs->m_memo;
+}
+
+const char *gnc_float_split_get_action (const FloatingSplit *fs)
+{
+    g_return_val_if_fail (fs, NULL);
+    return fs->m_action;
+}
+
+char gnc_float_split_get_reconcile_state (const FloatingSplit *fs)
+{
+    g_return_val_if_fail (fs, '\0');
+    return fs->m_reconcile_state;
+}
+
+time64 gnc_float_split_get_reconcile_date (const FloatingSplit *fs)
+{
+    g_return_val_if_fail (fs, G_MAXINT64);
+    return fs->m_reconcile_date;
+}
+
+gnc_numeric gnc_float_split_get_amount (const FloatingSplit *fs)
+{
+    g_return_val_if_fail (fs, gnc_numeric_zero());
+    return fs->m_amount;
+}
+
+gnc_numeric gnc_float_split_get_value (const FloatingSplit *fs)
+{
+    g_return_val_if_fail (fs, gnc_numeric_zero());
+    return fs->m_value;
+}
+
+
+/* modifiers */
+void gnc_float_split_set_split(FloatingSplit *fs, Split *split)
+{
+    g_return_if_fail (fs);
+    fs->m_split = split;
+};
+
+void gnc_float_split_set_account (FloatingSplit *fs, Account *account) /* direct account pointer rather than account guid */
+{
+    g_return_if_fail (fs);
+    fs->m_account = account;
+};
+
+void gnc_float_split_set_transaction (FloatingSplit *fs, Transaction *transaction) /* direct transaction pointer rather than transaction guid */
+{
+    g_return_if_fail (fs);
+    fs->m_transaction = transaction;
+};
+
+void gnc_float_split_set_memo (FloatingSplit *fs, const char *memo)
+{
+    g_return_if_fail (fs);
+    fs->m_memo = memo;
+};
+
+void gnc_float_split_set_action (FloatingSplit *fs, const char *action)
+{
+    g_return_if_fail (fs);
+    fs->m_action = action;
+};
+
+void gnc_float_split_set_reconcile_state (FloatingSplit *fs, char reconcile_state)
+{
+    g_return_if_fail (fs);
+    fs->m_reconcile_state = reconcile_state;
+};
+
+void gnc_float_split_set_reconcile_date (FloatingSplit *fs, time64 reconcile_date)
+{
+    g_return_if_fail (fs);
+    fs->m_reconcile_date = reconcile_date;
+};
+
+void gnc_float_split_set_amount (FloatingSplit *fs, const gnc_numeric amount)
+{
+    g_return_if_fail (fs);
+
+    fs->m_amount = amount;
+};
+
+void gnc_float_split_set_value (FloatingSplit *fs, const gnc_numeric value)
+{
+    g_return_if_fail (fs);
+
+    fs->m_value = value;
+};
+
+/* This function takes a split and returns a representation
+   of it as a floating_split structure. Assumes the transaction is open
+   for editing.
+*/
+FloatingSplit *gnc_split_to_float_split (Split *split)
+{
+    FloatingSplit *fs;
+
+    g_return_val_if_fail (split, NULL);
+
+    fs = g_new0 (FloatingSplit, 1);
+    fs->m_split = split;
+    fs->m_account = xaccSplitGetAccount (split);
+    fs->m_transaction = xaccSplitGetParent (split);
+    fs->m_memo = xaccSplitGetMemo (split);
+    fs->m_action = xaccSplitGetAction (split);
+    fs->m_reconcile_state = xaccSplitGetReconcile (split);
+    fs->m_reconcile_date = xaccSplitGetDateReconciled (split);
+    fs->m_amount = xaccSplitGetAmount (split);
+    fs->m_value = xaccSplitGetValue (split);
+
+    return fs;
+}
+
+/* Copy a temporary split representation onto a real split.
+   If possible, insert the split into the account of the
+   split representation. Not all values are copied. The reconcile
+   status and date are not copied. The split's guid is,
+   of course, unchanged.
+*/
+void gnc_float_split_to_split (const FloatingSplit *fs, Split *split)
+{
+    g_return_if_fail(split);
+
+    if (fs->m_memo)
+        xaccSplitSetMemo (split, fs->m_memo);
+    if (fs->m_action)
+        xaccSplitSetAction (split, fs->m_action);
+    xaccSplitSetAmount (split, fs->m_amount);
+    xaccSplitSetValue (split, fs->m_value);
+    if (fs->m_account)
+    {
+        xaccAccountBeginEdit (fs->m_account);
+        xaccSplitSetAccount (split, fs->m_account);
+        xaccAccountCommitEdit (fs->m_account);
+    }
+}
+
+/* accessors */
+Transaction *gnc_float_txn_get_txn (const FloatingTxn *ft)
+{
+    g_return_val_if_fail (ft, NULL);
+    return ft->m_txn;
+}
+
+gnc_commodity *gnc_float_txn_get_currency (const FloatingTxn *ft)
+{
+    g_return_val_if_fail (ft, NULL);
+    return ft->m_currency;
+}
+
+time64 gnc_float_txn_get_date_entered (const FloatingTxn *ft)
+{
+    g_return_val_if_fail (ft, G_MAXINT64);
+    return ft->m_date_entered;
+}
+
+time64 gnc_float_txn_get_date_posted (const FloatingTxn *ft)
+{
+    g_return_val_if_fail (ft, G_MAXINT64);
+    return ft->m_date_posted;
+}
+
+const char *gnc_float_txn_get_num (const FloatingTxn *ft)
+{
+    g_return_val_if_fail (ft, NULL);
+    return ft->m_num;
+}
+
+const char *gnc_float_txn_get_description (const FloatingTxn *ft)
+{
+    g_return_val_if_fail (ft, NULL);
+    return ft->m_description;
+}
+
+const char *gnc_float_txn_get_notes (const FloatingTxn *ft)
+{
+    g_return_val_if_fail (ft, NULL);
+    return ft->m_notes;
+}
+
+const char *gnc_float_txn_get_association (const FloatingTxn *ft)
+{
+    g_return_val_if_fail (ft, NULL);
+    return ft->m_association;
+}
+
+SplitList *gnc_float_txn_get_splits (const FloatingTxn *ft)
+{
+    g_return_val_if_fail (ft, NULL);
+    return ft->m_splits;
+}
+
+FloatingSplit *gnc_float_txn_get_float_split (const FloatingTxn *ft, guint index)
+{
+    FloatingSplit *fs = NULL;
+    guint size = 0;
+
+    g_return_val_if_fail (ft, NULL);
+    g_return_val_if_fail (ft->m_splits, NULL);
+    g_return_val_if_fail (index < g_list_length (ft->m_splits) , NULL);
+    return g_list_nth_data (ft->m_splits, index);
+}
+
+FloatingSplit *gnc_float_txn_get_other_float_split (const FloatingTxn *ft, FloatingSplit *fs)
+{
+    guint size = 0, other = 0;
+
+    g_return_val_if_fail (ft, NULL);
+    g_return_val_if_fail (ft->m_splits, NULL);
+    g_return_val_if_fail (g_list_length (ft->m_splits) == 2 , NULL);
+
+    if (g_list_nth_data (ft->m_splits, 0) == fs)
+        other = 1;
+
+    return g_list_nth_data (ft->m_splits, other);
+}
+
+/* modifiers */
+void gnc_float_txn_set_txn (FloatingTxn *ft, Transaction *txn)
+{
+    g_return_if_fail (ft);
+    ft->m_txn = txn;
+};
+
+void gnc_float_txn_set_currency (FloatingTxn *ft, gnc_commodity *currency)
+{
+    g_return_if_fail (ft);
+    ft->m_currency = currency;
+};
+
+void gnc_float_txn_set_date_entered (FloatingTxn *ft, time64 date_entered)
+{
+    g_return_if_fail (ft);
+    ft->m_date_entered = date_entered;
+};
+
+void gnc_float_txn_set_date_posted (FloatingTxn *ft, time64 date_posted)
+{
+    g_return_if_fail (ft);
+    ft->m_date_posted = date_posted;
+};
+
+void gnc_float_txn_set_num (FloatingTxn *ft, const char *num)
+{
+    g_return_if_fail (ft);
+    ft->m_num = num;
+};
+
+void gnc_float_txn_set_description (FloatingTxn *ft, const char *description)
+{
+    g_return_if_fail (ft);
+    ft->m_description = description;
+};
+
+void gnc_float_txn_set_notes (FloatingTxn *ft, const char *notes)
+{
+    g_return_if_fail (ft);
+    ft->m_notes = notes;
+};
+
+void gnc_float_txn_set_association (FloatingTxn *ft, const char *association)
+{
+    g_return_if_fail (ft);
+    ft->m_association = association;
+};
+
+void gnc_float_txn_set_splits (FloatingTxn *ft, SplitList *splits)
+{
+    g_return_if_fail (ft);
+    ft->m_splits = splits;
+};
+
+void gnc_float_txn_append_float_split (FloatingTxn *ft, FloatingSplit *fs)
+{
+    g_return_if_fail (ft);
+    g_return_if_fail (fs);
+    ft->m_splits = g_list_append (ft->m_splits, fs);
+}
+
+/* This function takes a C transaction and returns
+   a representation of it as a floating_txn. */
+FloatingTxn *gnc_txn_to_float_txn (Transaction *txn, gboolean use_cut_semantics)
+{
+    GList *iter;
+
+    FloatingTxn *ft = g_new0 (FloatingTxn, 1);
+
+    ft->m_txn = txn;
+    ft->m_currency = xaccTransGetCurrency (txn);
+    ft->m_date_entered = xaccTransGetDateEntered (txn);
+    if (use_cut_semantics)
+    {
+        ft->m_date_posted = xaccTransGetDate (txn);
+        ft->m_num = xaccTransGetNum (txn);
+    }
+    ft->m_description = xaccTransGetDescription (txn);
+    ft->m_notes = xaccTransGetNotes (txn);
+    ft->m_association = xaccTransGetAssociation (txn);
+
+    for (iter = xaccTransGetSplitList (txn); iter ; iter = iter->next)
+    {
+        Split *split = iter->data;
+        if (split)
+        {
+            FloatingSplit *fs = gnc_split_to_float_split (split);
+            ft->m_splits = g_list_prepend (ft->m_splits, fs);
+        }
+    }
+    ft->m_splits = g_list_reverse (ft->m_splits);
+
+    return ft;
+}
+
+void gnc_float_txn_to_txn (const FloatingTxn *ft, Transaction *txn, gboolean do_commit)
+{
+    gnc_float_txn_to_txn_swap_accounts (ft, txn, NULL, NULL, do_commit);
+}
+
+/* Copy a temporary representation of a transaction onto a real transaction.
+ I f they exist the two account*s (acct1 and acct2) are used to swap accounts
+ when when creating splits. */
+void gnc_float_txn_to_txn_swap_accounts (const FloatingTxn *ft, Transaction *txn, Account *acct1, Account *acct2, gboolean do_commit)
+{
+    GList *iter;
+
+    g_return_if_fail (ft);
+    g_return_if_fail (txn);
+
+    if (!xaccTransIsOpen (txn))
+        xaccTransBeginEdit (txn);
+
+    if (ft->m_currency)
+        xaccTransSetCurrency (txn, ft->m_currency);
+    if (ft->m_description)
+        xaccTransSetDescription (txn, ft->m_description);
+    if (ft->m_num)
+        xaccTransSetNum (txn, ft->m_num);
+    if (ft->m_notes)
+        xaccTransSetNotes (txn, ft->m_notes);
+    if (ft->m_association)
+        xaccTransSetAssociation (txn, ft->m_association);
+    if (ft->m_date_posted)
+        xaccTransSetDatePostedSecs (txn, ft->m_date_posted);
+
+    /* strip off the old splits */
+    while (xaccTransCountSplits (txn))
+        xaccSplitDestroy (xaccTransGetSplit (txn, 0));
+
+    /* and put on the new ones! Please note they go in the *same*
+       order as in the original transaction. This is important. */
+    for (iter = ft->m_splits; iter; iter = iter->next)
+    {
+        Account *old_acc, *new_acc;
+        Split *split;
+        FloatingSplit *fs = iter->data;
+        if (!fs)
+            continue;
+
+        split = xaccMallocSplit (xaccTransGetBook (txn));
+
+        old_acc = fs->m_account;
+        if (fs->m_account == acct1)
+            new_acc = acct2;
+        else if  (fs->m_account == acct2)
+            new_acc = acct1;
+        else
+            new_acc = fs->m_account;
+
+        fs->m_account = new_acc;
+        gnc_float_split_to_split (fs, split);
+        fs->m_account = old_acc;
+        xaccSplitSetParent (split, txn);
+    }
+
+    /* close the transaction */
+    if (do_commit)
+        xaccTransCommitEdit (txn);
+}
diff --git a/gnucash/register/ledger-core/split-register-copy-ops-internals.h b/gnucash/register/ledger-core/split-register-copy-ops-internals.h
new file mode 100644
index 000000000..2f4976566
--- /dev/null
+++ b/gnucash/register/ledger-core/split-register-copy-ops-internals.h
@@ -0,0 +1,119 @@
+/********************************************************************\
+ * split-register-copy-ops-internals.c -- internal details of       *
+ *                 copy/paste semantics for transactions and splits *
+ * Port to C of engine-interface                                    *
+ * originally written by Dave Peticolas <dave at krondo.com>           *
+ * © 2019 Geert Janssens
+ *                                                                  *
+ * This program is free software; you can redistribute it and/or    *
+ * modify it under the terms of the GNU General Public License as   *
+ * published by the Free Software Foundation; either version 2 of   *
+ * the License, or (at your option) any later version.              *
+ *                                                                  *
+ * This program is distributed in the hope that it will be useful,  *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
+ * GNU General Public License for more details.                     *
+ *                                                                  *
+ * You should have received a copy of the GNU General Public License*
+ * along with this program; if not, write to the Free Software      *
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.        *
+ * \********************************************************************/
+
+#ifndef SPLIT_REGISTER_COPY_OPS_INTERNAL_H
+#define SPLIT_REGISTER_COPY_OPS_INTERNAL_H
+
+#include <glib.h>
+
+#include "gnc-engine.h"   /* for typedefs */
+#include "qof.h"
+
+#include "guid.h"
+#include "Split.h"
+#include "Account.h"
+#include "Transaction.h"
+
+typedef struct
+{
+    Split       *m_split;
+    Account     *m_account;
+    Transaction *m_transaction;
+    const char  *m_memo;
+    const char  *m_action;
+    time64       m_reconcile_date;
+    char         m_reconcile_state;
+    gnc_numeric  m_value;
+    gnc_numeric  m_amount;
+} FloatingSplit;
+
+typedef struct
+{
+    Transaction *m_txn;
+    gnc_commodity *m_currency;
+    time64 m_date_entered;
+    time64 m_date_posted;
+    const char *m_num;
+    const char *m_description;
+    const char *m_notes;
+    const char *m_association;
+    SplitList *m_splits;
+} FloatingTxn;
+
+/* accessors */
+Split *gnc_float_split_get_split(const FloatingSplit* fs);
+Account *gnc_float_split_get_account (const FloatingSplit *fs); /* direct account pointer rather than account guid */
+Transaction *gnc_float_split_get_transaction (const FloatingSplit *fs); /* direct transaction pointer rather than transaction guid */
+const char *gnc_float_split_get_memo (const FloatingSplit *fs);
+const char *gnc_float_split_get_action (const FloatingSplit *fs);
+char gnc_float_split_get_reconcile_state (const FloatingSplit *fs);
+time64 gnc_float_split_get_reconcile_date (const FloatingSplit *fs);
+gnc_numeric gnc_float_split_get_amount (const FloatingSplit *fs);
+gnc_numeric gnc_float_split_get_value (const FloatingSplit *fs);
+
+/* modifiers */
+void gnc_float_split_set_split (FloatingSplit *fs, Split *split);
+void gnc_float_split_set_account (FloatingSplit *fs, Account *account); /* direct account pointer rather than account guid */
+void gnc_float_split_set_transaction (FloatingSplit *fs, Transaction *transaction); /* direct transaction pointer rather than transaction guid */
+void gnc_float_split_set_memo (FloatingSplit *fs, const char *memo);
+void gnc_float_split_set_action (FloatingSplit *fs, const char *action);
+void gnc_float_split_set_reconcile_state (FloatingSplit *fs, char reconcile_state);
+void gnc_float_split_set_reconcile_date (FloatingSplit *fs, time64 reconcile_date);
+void gnc_float_split_set_amount (FloatingSplit *fs, gnc_numeric amount);
+void gnc_float_split_set_value (FloatingSplit *fs, gnc_numeric value);
+
+FloatingSplit *gnc_split_to_float_split (Split *split);
+void gnc_float_split_to_split (const FloatingSplit *fs, Split *split);
+
+/* accessors */
+Transaction *gnc_float_txn_get_txn (const FloatingTxn *ft);
+gnc_commodity *gnc_float_txn_get_currency (const FloatingTxn *ft);
+time64 gnc_float_txn_get_date_entered (const FloatingTxn *ft);
+time64 gnc_float_txn_get_date_posted (const FloatingTxn *ft);
+const char *gnc_float_txn_get_num (const FloatingTxn *ft);
+const char *gnc_float_txn_get_description (const FloatingTxn *ft);
+const char *gnc_float_txn_get_notes (const FloatingTxn *ft);
+const char *gnc_float_txn_get_association (const FloatingTxn *ft);
+SplitList *gnc_float_txn_get_splits (const FloatingTxn *ft);
+
+FloatingSplit *gnc_float_txn_get_float_split (const FloatingTxn *ft, guint index);
+FloatingSplit *gnc_float_txn_get_other_float_split (const FloatingTxn *ft, FloatingSplit *fs);
+
+/* modifiers */
+void gnc_float_txn_set_txn (FloatingTxn *ft, Transaction *txn);
+void gnc_float_txn_set_currency (FloatingTxn *ft, gnc_commodity *currency);
+void gnc_float_txn_set_date_entered (FloatingTxn *ft, time64 date_entered);
+void gnc_float_txn_set_date_posted (FloatingTxn *ft, time64 date_posted);
+void gnc_float_txn_set_num (FloatingTxn *ft, const char *num);
+void gnc_float_txn_set_description (FloatingTxn *ft, const char *description);
+void gnc_float_txn_set_notes (FloatingTxn *ft, const char *notes);
+void gnc_float_txn_set_association (FloatingTxn *ft, const char *association);
+void gnc_float_txn_set_splits (FloatingTxn *ft, SplitList *splits);
+
+void gnc_float_txn_append_float_split (FloatingTxn *ft, FloatingSplit *fs);
+
+FloatingTxn *gnc_txn_to_float_txn (Transaction *txn, gboolean use_cut_semantics);
+
+void gnc_float_txn_to_txn (const FloatingTxn *ft, Transaction *txn, gboolean do_commit);
+void gnc_float_txn_to_txn_swap_accounts (const FloatingTxn *ft, Transaction *txn, Account *acct1, Account *acct2, gboolean do_commit);
+
+#endif
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 1c147ff05..4a1ce9936 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -381,6 +381,7 @@ gnucash/register/ledger-core/gncmod-ledger-core.c
 gnucash/register/ledger-core/split-register.c
 gnucash/register/ledger-core/split-register-control.c
 gnucash/register/ledger-core/split-register-copy-ops.c
+gnucash/register/ledger-core/split-register-copy-ops-internals.c
 gnucash/register/ledger-core/split-register-layout.c
 gnucash/register/ledger-core/split-register-load.c
 gnucash/register/ledger-core/split-register-model.c

commit 9f5cbb3a82b8000d776e95655821723f9511174b
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Wed Oct 9 20:48:11 2019 +0200

    app-utils - move register's copy operations to ledger-core
    
    They are only used by split-register.c in that directory

diff --git a/gnucash/register/ledger-core/CMakeLists.txt b/gnucash/register/ledger-core/CMakeLists.txt
index 972106734..0b671cee2 100644
--- a/gnucash/register/ledger-core/CMakeLists.txt
+++ b/gnucash/register/ledger-core/CMakeLists.txt
@@ -7,6 +7,7 @@ set (ledger_core_SOURCES
   gncmod-ledger-core.c
   split-register.c
   split-register-control.c
+  split-register-copy-ops.c
   split-register-layout.c
   split-register-load.c
   split-register-model.c
@@ -26,6 +27,7 @@ set (ledger_core_HEADERS
   gnc-ledger-display2.h
   split-register.h
   split-register-control.h
+  split-register-copy-ops.h
   split-register-layout.h
   split-register-model.h
   split-register-model-save.h
diff --git a/libgnucash/app-utils/guile-util.c b/gnucash/register/ledger-core/split-register-copy-ops.c
similarity index 80%
copy from libgnucash/app-utils/guile-util.c
copy to gnucash/register/ledger-core/split-register-copy-ops.c
index fdf997d5c..8efe5e71c 100644
--- a/libgnucash/app-utils/guile-util.c
+++ b/gnucash/register/ledger-core/split-register-copy-ops.c
@@ -1,5 +1,6 @@
 /********************************************************************\
- * guile-util.c -- utility functions for using guile for GnuCash    *
+ * split-register-copy-ops.c -- implement copy/paste semantics for  *
+ *                              transactions and splits             *
  * Copyright (C) 1999 Linas Vepstas                                 *
  * Copyright (C) 2000 Dave Peticolas                                *
  * Copyright (C) 2017 Aaron Laws                                    *
@@ -50,13 +51,13 @@
 #endif
 
 #include "qof.h"
-#include "engine-helpers-guile.h"
-#include "glib-helpers.h"
+#include "gnc-engine-guile.h"
+#include "glib-guile.h"
 #include "gnc-glib-utils.h"
 #include "gnc-guile-utils.h"
 #include "gnc-prefs.h"
-#include "guile-util.h"
 #include "guile-mappings.h"
+#include "split-register-copy-ops.h"
 
 #define UNUSED_VAR     __attribute__ ((unused))
 
@@ -89,9 +90,6 @@ struct _getters
     SCM trans_scm_split_scms;
     SCM trans_scm_split_scm;
     SCM trans_scm_other_split_scm;
-
-    SCM debit_string;
-    SCM credit_string;
 } getters;
 
 struct _predicates
@@ -147,9 +145,6 @@ initialize_scm_functions()
     getters.trans_scm_other_split_scm =
         scm_c_eval_string("gnc:transaction-scm-get-other-split-scm");
 
-    getters.debit_string = scm_c_eval_string("gnc:get-debit-string");
-    getters.credit_string = scm_c_eval_string("gnc:get-credit-string");
-
     predicates.is_split_scm = scm_c_eval_string("gnc:split-scm?");
     predicates.is_trans_scm = scm_c_eval_string("gnc:transaction-scm?");
 
@@ -714,206 +709,3 @@ gnc_trans_scm_get_num_splits(SCM trans_scm)
 
     return scm_to_int(scm_length(result));
 }
-
-
-/********************************************************************\
- * gnc_get_debit_string                                             *
- *   return a debit string for a given account type                 *
- *                                                                  *
- * Args: account_type - type of account to get debit string for     *
- * Return: g_malloc'd debit string or NULL                          *
-\********************************************************************/
-char *
-gnc_get_debit_string(GNCAccountType account_type)
-{
-    SCM result;
-    SCM arg;
-
-    initialize_scm_functions();
-
-    if (gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL, GNC_PREF_ACCOUNTING_LABELS))
-        return g_strdup(_("Debit"));
-
-    if ((account_type < ACCT_TYPE_NONE) || (account_type >= NUM_ACCOUNT_TYPES))
-        account_type = ACCT_TYPE_NONE;
-
-    arg = scm_from_long (account_type);
-
-    result = scm_call_1(getters.debit_string, arg);
-    if (!scm_is_string(result))
-        return NULL;
-
-    return scm_to_utf8_string(result);
-}
-
-
-/************************************************************************\
- * gnc_get_credit_string                                                *
- *   return a credit string for a given account type                    *
- *                                                                      *
- * Args: account_type - type of account to get credit string for        *
- * Return: g_malloc'd credit string or NULL, must be freed with g_free  *
-\************************************************************************/
-char *
-gnc_get_credit_string(GNCAccountType account_type)
-{
-    SCM result;
-    SCM arg;
-
-    initialize_scm_functions();
-
-    if (gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL, GNC_PREF_ACCOUNTING_LABELS))
-        return g_strdup(_("Credit"));
-
-    if ((account_type < ACCT_TYPE_NONE) || (account_type >= NUM_ACCOUNT_TYPES))
-        account_type = ACCT_TYPE_NONE;
-
-    arg = scm_from_long (account_type);
-
-    result = scm_call_1(getters.credit_string, arg);
-    if (!scm_is_string(result))
-        return NULL;
-
-    return gnc_scm_to_utf8_string(result);
-}
-
-
-static void
-on_child_exit (GPid pid, gint status, gpointer data)
-{
-    Process *proc = data;
-    g_return_if_fail (proc && proc->pid == pid);
-
-    g_spawn_close_pid (proc->pid);
-
-    /* free if the process is both dead and detached */
-    if (!proc->detached)
-        proc->dead = TRUE;
-    else
-        g_free (proc);
-}
-
-Process *
-gnc_spawn_process_async (GList *argl, const gboolean search_path)
-{
-    gboolean retval;
-    Process *proc;
-    GList *l_iter;
-    guint argc;
-    gchar **argv, **v_iter;
-    GSpawnFlags flags;
-    GError *error = NULL;
-
-    proc = g_new0 (Process, 1);
-
-    argc = g_list_length (argl);
-    argv = g_malloc ((argc + 1) * sizeof(gchar*));
-
-    for (l_iter = argl, v_iter = argv; l_iter; l_iter = l_iter->next, v_iter++)
-    {
-        *v_iter = (gchar*) l_iter->data;
-    }
-    *v_iter = NULL;
-    g_list_free (argl);
-
-    flags = G_SPAWN_DO_NOT_REAP_CHILD;
-    if (search_path)
-        flags |= G_SPAWN_SEARCH_PATH;
-
-    retval = g_spawn_async_with_pipes (
-                 NULL, argv, NULL, flags, NULL, NULL, &proc->pid,
-                 &proc->fd_stdin, &proc->fd_stdout, &proc->fd_stderr, &error);
-
-    if (retval)
-    {
-        g_child_watch_add (proc->pid, on_child_exit, proc);
-    }
-    else
-    {
-        g_warning ("Could not spawn %s: %s", *argv ? *argv : "(null)",
-                   error->message ? error->message : "(null)");
-        g_free (proc);
-        proc = NULL;
-    }
-    g_strfreev (argv);
-
-    return proc;
-}
-
-gint
-gnc_process_get_fd (const Process *proc, const gint std_fd)
-{
-    const gint *retptr = NULL;
-    g_return_val_if_fail (proc, -1);
-
-    if (std_fd == 0)
-        retptr = &proc->fd_stdin;
-    else if (std_fd == 1)
-        retptr = &proc->fd_stdout;
-    else if (std_fd == 2)
-        retptr = &proc->fd_stderr;
-    else
-        g_return_val_if_reached (-1);
-
-    if (*retptr == -1)
-        g_warning ("Pipe to childs file descriptor %d is -1", std_fd);
-    return *retptr;
-}
-
-void
-gnc_detach_process (Process *proc, const gboolean kill_it)
-{
-    g_return_if_fail (proc && proc->pid);
-
-    errno = 0;
-    close (proc->fd_stdin);
-    if (errno)
-    {
-        g_message ("Close of childs stdin (%d) failed: %s", proc->fd_stdin,
-                   g_strerror (errno));
-        errno = 0;
-    }
-    close (proc->fd_stdout);
-    if (errno)
-    {
-        g_message ("Close of childs stdout (%d) failed: %s", proc->fd_stdout,
-                   g_strerror(errno));
-        errno = 0;
-    }
-    close (proc->fd_stderr);
-    if (errno)
-    {
-        g_message ("Close of childs stderr (%d) failed: %s", proc->fd_stderr,
-                   g_strerror(errno));
-        errno = 0;
-    }
-
-    if (kill_it && !proc->dead)
-    {
-        /* give it a chance to die */
-        while (g_main_context_iteration (NULL, FALSE) && !proc->dead)
-            ;
-        if (!proc->dead)
-            gnc_gpid_kill (proc->pid);
-    }
-
-    /* free if the process is both dead and detached */
-    if (!proc->dead)
-        proc->detached = TRUE;
-    else
-        g_free (proc);
-}
-
-
-time64
-gnc_parse_time_to_time64 (const gchar *s, const gchar *format)
-{
-    struct tm tm;
-
-    g_return_val_if_fail(s && format, -1);
-
-    if (!strptime(s, format, &tm))
-        return -1;
-
-    return gnc_mktime(&tm);
-}
diff --git a/libgnucash/app-utils/guile-util.h b/gnucash/register/ledger-core/split-register-copy-ops.h
similarity index 57%
copy from libgnucash/app-utils/guile-util.h
copy to gnucash/register/ledger-core/split-register-copy-ops.h
index a66ce2e39..b417f434a 100644
--- a/libgnucash/app-utils/guile-util.h
+++ b/gnucash/register/ledger-core/split-register-copy-ops.h
@@ -1,5 +1,6 @@
 /********************************************************************\
- * guile-util.h -- utility functions for using guile for GnuCash    *
+ * split-register-copy-ops.h -- implement copy/paste semantics for  *
+ *                              transactions and splits             *
  * Copyright (C) 1999 Linas Vepstas                                 *
  * Copyright (C) 2017 Aaron Laws                                    *
  *                                                                  *
@@ -22,8 +23,8 @@
  *                                                                  *
 \********************************************************************/
 
-#ifndef GUILE_UTIL_H
-#define GUILE_UTIL_H
+#ifndef SPLIT_REGISTER_COPY_OPS_H
+#define SPLIT_REGISTER_COPY_OPS_H
 
 #include <glib.h>
 #include <libguile.h>
@@ -65,56 +66,4 @@ SCM    gnc_trans_scm_get_split_scm(SCM trans_scm, int index);
 SCM    gnc_trans_scm_get_other_split_scm(SCM trans_scm, SCM split_scm);
 int    gnc_trans_scm_get_num_splits(SCM trans_scm);
 
-/* Two functions that return string synonyms for the terms 'debit' and
- * 'credit' as appropriate for the given account type and user preferences.
- * They should be g_freed when no longer needed. */
-char * gnc_get_debit_string(GNCAccountType account_type);
-char * gnc_get_credit_string(GNCAccountType account_type);
-
-/** An opaque process structure returned by gnc_spawn_process_async. */
-typedef struct _Process Process;
-
-/** Wraps g_spawn_async_with_pipes minimally.  Use gnc_process_get_fd to access
- *  the file descriptors to the child.  To close them and free the memory
- *  allocated for the process once it has exited, call gnc_detach_process.
- *
- *  @param argl A list of null-terminated strings used as arguments for spawning,
- *  i.e. "perl" "-w" "my-perl-script".  Will be freed inside.
- *
- *  @param search_path Determines whether the first element of argl will be
- *  looked for in the user's PATH.
- *
- *  @return A pointer to a structure representing the process or NULL on failure.
- */
-Process *gnc_spawn_process_async(GList *argl, const gboolean search_path);
-
-/** Accesses a given process structure and returns the file descriptor connected
- *  to the childs stdin, stdout or stderr.
- *
- *  @param proc A process structure returned by gnc_spawn_process_async.
- *
- *  @param std_fd 0, 1 or 2.
- *
- *  @return The file descriptor to write to the child on 0, or read from the
- *  childs output or error on 1 or 2, resp. */
-gint gnc_process_get_fd(const Process *proc, const gint std_fd);
-
-/** Close the file descriptors to a given process and declare it as detached.  If
- *  it is both dead and detached, the allocated memory will be freed.
- *
- *  @param proc A process structure returned by gnc_spawn_process_async.
- *
- *  @param kill_it If TRUE, kill the process. */
-void gnc_detach_process(Process *proc, const gboolean kill_it);
-
-/** Convert a time string to calendar time representation.  Combine strptime and
- *  mktime into a single function to avoid the need to wrap struct tm *.
- *
- *  @param s String representation of time.
- *
- *  @param format Format specification.
- *
- *  @return The time in seconds since unix epoch, or -1 on error */
-time64 gnc_parse_time_to_time64 (const gchar *s, const gchar *format);
-
 #endif
diff --git a/gnucash/register/ledger-core/split-register.c b/gnucash/register/ledger-core/split-register.c
index e78f5d96c..37c384724 100644
--- a/gnucash/register/ledger-core/split-register.c
+++ b/gnucash/register/ledger-core/split-register.c
@@ -40,6 +40,7 @@
 #include "gnc-ui.h"
 #include "gnc-warnings.h"
 #include "guile-util.h"
+#include "split-register-copy-ops.h"
 #include "numcell.h"
 #include "pricecell.h"
 #include "quickfillcell.h"
diff --git a/libgnucash/app-utils/guile-util.c b/libgnucash/app-utils/guile-util.c
index fdf997d5c..8b0a95583 100644
--- a/libgnucash/app-utils/guile-util.c
+++ b/libgnucash/app-utils/guile-util.c
@@ -63,43 +63,12 @@
 /* This static indicates the debugging module this .o belongs to.  */
 static QofLogModule UNUSED_VAR log_module = GNC_MOD_GUILE;
 
-struct _setters
-{
-    SCM split_scm_account_guid;
-    SCM split_scm_memo;
-    SCM split_scm_action;
-    SCM split_scm_reconcile_state;
-    SCM split_scm_amount;
-    SCM split_scm_value;
-
-    SCM trans_scm_date;
-    SCM trans_scm_num;
-    SCM trans_scm_description;
-    SCM trans_scm_notes;
-    SCM trans_scm_append_split_scm;
-} setters;
-
 struct _getters
 {
-    SCM split_scm_memo;
-    SCM split_scm_action;
-    SCM split_scm_amount;
-    SCM split_scm_value;
-
-    SCM trans_scm_split_scms;
-    SCM trans_scm_split_scm;
-    SCM trans_scm_other_split_scm;
-
     SCM debit_string;
     SCM credit_string;
 } getters;
 
-struct _predicates
-{
-    SCM is_split_scm;
-    SCM is_trans_scm;
-} predicates;
-
 struct _Process
 {
     GPid pid;
@@ -118,603 +87,12 @@ initialize_scm_functions()
     if (scm_funcs_inited)
         return;
 
-    setters.split_scm_account_guid =
-        scm_c_eval_string("gnc:split-scm-set-account-guid");
-    setters.split_scm_memo = scm_c_eval_string("gnc:split-scm-set-memo");
-    setters.split_scm_action = scm_c_eval_string("gnc:split-scm-set-action");
-    setters.split_scm_reconcile_state =
-        scm_c_eval_string("gnc:split-scm-set-reconcile-state");
-    setters.split_scm_amount = scm_c_eval_string("gnc:split-scm-set-amount");
-    setters.split_scm_value = scm_c_eval_string("gnc:split-scm-set-value");
-
-    setters.trans_scm_date = scm_c_eval_string("gnc:transaction-scm-set-date-posted");
-    setters.trans_scm_num = scm_c_eval_string("gnc:transaction-scm-set-num");
-    setters.trans_scm_description =
-        scm_c_eval_string("gnc:transaction-scm-set-description");
-    setters.trans_scm_notes = scm_c_eval_string("gnc:transaction-scm-set-notes");
-    setters.trans_scm_append_split_scm =
-        scm_c_eval_string("gnc:transaction-scm-append-split-scm");
-
-    getters.split_scm_memo = scm_c_eval_string("gnc:split-scm-get-memo");
-    getters.split_scm_action = scm_c_eval_string("gnc:split-scm-get-action");
-    getters.split_scm_amount = scm_c_eval_string("gnc:split-scm-get-amount");
-    getters.split_scm_value = scm_c_eval_string("gnc:split-scm-get-value");
-
-    getters.trans_scm_split_scms =
-        scm_c_eval_string("gnc:transaction-scm-get-split-scms");
-    getters.trans_scm_split_scm =
-        scm_c_eval_string("gnc:transaction-scm-get-split-scm");
-    getters.trans_scm_other_split_scm =
-        scm_c_eval_string("gnc:transaction-scm-get-other-split-scm");
-
     getters.debit_string = scm_c_eval_string("gnc:get-debit-string");
     getters.credit_string = scm_c_eval_string("gnc:get-credit-string");
 
-    predicates.is_split_scm = scm_c_eval_string("gnc:split-scm?");
-    predicates.is_trans_scm = scm_c_eval_string("gnc:transaction-scm?");
-
     scm_funcs_inited = TRUE;
 }
 
-/********************************************************************\
- * gnc_copy_split                                                   *
- *   returns a scheme representation of a split. If the split is    *
- *   NULL, SCM_UNDEFINED is returned.                               *
- *                                                                  *
- * Args: split             - the split to copy                      *
- *       use_cut_semantics - if TRUE, copy is for a 'cut' operation *
- * Returns: SCM representation of split or SCM_UNDEFINED            *
-\********************************************************************/
-SCM
-gnc_copy_split(Split *split, gboolean use_cut_semantics)
-{
-    static swig_type_info *split_type = NULL;
-    SCM func;
-    SCM arg;
-
-    if (split == NULL)
-        return SCM_UNDEFINED;
-
-    func = scm_c_eval_string("gnc:split->split-scm");
-    if (!scm_is_procedure(func))
-        return SCM_UNDEFINED;
-
-    if (!split_type)
-        split_type = SWIG_TypeQuery("_p_Split");
-
-    arg = SWIG_NewPointerObj(split, split_type, 0);
-
-    return scm_call_2(func, arg, SCM_BOOL(use_cut_semantics));
-}
-
-
-/********************************************************************\
- * gnc_copy_split_scm_onto_split                                    *
- *   copies a scheme representation of a split onto an actual split.*
- *                                                                  *
- * Args: split_scm - the scheme representation of a split           *
- *       split     - the split to copy onto                         *
- * Returns: Nothing                                                 *
-\********************************************************************/
-void
-gnc_copy_split_scm_onto_split(SCM split_scm, Split *split,
-                              QofBook * book)
-{
-    static swig_type_info *split_type = NULL;
-    SCM result;
-    SCM func;
-    SCM arg;
-
-    if (split_scm == SCM_UNDEFINED)
-        return;
-
-    if (split == NULL)
-        return;
-
-    g_return_if_fail (book);
-
-    func = scm_c_eval_string("gnc:split-scm?");
-    if (!scm_is_procedure(func))
-        return;
-
-    result = scm_call_1(func, split_scm);
-    if (!scm_is_true(result))
-        return;
-
-    func = scm_c_eval_string("gnc:split-scm-onto-split");
-    if (!scm_is_procedure(func))
-        return;
-
-    if (!split_type)
-        split_type = SWIG_TypeQuery("_p_Split");
-
-    arg = SWIG_NewPointerObj(split, split_type, 0);
-
-    scm_call_3(func, split_scm, arg, gnc_book_to_scm (book));
-}
-
-
-/********************************************************************\
- * gnc_is_split_scm                                                 *
- *   returns true if the scm object is a scheme split               *
- *                                                                  *
- * Args: scm - a scheme object                                      *
- * Returns: true if scm is a scheme split                           *
-\********************************************************************/
-static gboolean
-gnc_is_split_scm(SCM scm)
-{
-    initialize_scm_functions();
-
-    return scm_is_true(scm_call_1(predicates.is_split_scm, scm));
-}
-
-
-/********************************************************************\
- * gnc_is_trans_scm                                                 *
- *   returns true if the scm object is a scheme transaction         *
- *                                                                  *
- * Args: scm - a scheme object                                      *
- * Returns: true if scm is a scheme transaction                     *
-\********************************************************************/
-static gboolean
-gnc_is_trans_scm(SCM scm)
-{
-    initialize_scm_functions();
-
-    return scm_is_true(scm_call_1(predicates.is_trans_scm, scm));
-}
-
-
-/********************************************************************\
- * gnc_split_scm_set_account                                        *
- *   set the account of a scheme representation of a split.         *
- *                                                                  *
- * Args: split_scm - the scheme split                               *
- *       account   - the account to set                             *
- * Returns: Nothing                                                 *
-\********************************************************************/
-void
-gnc_split_scm_set_account(SCM split_scm, Account *account)
-{
-    gchar guid_string[GUID_ENCODING_LENGTH+1];
-    SCM arg;
-
-    initialize_scm_functions();
-
-    if (!gnc_is_split_scm(split_scm))
-        return;
-    if (account == NULL)
-        return;
-
-    guid_to_string_buff(xaccAccountGetGUID(account), guid_string);
-    if (strlen(guid_string) == 0)
-        return;
-
-    arg = scm_from_utf8_string(guid_string);
-
-    scm_call_2(setters.split_scm_account_guid, split_scm, arg);
-}
-
-
-/********************************************************************\
- * gnc_split_scm_set_memo                                           *
- *   set the memo of a scheme representation of a split.            *
- *                                                                  *
- * Args: split_scm - the scheme split                               *
- *       memo      - the memo to set                                *
- * Returns: Nothing                                                 *
-\********************************************************************/
-void
-gnc_split_scm_set_memo(SCM split_scm, const char *memo)
-{
-    SCM arg;
-
-    initialize_scm_functions();
-
-    if (!gnc_is_split_scm(split_scm))
-        return;
-    if (memo == NULL)
-        return;
-
-    arg = scm_from_utf8_string(memo);
-
-    scm_call_2(setters.split_scm_memo, split_scm, arg);
-}
-
-
-/********************************************************************\
- * gnc_split_scm_set_action                                         *
- *   set the action of a scheme representation of a split.          *
- *                                                                  *
- * Args: split_scm - the scheme split                               *
- *       action    - the action to set                              *
- * Returns: Nothing                                                 *
-\********************************************************************/
-void
-gnc_split_scm_set_action(SCM split_scm, const char *action)
-{
-    SCM arg;
-
-    initialize_scm_functions();
-
-    if (!gnc_is_split_scm(split_scm))
-        return;
-    if (action == NULL)
-        return;
-
-    arg = scm_from_utf8_string(action);
-
-    scm_call_2(setters.split_scm_action, split_scm, arg);
-}
-
-
-/********************************************************************\
- * gnc_split_scm_set_reconcile_state                                *
- *   set the reconcile state of a scheme split.                     *
- *                                                                  *
- * Args: split_scm       - the scheme split                         *
- *       reconcile_state - the reconcile state to set               *
- * Returns: Nothing                                                 *
-\********************************************************************/
-void
-gnc_split_scm_set_reconcile_state(SCM split_scm, char reconcile_state)
-{
-    SCM arg;
-
-    initialize_scm_functions();
-
-    if (!gnc_is_split_scm(split_scm))
-        return;
-
-    arg = SCM_MAKE_CHAR(reconcile_state);
-
-    scm_call_2(setters.split_scm_reconcile_state, split_scm, arg);
-}
-
-
-/********************************************************************\
- * gnc_split_scm_set_amount                                         *
- *   set the amount of a scheme split                               *
- *                                                                  *
- * Args: split_scm - the scheme split                               *
- *       amount    - the amount to set                              *
- * Returns: Nothing                                                 *
-\********************************************************************/
-void
-gnc_split_scm_set_amount(SCM split_scm, gnc_numeric amount)
-{
-    SCM arg;
-
-    initialize_scm_functions();
-
-    if (!gnc_is_split_scm(split_scm))
-        return;
-
-    arg = gnc_numeric_to_scm(amount);
-    scm_call_2(setters.split_scm_amount, split_scm, arg);
-}
-
-
-/********************************************************************\
- * gnc_split_scm_set_value                                          *
- *   set the value of a scheme split                                *
- *                                                                  *
- * Args: split_scm - the scheme split                               *
- *       value     - the value to set                               *
- * Returns: Nothing                                                 *
-\********************************************************************/
-void
-gnc_split_scm_set_value(SCM split_scm, gnc_numeric value)
-{
-    SCM arg;
-
-    initialize_scm_functions();
-
-    if (!gnc_is_split_scm(split_scm))
-        return;
-
-    arg = gnc_numeric_to_scm(value);
-    scm_call_2(setters.split_scm_value, split_scm, arg);
-}
-
-
-/********************************************************************\
- * gnc_split_scm_get_amount                                         *
- *   return the amount of a scheme split                            *
- *                                                                  *
- * Args: split_scm - the scheme split                               *
- * Returns: amount of scheme split                                  *
-\********************************************************************/
-gnc_numeric
-gnc_split_scm_get_amount(SCM split_scm)
-{
-    SCM result;
-
-    initialize_scm_functions();
-
-    if (!gnc_is_split_scm(split_scm))
-        return gnc_numeric_zero ();
-
-    result = scm_call_1(getters.split_scm_amount, split_scm);
-    if (!scm_rational_p(result))
-        return gnc_numeric_zero ();
-
-    return gnc_scm_to_numeric(result);
-}
-
-
-/********************************************************************\
- * gnc_split_scm_get_value                                          *
- *   return the value of a scheme split                             *
- *                                                                  *
- * Args: split_scm - the scheme split                               *
- * Returns: value of scheme split                                   *
-\********************************************************************/
-gnc_numeric
-gnc_split_scm_get_value(SCM split_scm)
-{
-    SCM result;
-
-    initialize_scm_functions();
-
-    if (!gnc_is_split_scm(split_scm))
-        return gnc_numeric_zero ();
-
-    result = scm_call_1(getters.split_scm_value, split_scm);
-    if (!scm_rational_p(result))
-        return gnc_numeric_zero ();
-
-    return gnc_scm_to_numeric(result);
-}
-
-
-/********************************************************************\
- * gnc_copy_trans                                                   *
- *   returns a scheme representation of a transaction. If the       *
- *   transaction is NULL, SCM_UNDEFINED is returned.                *
- *                                                                  *
- * Args: trans             - the transaction to copy                *
- *       use_cut_semantics - if TRUE, copy is for a 'cut' operation *
- * Returns: SCM representation of transaction or SCM_UNDEFINED      *
-\********************************************************************/
-SCM
-gnc_copy_trans(Transaction *trans, gboolean use_cut_semantics)
-{
-    static swig_type_info *trans_type = NULL;
-    SCM func;
-    SCM arg;
-
-    if (trans == NULL)
-        return SCM_UNDEFINED;
-
-    func = scm_c_eval_string("gnc:transaction->transaction-scm");
-    if (!scm_is_procedure(func))
-        return SCM_UNDEFINED;
-
-    if (!trans_type)
-        trans_type = SWIG_TypeQuery("_p_Transaction");
-
-    arg = SWIG_NewPointerObj(trans, trans_type, 0);
-
-    return scm_call_2(func, arg, SCM_BOOL(use_cut_semantics));
-}
-
-
-/********************************************************************\
- * gnc_copy_trans_scm_onto_trans                                    *
- *   copies a scheme representation of a transaction onto           *
- *   an actual transaction.                                         *
- *                                                                  *
- * Args: trans_scm - the scheme representation of a transaction     *
- *       trans     - the transaction to copy onto                   *
- * Returns: Nothing                                                 *
-\********************************************************************/
-void
-gnc_copy_trans_scm_onto_trans(SCM trans_scm, Transaction *trans,
-                              gboolean do_commit, QofBook *book)
-{
-    gnc_copy_trans_scm_onto_trans_swap_accounts(trans_scm, trans, NULL, NULL,
-            do_commit, book);
-}
-
-
-/********************************************************************\
- * gnc_copy_trans_scm_onto_trans_swap_accounts                      *
- *   copies a scheme representation of a transaction onto           *
- *   an actual transaction. If guid_1 and guid_2 are not NULL,      *
- *   the account guids of the splits are swapped accordingly.       *
- *                                                                  *
- * Args: trans_scm - the scheme representation of a transaction     *
- *       trans     - the transaction to copy onto                   *
- *       guid_1    - account guid to swap with guid_2               *
- *       guid_2    - account guid to swap with guid_1               *
- *       do_commit - whether to commit the edits                    *
- * Returns: Nothing                                                 *
-\********************************************************************/
-void
-gnc_copy_trans_scm_onto_trans_swap_accounts(SCM trans_scm,
-        Transaction *trans,
-        const GncGUID *guid_1,
-        const GncGUID *guid_2,
-        gboolean do_commit,
-        QofBook *book)
-{
-    static swig_type_info *trans_type = NULL;
-    SCM result;
-    SCM func;
-    SCM arg;
-
-    if (trans_scm == SCM_UNDEFINED)
-        return;
-
-    if (trans == NULL)
-        return;
-
-    g_return_if_fail (book);
-
-    func = scm_c_eval_string("gnc:transaction-scm?");
-    if (!scm_is_procedure(func))
-        return;
-
-    result = scm_call_1(func, trans_scm);
-    if (!scm_is_true(result))
-        return;
-
-    func = scm_c_eval_string("gnc:transaction-scm-onto-transaction");
-    if (!scm_is_procedure(func))
-        return;
-
-    if (!trans_type)
-        trans_type = SWIG_TypeQuery("_p_Transaction");
-
-    arg = SWIG_NewPointerObj(trans, trans_type, 0);
-
-    if ((guid_1 == NULL) || (guid_2 == NULL))
-    {
-        SCM args = SCM_EOL;
-        SCM commit;
-
-        commit = SCM_BOOL(do_commit);
-
-        args = scm_cons(gnc_book_to_scm (book), args);
-        args = scm_cons(commit, args);
-        args = scm_cons(SCM_EOL, args);
-        args = scm_cons(arg, args);
-        args = scm_cons(trans_scm, args);
-
-        scm_apply(func, args, SCM_EOL);
-    }
-    else
-    {
-        gchar guidstr[GUID_ENCODING_LENGTH+1];
-        SCM from, to;
-        SCM map = SCM_EOL;
-        SCM args = SCM_EOL;
-        SCM commit;
-
-        args = scm_cons(gnc_book_to_scm (book), args);
-
-        commit = SCM_BOOL(do_commit);
-
-        args = scm_cons(commit, args);
-
-        guid_to_string_buff(guid_1, guidstr);
-        from = scm_from_utf8_string(guidstr);
-        guid_to_string_buff(guid_2, guidstr);
-        to = scm_from_utf8_string(guidstr);
-
-        map = scm_cons(scm_cons(from, to), map);
-        map = scm_cons(scm_cons(to, from), map);
-
-        args = scm_cons(map, args);
-        args = scm_cons(arg, args);
-        args = scm_cons(trans_scm, args);
-
-        scm_apply(func, args, SCM_EOL);
-    }
-}
-
-/********************************************************************\
- * gnc_trans_scm_append_split_scm                                   *
- *   append the scheme split onto the scheme transaction            *
- *                                                                  *
- * Args: trans_scm - the scheme transaction                         *
- *       split_scm - the scheme split to append                     *
- * Returns: Nothing                                                 *
-\********************************************************************/
-void
-gnc_trans_scm_append_split_scm(SCM trans_scm, SCM split_scm)
-{
-    initialize_scm_functions();
-
-    if (!gnc_is_trans_scm(trans_scm))
-        return;
-    if (!gnc_is_split_scm(split_scm))
-        return;
-
-    scm_call_2(setters.trans_scm_append_split_scm, trans_scm, split_scm);
-}
-
-
-/********************************************************************\
- * gnc_trans_scm_get_split_scm                                      *
- *   get the indexth scheme split of a scheme transaction.          *
- *                                                                  *
- * Args: trans_scm - the scheme transaction                         *
- *       index     - the index of the split to get                  *
- * Returns: scheme split to get, or SCM_UNDEFINED if none           *
-\********************************************************************/
-SCM
-gnc_trans_scm_get_split_scm(SCM trans_scm, int index)
-{
-    SCM arg;
-
-    initialize_scm_functions();
-
-    if (!gnc_is_trans_scm(trans_scm))
-        return SCM_UNDEFINED;
-
-    arg = scm_from_int (index);
-
-    return scm_call_2(getters.trans_scm_split_scm, trans_scm, arg);
-}
-
-
-/********************************************************************\
- * gnc_trans_scm_get_other_split_scm                                *
- *   get the other scheme split of a scheme transaction.            *
- *                                                                  *
- * Args: trans_scm - the scheme transaction                         *
- *       split_scm - the split not to get                           *
- * Returns: other scheme split, or SCM_UNDEFINED if none            *
-\********************************************************************/
-SCM
-gnc_trans_scm_get_other_split_scm(SCM trans_scm, SCM split_scm)
-{
-    SCM result;
-
-    initialize_scm_functions();
-
-    if (!gnc_is_trans_scm(trans_scm))
-        return SCM_UNDEFINED;
-    if (!gnc_is_split_scm(split_scm))
-        return SCM_UNDEFINED;
-
-    result = scm_call_2(getters.trans_scm_other_split_scm, trans_scm, split_scm);
-
-    if (!gnc_is_split_scm(result))
-        return SCM_UNDEFINED;
-
-    return result;
-}
-
-
-/********************************************************************\
- * gnc_trans_scm_get_num_splits                                     *
- *   get the number of scheme splits in a scheme transaction.       *
- *                                                                  *
- * Args: trans_scm - the scheme transaction                         *
- * Returns: number of scheme splits in the transaction              *
-\********************************************************************/
-int
-gnc_trans_scm_get_num_splits(SCM trans_scm)
-{
-    SCM result;
-
-    initialize_scm_functions();
-
-    if (!gnc_is_trans_scm(trans_scm))
-        return 0;
-
-    result = scm_call_1(getters.trans_scm_split_scms, trans_scm);
-
-    if (!scm_is_list(result))
-        return 0;
-
-    return scm_to_int(scm_length(result));
-}
-
 
 /********************************************************************\
  * gnc_get_debit_string                                             *
diff --git a/libgnucash/app-utils/guile-util.h b/libgnucash/app-utils/guile-util.h
index a66ce2e39..d8740a25c 100644
--- a/libgnucash/app-utils/guile-util.h
+++ b/libgnucash/app-utils/guile-util.h
@@ -32,38 +32,6 @@
 #include "Account.h"
 #include "gnc-guile-utils.h"
 
-/* The next set of functions is for manipulating scheme
- * representations of splits and transactions. */
-
-SCM    gnc_copy_split(Split *split, gboolean use_cut_semantics);
-void   gnc_copy_split_scm_onto_split(SCM split_scm, Split *split,
-                                     QofBook *book);
-
-void   gnc_split_scm_set_account(SCM split_scm, Account *account);
-void   gnc_split_scm_set_memo(SCM split_scm, const char *memo);
-void   gnc_split_scm_set_action(SCM split_scm, const char *action);
-void   gnc_split_scm_set_reconcile_state(SCM split_scm, char reconcile_state);
-void   gnc_split_scm_set_amount(SCM split_scm, gnc_numeric amount);
-void   gnc_split_scm_set_value(SCM split_scm, gnc_numeric value);
-
-gnc_numeric gnc_split_scm_get_amount(SCM split_scm);
-gnc_numeric gnc_split_scm_get_value(SCM split_scm);
-
-SCM    gnc_copy_trans(Transaction *trans, gboolean use_cut_semantics);
-void   gnc_copy_trans_scm_onto_trans(SCM trans_scm, Transaction *trans,
-                                     gboolean do_commit, QofBook *book);
-void   gnc_copy_trans_scm_onto_trans_swap_accounts(SCM trans_scm,
-        Transaction *trans,
-        const GncGUID *guid_1,
-        const GncGUID *guid_2,
-        gboolean do_commit,
-        QofBook *book);
-
-void   gnc_trans_scm_append_split_scm(SCM trans_scm, SCM split_scm);
-
-SCM    gnc_trans_scm_get_split_scm(SCM trans_scm, int index);
-SCM    gnc_trans_scm_get_other_split_scm(SCM trans_scm, SCM split_scm);
-int    gnc_trans_scm_get_num_splits(SCM trans_scm);
 
 /* Two functions that return string synonyms for the terms 'debit' and
  * 'credit' as appropriate for the given account type and user preferences.
diff --git a/po/POTFILES.in b/po/POTFILES.in
index d421ddbe7..1c147ff05 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -380,6 +380,7 @@ gnucash/register/ledger-core/gnc-ledger-display.c
 gnucash/register/ledger-core/gncmod-ledger-core.c
 gnucash/register/ledger-core/split-register.c
 gnucash/register/ledger-core/split-register-control.c
+gnucash/register/ledger-core/split-register-copy-ops.c
 gnucash/register/ledger-core/split-register-layout.c
 gnucash/register/ledger-core/split-register-load.c
 gnucash/register/ledger-core/split-register-model.c

commit 02afa33e5486481b55d7bec03708c4cfe9f6bc00
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Oct 8 17:46:00 2019 +0200

    app-utils - reduce guile-util api-surface
    
    Make internal-use only function static and drop two unused functions.

diff --git a/libgnucash/app-utils/guile-util.c b/libgnucash/app-utils/guile-util.c
index 4543695d1..fdf997d5c 100644
--- a/libgnucash/app-utils/guile-util.c
+++ b/libgnucash/app-utils/guile-util.c
@@ -110,7 +110,6 @@ struct _Process
     gboolean detached;
 };
 
-
 static void
 initialize_scm_functions()
 {
@@ -242,7 +241,7 @@ gnc_copy_split_scm_onto_split(SCM split_scm, Split *split,
  * Args: scm - a scheme object                                      *
  * Returns: true if scm is a scheme split                           *
 \********************************************************************/
-gboolean
+static gboolean
 gnc_is_split_scm(SCM scm)
 {
     initialize_scm_functions();
@@ -258,7 +257,7 @@ gnc_is_split_scm(SCM scm)
  * Args: scm - a scheme object                                      *
  * Returns: true if scm is a scheme transaction                     *
 \********************************************************************/
-gboolean
+static gboolean
 gnc_is_trans_scm(SCM scm)
 {
     initialize_scm_functions();
@@ -420,56 +419,6 @@ gnc_split_scm_set_value(SCM split_scm, gnc_numeric value)
 }
 
 
-/********************************************************************\
- * gnc_split_scm_get_memo                                           *
- *   return the newly allocated memo of a scheme split, or NULL.    *
- *                                                                  *
- * Args: split_scm - the scheme split                               *
- * Returns: newly allocated memo string, must be freed with g_free  *
-\********************************************************************/
-char *
-gnc_split_scm_get_memo(SCM split_scm)
-{
-    SCM result;
-
-    initialize_scm_functions();
-
-    if (!gnc_is_split_scm(split_scm))
-        return NULL;
-
-    result = scm_call_1(getters.split_scm_memo, split_scm);
-    if (!scm_is_string(result))
-        return NULL;
-
-    return gnc_scm_to_utf8_string(result);
-}
-
-
-/**********************************************************************\
- * gnc_split_scm_get_action                                           *
- *   return the newly allocated action of a scheme split, or NULL.    *
- *                                                                    *
- * Args: split_scm - the scheme split                                 *
- * Returns: newly allocated action string, must be freed with g_free  *
-\**********************************************************************/
-char *
-gnc_split_scm_get_action(SCM split_scm)
-{
-    SCM result;
-
-    initialize_scm_functions();
-
-    if (!gnc_is_split_scm(split_scm))
-        return NULL;
-
-    result = scm_call_1(getters.split_scm_action, split_scm);
-    if (!scm_is_string(result))
-        return NULL;
-
-    return gnc_scm_to_utf8_string(result);
-}
-
-
 /********************************************************************\
  * gnc_split_scm_get_amount                                         *
  *   return the amount of a scheme split                            *
diff --git a/libgnucash/app-utils/guile-util.h b/libgnucash/app-utils/guile-util.h
index c7a523cb8..a66ce2e39 100644
--- a/libgnucash/app-utils/guile-util.h
+++ b/libgnucash/app-utils/guile-util.h
@@ -34,8 +34,6 @@
 
 /* The next set of functions is for manipulating scheme
  * representations of splits and transactions. */
-gboolean gnc_is_split_scm(SCM scm);
-gboolean gnc_is_trans_scm(SCM scm);
 
 SCM    gnc_copy_split(Split *split, gboolean use_cut_semantics);
 void   gnc_copy_split_scm_onto_split(SCM split_scm, Split *split,
@@ -48,8 +46,6 @@ void   gnc_split_scm_set_reconcile_state(SCM split_scm, char reconcile_state);
 void   gnc_split_scm_set_amount(SCM split_scm, gnc_numeric amount);
 void   gnc_split_scm_set_value(SCM split_scm, gnc_numeric value);
 
-char * gnc_split_scm_get_memo(SCM split_scm);
-char * gnc_split_scm_get_action(SCM split_scm);
 gnc_numeric gnc_split_scm_get_amount(SCM split_scm);
 gnc_numeric gnc_split_scm_get_value(SCM split_scm);
 

commit efefac3e1e8c8c1cced71c6d8b02e53d14779dc4
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Oct 8 17:29:02 2019 +0200

    Dead code removal

diff --git a/libgnucash/app-utils/guile-util.c b/libgnucash/app-utils/guile-util.c
index 262891985..4543695d1 100644
--- a/libgnucash/app-utils/guile-util.c
+++ b/libgnucash/app-utils/guile-util.c
@@ -157,39 +157,6 @@ initialize_scm_functions()
     scm_funcs_inited = TRUE;
 }
 
-
-/********************************************************************\
-  gnc_scm_lookup
-
-    returns the SCM binding associated with the given symbol function,
-    or SCM_UNDEFINED if it couldn't be retrieved.
-
-    Don't use this to get hold of symbols that are considered private
-    to a given module unless the C code you're writing is considered
-    part of that module.
-
-  Args:
-
-    module - where to lookup the symbol, something like "ice-9 debug"
-    symbol - what to look up.
-
-  Returns: value bound to the symbol, if any.
-\********************************************************************/
-
-#if 0
-
-************ NOT TESTED YET **************
-
-SCM
-gnc_scm_lookup(const char *module, const char *symbol)
-{
-    SCM scm_module = scm_c_resolve_module(module);
-    SCM value = scm_c_module_lookup(scm_module, symbol);
-    return value;
-}
-
-#endif
-
 /********************************************************************\
  * gnc_copy_split                                                   *
  *   returns a scheme representation of a split. If the split is    *
diff --git a/libgnucash/app-utils/guile-util.h b/libgnucash/app-utils/guile-util.h
index 1624349ca..c7a523cb8 100644
--- a/libgnucash/app-utils/guile-util.h
+++ b/libgnucash/app-utils/guile-util.h
@@ -32,11 +32,6 @@
 #include "Account.h"
 #include "gnc-guile-utils.h"
 
-/* Don't use this to get hold of symbols that are considered private
- * to a given module unless the C code you're writing is considered
- * part of that module.  */
-SCM    gnc_scm_lookup(const char *module, const char *symbol);
-
 /* The next set of functions is for manipulating scheme
  * representations of splits and transactions. */
 gboolean gnc_is_split_scm(SCM scm);

commit f039cc80e989a6ce3a5a024c8bc941e738408199
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Wed Nov 20 19:35:50 2019 +0100

    Fix ninja-build check without running ninja-build first
    
    The (gnucash reports) guile module should be built before the reports
    depending on it.

diff --git a/gnucash/report/reports/CMakeLists.txt b/gnucash/report/reports/CMakeLists.txt
index b1daa74bc..fabe04a90 100644
--- a/gnucash/report/reports/CMakeLists.txt
+++ b/gnucash/report/reports/CMakeLists.txt
@@ -109,6 +109,7 @@ set(scm_rpt_std_GUILE_DEPENDS
   ${scm_rpts_GUILE_DEPENDS}
   scm-app-utils
   scm-gnc-module
+  scm-rpt-reports
   scm-reports-common-links
   scm-reports-standard-links
   )
@@ -120,6 +121,13 @@ gnc_add_scheme_targets(scm-reports-common
   TRUE
 )
 
+gnc_add_scheme_targets(scm-rpt-reports
+  "${reports_SCHEME}"
+  "gnucash"
+  "${scm_rpts_GUILE_DEPENDS}"
+  TRUE
+)
+
 gnc_add_scheme_targets(scm-reports-standard
   "${reports_standard_SCHEME}"
   "gnucash/reports/standard"
@@ -148,13 +156,6 @@ gnc_add_scheme_targets(scm-reports-de_DE
   TRUE
 )
 
-gnc_add_scheme_targets(scm-rpt-reports
-  "${reports_SCHEME}"
-  "gnucash"
-  "scm-reports-standard;scm-reports-example;scm-reports-us;scm-reports-de_DE;${scm_rpts_GUILE_DEPENDS};"
-  TRUE
-)
-
 gnc_add_scheme_targets(scm-reports-standard-2
   "${reports_standard_SCHEME_2}"
   "gnucash/reports/standard"
diff --git a/gnucash/report/reports/standard/budget-barchart.scm b/gnucash/report/reports/standard/budget-barchart.scm
index f1a9721c6..f89b0edac 100644
--- a/gnucash/report/reports/standard/budget-barchart.scm
+++ b/gnucash/report/reports/standard/budget-barchart.scm
@@ -32,7 +32,6 @@
 (use-modules (gnucash gettext))
 
 (gnc:module-load "gnucash/report" 0)
-(use-modules (gnucash reports))
 
 (define reportname
   (N_ "Budget Chart"))
diff --git a/gnucash/report/test/CMakeLists.txt b/gnucash/report/test/CMakeLists.txt
index a9ce3b81e..323c60e75 100644
--- a/gnucash/report/test/CMakeLists.txt
+++ b/gnucash/report/test/CMakeLists.txt
@@ -34,6 +34,7 @@ set(GUILE_DEPENDS
   scm-scm
   scm-report-2
   scm-test-report
+  scm-report-stylesheets
   )
 gnc_add_scheme_tests("${scm_test_report_SOURCES}")
 



Summary of changes:
 CMakeLists.txt                                     |    2 +-
 bindings/CMakeLists.txt                            |   10 +-
 {libgnucash/engine => bindings}/business-core.i    |    2 +-
 {libgnucash/core-utils => bindings}/core-utils.i   |    0
 {libgnucash/engine => bindings}/engine-common.i    |    0
 {libgnucash/engine => bindings}/engine.i           |   39 +-
 bindings/guile/CMakeLists.txt                      |  151 ++
 .../engine => bindings/guile}/business-core.scm    |   11 -
 .../engine => bindings/guile}/commodity-table.scm  |    0
 .../guile/core-utils.scm                           |   39 +-
 {libgnucash/engine => bindings/guile}/engine.scm   |  101 +-
 .../glib-helpers.c => bindings/guile/glib-guile.c  |  171 +-
 .../glib-helpers.h => bindings/guile/glib-guile.h  |   40 +-
 .../guile/gnc-engine-guile.c                       |  334 ++--
 .../guile/gnc-engine-guile.h                       |   26 +-
 .../guile/gnc-guile-bindings.c                     |   45 +-
 .../guile}/gnc-guile-utils.c                       |    0
 .../guile}/gnc-guile-utils.h                       |    0
 .../guile/gnc-kvp-guile.cpp                        |    4 +-
 .../kvp-scm.h => bindings/guile/gnc-kvp-guile.h    |    0
 bindings/guile/gnc-module.scm                      |   76 +
 .../engine => bindings/guile}/gnc-numeric.scm      |    0
 bindings/guile/test/CMakeLists.txt                 |  135 ++
 .../guile}/test/srfi64-extras.scm                  |    0
 .../guile}/test/test-business-core.scm             |    6 +-
 bindings/guile/test/test-core-utils.scm            |   17 +
 .../guile}/test/test-create-account.scm            |    4 +-
 .../guile}/test/test-engine-extras.scm             |    0
 .../guile}/test/test-module-deprecation.scm        |    0
 .../guile}/test/test-scm-query-import.scm          |    4 +-
 .../guile}/test/test-scm-query.cpp                 |    5 +-
 .../guile/test/test-scm-utilities.scm              |    8 +-
 {libgnucash/scm => bindings/guile}/utilities.scm   |    5 +-
 bindings/python/CMakeLists.txt                     |   56 +-
 common/cmake_modules/GncAddSwigCommand.cmake       |   51 +-
 common/cmake_modules/GncAddTest.cmake              |    3 -
 common/test-core/CMakeLists.txt                    |    6 +-
 doc/examples/README_invoice                        |    4 +-
 gnucash/CMakeLists.txt                             |   13 +-
 gnucash/gnome-search/gncmod-gnome-search.c         |    6 -
 gnucash/gnome-utils/CMakeLists.txt                 |   18 +-
 gnucash/gnome-utils/dialog-options.c               |    5 +-
 gnucash/gnome-utils/dialog-transfer.c              |    2 +-
 gnucash/gnome-utils/dialog-utils.c                 |    1 -
 .../gnome-utils}/gnc-component-manager.c           |    0
 .../gnome-utils}/gnc-component-manager.h           |    0
 gnucash/gnome-utils/gnc-main-window.c              |   44 +-
 gnucash/gnome-utils/gnc-menu-extensions.c          |    2 +-
 gnucash/gnome-utils/gnc-plugin-manager.c           |    2 +-
 gnucash/gnome-utils/gnc-plugin-menu-additions.c    |    1 -
 gnucash/gnome-utils/gnc-tree-view-account.c        |    2 +-
 gnucash/gnome-utils/gnc-tree-view-owner.c          |    2 +-
 gnucash/gnome-utils/gncmod-gnome-utils.c           |   33 +-
 gnucash/gnome-utils/gnome-utils.scm                |    9 +-
 gnucash/gnome-utils/test/CMakeLists.txt            |    4 +-
 .../test/test-load-gnome-utils-module.scm          |   25 +-
 gnucash/gnome/CMakeLists.txt                       |   22 +-
 gnucash/gnome/assistant-hierarchy.c                |    2 +-
 gnucash/gnome/dialog-price-edit-db.c               |    3 +-
 gnucash/gnome/dialog-price-editor.c                |    1 -
 gnucash/gnome/dialog-sx-editor.c                   |    2 +-
 gnucash/gnome/dialog-sx-editor2.c                  |    2 +-
 gnucash/gnome/dialog-tax-info.c                    |    8 +-
 gnucash/gnome/report-menus.scm                     |    7 +-
 gnucash/gnome/top-level.c                          |   11 +-
 gnucash/gnome/window-autoclear.c                   |    1 -
 gnucash/gnome/window-reconcile.c                   |   24 +-
 gnucash/gnome/window-reconcile2.c                  |   24 +-
 gnucash/gnucash-bin.c                              |   18 +-
 gnucash/html/CMakeLists.txt                        |   20 +-
 gnucash/html/gnc-html.i                            |    1 +
 gnucash/html/gncmod-html.c                         |   22 +-
 .../gnucash/baz.scm => gnucash/html/html.scm       |   24 +-
 gnucash/import-export/CMakeLists.txt               |    2 +-
 gnucash/import-export/aqb/CMakeLists.txt           |    2 +-
 gnucash/import-export/aqb/gncmod-aqbanking.c       |    4 +-
 gnucash/import-export/aqb/test/CMakeLists.txt      |    4 +-
 gnucash/import-export/bi-import/CMakeLists.txt     |    4 +-
 gnucash/import-export/bi-import/gncmod-bi-import.c |    8 -
 gnucash/import-export/csv-exp/CMakeLists.txt       |    4 +-
 gnucash/import-export/csv-exp/gncmod-csv-export.c  |    8 -
 gnucash/import-export/csv-imp/CMakeLists.txt       |    4 +-
 gnucash/import-export/csv-imp/gncmod-csv-import.c  |    8 -
 gnucash/import-export/csv-imp/test/CMakeLists.txt  |    2 +-
 .../import-export/customer-import/CMakeLists.txt   |    4 +-
 .../customer-import/gncmod-customer-import.c       |   11 -
 gnucash/import-export/gncmod-generic-import.c      |    8 -
 gnucash/import-export/log-replay/CMakeLists.txt    |    2 +-
 .../import-export/log-replay/gncmod-log-replay.c   |    8 -
 gnucash/import-export/ofx/CMakeLists.txt           |    2 +-
 gnucash/import-export/ofx/gncmod-ofx-import.c      |    8 -
 gnucash/import-export/qif-imp/CMakeLists.txt       |    7 +-
 gnucash/import-export/qif-imp/gncmod-qif-import.c  |   12 +-
 gnucash/import-export/qif-imp/qif-import.scm       |    9 +-
 gnucash/import-export/qif-imp/test/CMakeLists.txt  |    3 +-
 .../import-export/qif-imp/test/test-qif-imp.scm    |    3 +-
 .../qif-imp/test/test-qif-merge-groups.scm         |    4 +-
 .../import-export/qif-imp/test/test-qif-parse.scm  |    3 +-
 {libgnucash/scm => gnucash}/price-quotes.scm       |    9 +-
 gnucash/python/CMakeLists.txt                      |    2 +-
 gnucash/register/ledger-core/CMakeLists.txt        |    4 +-
 gnucash/register/ledger-core/gncmod-ledger-core.c  |   10 -
 .../register/ledger-core/split-register-copy-ops.c |  429 +++++
 .../register/ledger-core/split-register-copy-ops.h |  119 ++
 gnucash/register/ledger-core/split-register-p.h    |    4 +-
 gnucash/register/ledger-core/split-register.c      |  164 +-
 gnucash/register/ledger-core/test/CMakeLists.txt   |   26 +-
 .../ledger-core/test/test-split-register.c         |   29 +-
 .../test/utest-split-register-copy-ops.c           |  621 +++++++
 gnucash/register/register-core/CMakeLists.txt      |    2 +-
 .../register/register-core/gncmod-register-core.c  |    5 -
 gnucash/report/CMakeLists.txt                      |   15 +-
 gnucash/report/eguile-html-utilities.scm           |    5 +-
 gnucash/report/eguile-utilities.scm                |    5 +-
 gnucash/report/gncmod-report.c                     |   13 +-
 gnucash/report/html-document.scm                   |    2 +-
 gnucash/report/html-fonts.scm                      |    2 +-
 gnucash/report/html-style-sheet.scm                |    4 +-
 gnucash/report/html-utilities.scm                  |    1 +
 gnucash/report/options-utilities.scm               |    2 +-
 gnucash/report/report-core.scm                     |    7 +-
 gnucash/report/report-utilities.scm                |    6 +-
 gnucash/report/report.scm                          |   10 +-
 gnucash/report/reports/CMakeLists.txt              |   29 +-
 gnucash/report/reports/aging.scm                   |   11 +-
 gnucash/report/reports/example/average-balance.scm |   10 +-
 gnucash/report/reports/example/daily-reports.scm   |   10 +-
 gnucash/report/reports/example/hello-world.scm     |   11 +-
 gnucash/report/reports/example/sample-graphs.scm   |   13 +-
 .../report/reports/example/welcome-to-gnucash.scm  |   13 +-
 .../reports/locale-specific/de_DE/taxtxf.scm       |   12 +-
 .../report/reports/locale-specific/us/taxtxf.scm   |   22 +-
 gnucash/report/reports/reports.scm                 |    4 +-
 .../report/reports/standard/account-piecharts.scm  |   10 +-
 .../report/reports/standard/account-summary.scm    |    8 +-
 .../report/reports/standard/advanced-portfolio.scm |    8 +-
 .../report/reports/standard/balance-forecast.scm   |    8 +-
 gnucash/report/reports/standard/balance-sheet.scm  |    8 +-
 gnucash/report/reports/standard/balsheet-eg.scm    |   10 +-
 gnucash/report/reports/standard/balsheet-pnl.scm   |    8 +-
 .../reports/standard/budget-balance-sheet.scm      |   10 +-
 .../report/reports/standard/budget-barchart.scm    |   11 +-
 gnucash/report/reports/standard/budget-flow.scm    |    9 +-
 .../reports/standard/budget-income-statement.scm   |   10 +-
 gnucash/report/reports/standard/budget.scm         |   11 +-
 gnucash/report/reports/standard/cash-flow.scm      |   10 +-
 .../report/reports/standard/cashflow-barchart.scm  |    9 +-
 .../report/reports/standard/category-barchart.scm  |    8 +-
 .../report/reports/standard/customer-summary.scm   |    8 +-
 gnucash/report/reports/standard/dashboard.scm      |   13 +-
 .../report/reports/standard/equity-statement.scm   |   10 +-
 .../report/reports/standard/general-journal.scm    |   10 +-
 gnucash/report/reports/standard/general-ledger.scm |   10 +-
 .../reports/standard/income-gst-statement.scm      |    9 +-
 .../report/reports/standard/income-statement.scm   |   10 +-
 gnucash/report/reports/standard/invoice.scm        |   10 +-
 gnucash/report/reports/standard/job-report.scm     |   10 +-
 gnucash/report/reports/standard/net-charts.scm     |   11 +-
 gnucash/report/reports/standard/new-aging.scm      |   10 +-
 .../report/reports/standard/new-owner-report.scm   |    9 +-
 gnucash/report/reports/standard/owner-report.scm   |    8 +-
 gnucash/report/reports/standard/payables.scm       |    9 +-
 gnucash/report/reports/standard/portfolio.scm      |   10 +-
 gnucash/report/reports/standard/price-scatter.scm  |   11 +-
 gnucash/report/reports/standard/receipt.scm        |   10 +-
 gnucash/report/reports/standard/receivables.scm    |    9 +-
 .../report/reports/standard/reconcile-report.scm   |    7 +-
 gnucash/report/reports/standard/register.scm       |    8 +-
 gnucash/report/reports/standard/taxinvoice.scm     |   10 +-
 .../report/reports/standard/test/CMakeLists.txt    |    3 +-
 .../reports/standard/test/test-account-summary.scm |    4 +-
 .../reports/standard/test/test-average-balance.scm |    6 +-
 .../reports/standard/test/test-balsheet-pnl.scm    |    4 +-
 .../report/reports/standard/test/test-budget.scm   |    4 -
 .../reports/standard/test/test-cash-flow.scm       |    6 +-
 .../standard/test/test-cashflow-barchart.scm       |    7 +-
 .../report/reports/standard/test/test-charts.scm   |    4 +-
 .../standard/test/test-equity-statement.scm        |   10 +-
 .../reports/standard/test/test-income-gst.scm      |    4 +-
 .../report/reports/standard/test/test-invoice.scm  |    4 +-
 .../reports/standard/test/test-owner-report.scm    |    4 +-
 .../reports/standard/test/test-portfolios.scm      |    4 +-
 .../report/reports/standard/test/test-register.scm |    9 -
 .../test/test-standard-category-report.scm         |    9 -
 .../standard/test/test-standard-net-barchart.scm   |    5 +-
 .../standard/test/test-standard-net-linechart.scm  |    5 +-
 .../reports/standard/test/test-stress-options.scm  |    4 +-
 .../reports/standard/test/test-transaction.scm     |    4 +-
 .../reports/standard/test/test-trial-balance.scm   |   10 +-
 gnucash/report/reports/standard/transaction.scm    |    6 +-
 gnucash/report/reports/standard/trial-balance.scm  |    8 +-
 gnucash/report/reports/standard/view-column.scm    |   13 +-
 gnucash/report/stylesheets/CMakeLists.txt          |    4 +-
 gnucash/report/stylesheets/footer.scm              |   10 +-
 gnucash/report/stylesheets/head-or-tail.scm        |   11 +-
 gnucash/report/stylesheets/plain.scm               |    9 +-
 gnucash/report/test/CMakeLists.txt                 |    4 +-
 gnucash/report/test/test-html-chart.scm            |    8 +-
 gnucash/report/test/test-html-utilities-srfi64.scm |    8 +-
 gnucash/report/test/test-load-report-module.scm    |   30 +-
 gnucash/report/test/test-report-html.scm           |   10 +-
 gnucash/report/test/test-report-utilities.scm      |    9 +-
 gnucash/report/test/test-report.scm                |    7 +-
 gnucash/report/trep-engine.scm                     |    6 +-
 libgnucash/CMakeLists.txt                          |    3 +-
 libgnucash/app-utils/CMakeLists.txt                |   69 +-
 libgnucash/app-utils/README                        |   10 -
 libgnucash/app-utils/app-utils.i                   |   34 +-
 libgnucash/app-utils/app-utils.scm                 |   39 +-
 libgnucash/app-utils/business-options.scm          |    1 +
 libgnucash/app-utils/business-prefs.scm            |    2 +-
 libgnucash/app-utils/date-utilities.scm            |   13 +-
 libgnucash/app-utils/gettext.scm                   |   37 -
 libgnucash/app-utils/gnc-exp-parser.c              |    5 +
 libgnucash/app-utils/gnc-gettext-util.c            |   37 -
 libgnucash/app-utils/gnc-gettext-util.h            |   28 -
 libgnucash/app-utils/gnc-gsettings.c               |    2 -
 libgnucash/app-utils/gnc-helpers.c                 |    2 +-
 libgnucash/app-utils/gnc-ui-util.c                 |   50 +-
 libgnucash/app-utils/gncmod-app-utils.c            |  112 --
 libgnucash/app-utils/guile-util.c                  | 1003 -----------
 libgnucash/app-utils/guile-util.h                  |  129 --
 libgnucash/app-utils/option-util.c                 |    1 -
 libgnucash/app-utils/option-util.h                 |    2 +-
 libgnucash/app-utils/options.scm                   |    2 +-
 libgnucash/app-utils/prefs.scm                     |  100 --
 libgnucash/app-utils/test/CMakeLists.txt           |    8 +-
 libgnucash/app-utils/test/test-app-utils.c         |    5 +-
 libgnucash/app-utils/test/test-date-utilities.scm  |    4 +-
 libgnucash/app-utils/test/test-link-module.c       |   41 -
 .../app-utils/test/test-load-app-utils-module.scm  |   50 +-
 libgnucash/app-utils/test/test-options.scm         |    3 +-
 libgnucash/app-utils/test/test-print-queries.cpp   |    6 +-
 .../app-utils/test/test-scm-query-string.cpp       |    7 +-
 libgnucash/backend/dbi/CMakeLists.txt              |    2 +-
 libgnucash/backend/dbi/test/CMakeLists.txt         |    2 +-
 libgnucash/backend/sql/CMakeLists.txt              |    2 +-
 libgnucash/backend/sql/test/CMakeLists.txt         |    2 +-
 libgnucash/backend/xml/CMakeLists.txt              |    6 +-
 libgnucash/backend/xml/gncmod-backend-xml.cpp      |    3 -
 libgnucash/backend/xml/test/CMakeLists.txt         |    5 +-
 .../backend/xml/test/test-load-example-account.cpp |   18 +-
 libgnucash/core-utils/CMakeLists.txt               |  195 +--
 libgnucash/core-utils/core-utils.scm               |   68 -
 libgnucash/engine/Account.cpp                      |   73 +
 libgnucash/engine/Account.h                        |   11 +
 libgnucash/engine/CMakeLists.txt                   |  118 +-
 libgnucash/engine/engine-deprecated.c              |  208 ---
 libgnucash/engine/engine-deprecated.h              |   90 -
 libgnucash/engine/engine-helpers.c                 | 1741 +-------------------
 libgnucash/engine/engine-helpers.h                 |    4 +-
 libgnucash/engine/engine-interface.scm             |  295 ----
 libgnucash/engine/engine-utilities.scm             |   52 -
 libgnucash/engine/gnc-commodity.c                  |    2 +-
 libgnucash/engine/gnc-hooks-scm.h                  |   36 -
 libgnucash/engine/gnc-hooks.c                      |  123 +-
 libgnucash/engine/gnc-hooks.h                      |    9 +-
 libgnucash/engine/gncBusGuile.c                    |   84 -
 libgnucash/engine/gncBusGuile.h                    |   33 -
 libgnucash/engine/gncmod-engine.c                  |   81 -
 libgnucash/engine/test/CMakeLists.txt              |   75 +-
 libgnucash/engine/test/test-business.c             |    7 +-
 libgnucash/engine/test/test-customer.c             |    2 +-
 libgnucash/engine/test/test-employee.c             |    2 +-
 .../engine/test/test-transaction-reversal.cpp      |    1 -
 .../engine/test/test-transaction-voiding.cpp       |    1 -
 libgnucash/gnc-module/CMakeLists.txt               |   23 +-
 libgnucash/gnc-module/doc/design.txt               |   30 +-
 libgnucash/gnc-module/example/gncmod-example.c     |   11 -
 libgnucash/gnc-module/gnc-module.c                 |    2 +-
 libgnucash/gnc-module/gnc-module.i                 |   39 -
 libgnucash/gnc-module/test/CMakeLists.txt          |   97 +-
 .../gnc-module/test/misc-mods/CMakeLists.txt       |    9 +-
 libgnucash/gnc-module/test/misc-mods/incompatdep.c |    2 +-
 libgnucash/gnc-module/test/mod-bar/CMakeLists.txt  |   35 -
 libgnucash/gnc-module/test/mod-bar/bar.c           |   33 -
 libgnucash/gnc-module/test/mod-bar/bar.i           |   33 -
 libgnucash/gnc-module/test/mod-bar/gnucash/bar.scm |   31 -
 libgnucash/gnc-module/test/mod-baz/CMakeLists.txt  |   40 -
 libgnucash/gnc-module/test/mod-baz/baz.i           |   33 -
 libgnucash/gnc-module/test/mod-baz/gnc-mod-baz.c   |   72 -
 libgnucash/gnc-module/test/mod-foo/CMakeLists.txt  |   34 -
 libgnucash/gnc-module/test/mod-foo/foo.h           |   28 -
 libgnucash/gnc-module/test/mod-foo/foo.i           |   33 -
 libgnucash/gnc-module/test/mod-foo/gnc-mod-foo.c   |   63 -
 libgnucash/gnc-module/test/mod-foo/gnucash/foo.scm |   31 -
 .../gnc-module/test/mod-ordinary/CMakeLists.txt    |   21 +
 .../agedver.c => mod-ordinary/gnc-mod-ordinary.c}  |   31 +-
 .../{mod-foo/foo.c => mod-ordinary/ordinary.c}     |    6 +-
 .../{mod-baz/baz.h => mod-ordinary/ordinary.h}     |    8 +-
 .../gnc-module/test/mod-withdep/CMakeLists.txt     |   27 +
 .../gnc-mod-withdep.c}                             |   40 +-
 .../test/{mod-baz/baz.c => mod-withdep/withdep.c}  |   12 +-
 .../test/{mod-bar/bar.h => mod-withdep/withdep.h}  |    8 +-
 libgnucash/gnc-module/test/test-agedver.c          |   24 +-
 libgnucash/gnc-module/test/test-dynload.c          |   20 +-
 .../gnc-module/test/test-gnc-module-load-deps.scm  |   22 -
 .../gnc-module/test/test-gnc-module-load-scm.scm   |   14 -
 .../test/test-gnc-module-scm-dynload.scm           |    2 -
 .../gnc-module/test/test-gnc-module-scm-init.scm   |   15 -
 .../gnc-module/test/test-gnc-module-scm-module.scm |   14 -
 .../gnc-module/test/test-gnc-module-scm-multi.scm  |   23 -
 .../gnc-module/test/test-gnc-module-swigged-c.scm  |   14 -
 libgnucash/gnc-module/test/test-incompatdep.c      |   29 +-
 libgnucash/gnc-module/test/test-load-c.c           |   83 +-
 libgnucash/gnc-module/test/test-modsysver.c        |   13 +-
 libgnucash/scm/CMakeLists.txt                      |   24 -
 libgnucash/scm/test/CMakeLists.txt                 |   34 -
 libgnucash/tax/CMakeLists.txt                      |   17 +-
 libgnucash/tax/de_DE/tax.scm                       |    8 +-
 .../tax/{gncmod-locale-tax.c => gnc-locale-tax.c}  |   55 +-
 .../tax/gnc-locale-tax.h                           |   20 +-
 libgnucash/tax/test/CMakeLists.txt                 |   28 +-
 libgnucash/tax/test/test-link-module.c             |   25 +-
 .../tax/test/test-load-locale-tax-module.scm       |   11 -
 libgnucash/tax/us/txf.scm                          |    2 +
 po/POTFILES.in                                     |   40 +-
 317 files changed, 3492 insertions(+), 7107 deletions(-)
 rename {libgnucash/engine => bindings}/business-core.i (99%)
 rename {libgnucash/core-utils => bindings}/core-utils.i (100%)
 rename {libgnucash/engine => bindings}/engine-common.i (100%)
 rename {libgnucash/engine => bindings}/engine.i (93%)
 create mode 100644 bindings/guile/CMakeLists.txt
 rename {libgnucash/engine => bindings/guile}/business-core.scm (93%)
 rename {libgnucash/engine => bindings/guile}/commodity-table.scm (100%)
 rename libgnucash/gnc-module/gnc-module.scm => bindings/guile/core-utils.scm (56%)
 rename {libgnucash/engine => bindings/guile}/engine.scm (50%)
 rename libgnucash/engine/glib-helpers.c => bindings/guile/glib-guile.c (56%)
 rename libgnucash/engine/glib-helpers.h => bindings/guile/glib-guile.h (53%)
 copy libgnucash/engine/engine-helpers.c => bindings/guile/gnc-engine-guile.c (86%)
 rename libgnucash/engine/engine-helpers-guile.h => bindings/guile/gnc-engine-guile.h (73%)
 copy libgnucash/backend/xml/test/test-xml2-is-file.cpp => bindings/guile/gnc-guile-bindings.c (66%)
 rename {libgnucash/core-utils => bindings/guile}/gnc-guile-utils.c (100%)
 rename {libgnucash/core-utils => bindings/guile}/gnc-guile-utils.h (100%)
 rename libgnucash/engine/kvp-scm.cpp => bindings/guile/gnc-kvp-guile.cpp (98%)
 rename libgnucash/engine/kvp-scm.h => bindings/guile/gnc-kvp-guile.h (100%)
 create mode 100644 bindings/guile/gnc-module.scm
 rename {libgnucash/engine => bindings/guile}/gnc-numeric.scm (100%)
 create mode 100644 bindings/guile/test/CMakeLists.txt
 rename {libgnucash/engine => bindings/guile}/test/srfi64-extras.scm (100%)
 rename {libgnucash/engine => bindings/guile}/test/test-business-core.scm (98%)
 create mode 100644 bindings/guile/test/test-core-utils.scm
 rename {libgnucash/engine => bindings/guile}/test/test-create-account.scm (93%)
 rename {libgnucash/engine => bindings/guile}/test/test-engine-extras.scm (100%)
 rename {libgnucash/scm => bindings/guile}/test/test-module-deprecation.scm (100%)
 rename {libgnucash/engine => bindings/guile}/test/test-scm-query-import.scm (99%)
 rename {libgnucash/engine => bindings/guile}/test/test-scm-query.cpp (96%)
 rename libgnucash/scm/test/test-libgnucash-scm-utilities.scm => bindings/guile/test/test-scm-utilities.scm (95%)
 rename {libgnucash/scm => bindings/guile}/utilities.scm (98%)
 rename {libgnucash/app-utils => gnucash/gnome-utils}/gnc-component-manager.c (100%)
 rename {libgnucash/app-utils => gnucash/gnome-utils}/gnc-component-manager.h (100%)
 rename libgnucash/gnc-module/test/mod-baz/gnucash/baz.scm => gnucash/html/html.scm (57%)
 rename {libgnucash/scm => gnucash}/price-quotes.scm (99%)
 create mode 100644 gnucash/register/ledger-core/split-register-copy-ops.c
 create mode 100644 gnucash/register/ledger-core/split-register-copy-ops.h
 copy libgnucash/engine/test/test-qof.c => gnucash/register/ledger-core/test/test-split-register.c (72%)
 create mode 100644 gnucash/register/ledger-core/test/utest-split-register-copy-ops.c
 delete mode 100644 libgnucash/app-utils/README
 delete mode 100644 libgnucash/app-utils/gettext.scm
 delete mode 100644 libgnucash/app-utils/gnc-gettext-util.c
 delete mode 100644 libgnucash/app-utils/gnc-gettext-util.h
 delete mode 100644 libgnucash/app-utils/gncmod-app-utils.c
 delete mode 100644 libgnucash/app-utils/guile-util.c
 delete mode 100644 libgnucash/app-utils/guile-util.h
 delete mode 100644 libgnucash/app-utils/prefs.scm
 delete mode 100644 libgnucash/app-utils/test/test-link-module.c
 delete mode 100644 libgnucash/core-utils/core-utils.scm
 delete mode 100644 libgnucash/engine/engine-deprecated.c
 delete mode 100644 libgnucash/engine/engine-deprecated.h
 delete mode 100644 libgnucash/engine/engine-interface.scm
 delete mode 100644 libgnucash/engine/engine-utilities.scm
 delete mode 100644 libgnucash/engine/gnc-hooks-scm.h
 delete mode 100644 libgnucash/engine/gncBusGuile.c
 delete mode 100644 libgnucash/engine/gncBusGuile.h
 delete mode 100644 libgnucash/engine/gncmod-engine.c
 delete mode 100644 libgnucash/gnc-module/gnc-module.i
 delete mode 100644 libgnucash/gnc-module/test/mod-bar/CMakeLists.txt
 delete mode 100644 libgnucash/gnc-module/test/mod-bar/bar.c
 delete mode 100644 libgnucash/gnc-module/test/mod-bar/bar.i
 delete mode 100644 libgnucash/gnc-module/test/mod-bar/gnucash/bar.scm
 delete mode 100644 libgnucash/gnc-module/test/mod-baz/CMakeLists.txt
 delete mode 100644 libgnucash/gnc-module/test/mod-baz/baz.i
 delete mode 100644 libgnucash/gnc-module/test/mod-baz/gnc-mod-baz.c
 delete mode 100644 libgnucash/gnc-module/test/mod-foo/CMakeLists.txt
 delete mode 100644 libgnucash/gnc-module/test/mod-foo/foo.h
 delete mode 100644 libgnucash/gnc-module/test/mod-foo/foo.i
 delete mode 100644 libgnucash/gnc-module/test/mod-foo/gnc-mod-foo.c
 delete mode 100644 libgnucash/gnc-module/test/mod-foo/gnucash/foo.scm
 create mode 100644 libgnucash/gnc-module/test/mod-ordinary/CMakeLists.txt
 copy libgnucash/gnc-module/test/{misc-mods/agedver.c => mod-ordinary/gnc-mod-ordinary.c} (69%)
 rename libgnucash/gnc-module/test/{mod-foo/foo.c => mod-ordinary/ordinary.c} (92%)
 rename libgnucash/gnc-module/test/{mod-baz/baz.h => mod-ordinary/ordinary.h} (90%)
 create mode 100644 libgnucash/gnc-module/test/mod-withdep/CMakeLists.txt
 rename libgnucash/gnc-module/test/{mod-bar/gnc-mod-bar.c => mod-withdep/gnc-mod-withdep.c} (63%)
 rename libgnucash/gnc-module/test/{mod-baz/baz.c => mod-withdep/withdep.c} (86%)
 rename libgnucash/gnc-module/test/{mod-bar/bar.h => mod-withdep/withdep.h} (91%)
 delete mode 100755 libgnucash/gnc-module/test/test-gnc-module-load-deps.scm
 delete mode 100755 libgnucash/gnc-module/test/test-gnc-module-load-scm.scm
 delete mode 100755 libgnucash/gnc-module/test/test-gnc-module-scm-dynload.scm
 delete mode 100755 libgnucash/gnc-module/test/test-gnc-module-scm-init.scm
 delete mode 100755 libgnucash/gnc-module/test/test-gnc-module-scm-module.scm
 delete mode 100755 libgnucash/gnc-module/test/test-gnc-module-scm-multi.scm
 delete mode 100755 libgnucash/gnc-module/test/test-gnc-module-swigged-c.scm
 delete mode 100644 libgnucash/scm/CMakeLists.txt
 delete mode 100644 libgnucash/scm/test/CMakeLists.txt
 rename libgnucash/tax/{gncmod-locale-tax.c => gnc-locale-tax.c} (63%)
 copy gnucash/gnome/business-urls.h => libgnucash/tax/gnc-locale-tax.h (68%)
 delete mode 100755 libgnucash/tax/test/test-load-locale-tax-module.scm



More information about the gnucash-changes mailing list