This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU Guile".
http://git.savannah.gnu.org/cgit/guile.git/commit/?id=b710608c87f3a868921855d45c41f77b1f5c0dc2 The branch, master has been updated via b710608c87f3a868921855d45c41f77b1f5c0dc2 (commit) via ec84b0a2514b7cf70ad6423ab0454b74ab639ef9 (commit) from 1c20cf117505dff5e0bb8bb6f1b1ed0ff9272d30 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit b710608c87f3a868921855d45c41f77b1f5c0dc2 Author: Andreas Rottmann <[email protected]> Date: Sat Nov 20 01:05:10 2010 +0100 Allow specifying load extensions on the command line Add a new command-line switch `-x', which manipulates the %load-extensions list. * libguile/script.c (scm_compile_shell_switches): Process the new "-x" switch. (scm_shell_usage): Mention the "-x" switch. * doc/ref/scheme-scripts.texi (Invoking Guile): Add "-x" switch to the list of command-line switches. Signed-off-by: Ludovic Courtès <[email protected]> commit ec84b0a2514b7cf70ad6423ab0454b74ab639ef9 Author: Ludovic Courtès <[email protected]> Date: Sat Nov 20 00:47:12 2010 +0100 Use `define-module*' in (ice-9 history). * module/ice-9/history.scm: Use `define-module*' instead of `process-define-module'. ----------------------------------------------------------------------- Summary of changes: NEWS | 7 +++++++ doc/ref/scheme-scripts.texi | 7 +++++++ libguile/script.c | 22 +++++++++++++++++++++- module/ice-9/history.scm | 2 +- 4 files changed, 36 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 5f4d838..c8c3091 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,13 @@ Please send Guile bug reports to [email protected]. Note: During the 1.9 series, we will keep an incremental NEWS for the latest prerelease, and a full NEWS corresponding to 1.8 -> 2.0. +Changes in 1.9.14 (since the 1.9.13 prerelease): + +** Command line additions + +The guile binary now supports a new switch "-x", which can be used to +extend the list of filename extensions tried when loading files +(%load-extensions). Changes in 1.9.13 (since the 1.9.12 prerelease): diff --git a/doc/ref/scheme-scripts.texi b/doc/ref/scheme-scripts.texi index 225b34b..e30a9d7 100644 --- a/doc/ref/scheme-scripts.texi +++ b/doc/ref/scheme-scripts.texi @@ -116,6 +116,13 @@ and before any directories in the GUILE_LOAD_PATH environment variable. Paths added here are @emph{not} in effect during execution of the user's @file{.guile} file. +...@item -x @var{extension} +Add @var{extension} to the front of Guile's load extension list +(@pxref{Loading, @code{%load-extensions}}). The specified extensions +are tried in the order given on the command line, and before the default +load extensions. Extensions added here are @emph{not} in effect during +execution of the user's @file{.guile} file. + @item -l @var{file} Load Scheme source code from @var{file}, and continue processing the command line. diff --git a/libguile/script.c b/libguile/script.c index caf3ac6..d61d8ca 100644 --- a/libguile/script.c +++ b/libguile/script.c @@ -374,6 +374,7 @@ scm_shell_usage (int fatal, char *message) "If FILE begins with `-' the -s switch is mandatory.\n" "\n" " -L DIRECTORY add DIRECTORY to the front of the module load path\n" + " -x EXTENSION add EXTENSION to the front of the load extensions\n" " -l FILE load Scheme source code from FILE\n" " -e FUNCTION after reading script, apply FUNCTION to\n" " command line arguments\n" @@ -414,6 +415,7 @@ SCM_SYMBOL (sym_top_repl, "top-repl"); SCM_SYMBOL (sym_quit, "quit"); SCM_SYMBOL (sym_use_srfis, "use-srfis"); SCM_SYMBOL (sym_load_path, "%load-path"); +SCM_SYMBOL (sym_load_extensions, "%load-extensions"); SCM_SYMBOL (sym_set_x, "set!"); SCM_SYMBOL (sym_sys_load_should_autocompile, "%load-should-autocompile"); SCM_SYMBOL (sym_cons, "cons"); @@ -455,6 +457,7 @@ scm_compile_shell_switches (int argc, char **argv) the "-ds" switch. */ SCM entry_point = SCM_EOL; /* for -e switch */ SCM user_load_path = SCM_EOL; /* for -L switch */ + SCM user_extensions = SCM_EOL;/* for -x switch */ int interactive = 1; /* Should we go interactive when done? */ int inhibit_user_init = 0; /* Don't load user init file */ int turn_on_debugging = 0; @@ -546,6 +549,20 @@ scm_compile_shell_switches (int argc, char **argv) scm_shell_usage (1, "missing argument to `-L' switch"); } + else if (! strcmp (argv[i], "-x")) /* add to %load-extensions */ + { + if (++i < argc) + user_extensions = + scm_cons (scm_list_3 (sym_set_x, + sym_load_extensions, + scm_list_3 (sym_cons, + scm_from_locale_string (argv[i]), + sym_load_extensions)), + user_extensions); + else + scm_shell_usage (1, "missing argument to `-x' switch"); + } + else if (! strcmp (argv[i], "-e")) /* entry point */ { if (++i < argc) @@ -762,7 +779,10 @@ scm_compile_shell_switches (int argc, char **argv) { tail = scm_append_x( scm_cons2(user_load_path, tail, SCM_EOL) ); } - + + if (!scm_is_null (user_extensions)) + tail = scm_append_x (scm_cons2 (user_extensions, tail, SCM_EOL)); + /* If we didn't end with a -c or a -s and didn't supply a -q, load the user's customization file. */ if (interactive && !inhibit_user_init) diff --git a/module/ice-9/history.scm b/module/ice-9/history.scm index 7761dae..ebf609b 100644 --- a/module/ice-9/history.scm +++ b/module/ice-9/history.scm @@ -21,7 +21,7 @@ #:export (value-history-enabled? enable-value-history! disable-value-history! clear-value-history!)) -(process-define-module '((value-history))) +(define-module* '(value-history)) (define *value-history-enabled?* #f) (define (value-history-enabled?) hooks/post-receive -- GNU Guile
