mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-02 13:00:26 +02:00
* script.c (scm_compile_shell_switches): Add handling of -q switch
(inhibit loading of user init file). (scm_shell_usage): Add usage text for -q switch. (scm_compile_shell_switches): Always load user init file first if it is loaded at all.
This commit is contained in:
parent
d509e5f6b3
commit
97c524bd4a
2 changed files with 25 additions and 4 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
1998-10-17 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
|
||||||
|
|
||||||
|
* script.c (scm_compile_shell_switches): Add handling of -q switch
|
||||||
|
(inhibit loading of user init file).
|
||||||
|
(scm_shell_usage): Add usage text for -q switch.
|
||||||
|
(scm_compile_shell_switches): Always load user init file first if
|
||||||
|
it is loaded at all.
|
||||||
|
|
||||||
1998-10-16 Jim Blandy <jimb@zwingli.cygnus.com>
|
1998-10-16 Jim Blandy <jimb@zwingli.cygnus.com>
|
||||||
|
|
||||||
* stime.c: The CPP hair to determine a value for CLKTCK is weird,
|
* stime.c: The CPP hair to determine a value for CLKTCK is weird,
|
||||||
|
|
|
@ -385,6 +385,7 @@ scm_shell_usage (int fatal, char *message)
|
||||||
" -e FUNCTION after reading script, apply FUNCTION to\n"
|
" -e FUNCTION after reading script, apply FUNCTION to\n"
|
||||||
" command line arguments\n"
|
" command line arguments\n"
|
||||||
" -ds do -s script at this point\n"
|
" -ds do -s script at this point\n"
|
||||||
|
" -q inhibit loading of user init file\n"
|
||||||
" --emacs enable Emacs protocol (experimental)\n"
|
" --emacs enable Emacs protocol (experimental)\n"
|
||||||
" -h, --help display this help and exit\n"
|
" -h, --help display this help and exit\n"
|
||||||
" -v, --version display version information and exit\n"
|
" -v, --version display version information and exit\n"
|
||||||
|
@ -437,6 +438,7 @@ scm_compile_shell_switches (int argc, char **argv)
|
||||||
the "-ds" switch. */
|
the "-ds" switch. */
|
||||||
SCM entry_point = SCM_EOL; /* for -e switch */
|
SCM entry_point = SCM_EOL; /* for -e switch */
|
||||||
int interactive = 1; /* Should we go interactive when done? */
|
int interactive = 1; /* Should we go interactive when done? */
|
||||||
|
int inhibit_user_init = 0; /* Don't load user init file */
|
||||||
int use_emacs_interface = 0;
|
int use_emacs_interface = 0;
|
||||||
int i;
|
int i;
|
||||||
char *argv0 = guile;
|
char *argv0 = guile;
|
||||||
|
@ -532,6 +534,9 @@ scm_compile_shell_switches (int argc, char **argv)
|
||||||
else if (! strcmp (argv[i], "--emacs")) /* use emacs protocol */
|
else if (! strcmp (argv[i], "--emacs")) /* use emacs protocol */
|
||||||
use_emacs_interface = 1;
|
use_emacs_interface = 1;
|
||||||
|
|
||||||
|
else if (! strcmp (argv[i], "-q")) /* don't load user init */
|
||||||
|
inhibit_user_init = 1;
|
||||||
|
|
||||||
else if (! strcmp (argv[i], "-h")
|
else if (! strcmp (argv[i], "-h")
|
||||||
|| ! strcmp (argv[i], "--help"))
|
|| ! strcmp (argv[i], "--help"))
|
||||||
{
|
{
|
||||||
|
@ -580,11 +585,9 @@ scm_compile_shell_switches (int argc, char **argv)
|
||||||
SCM_EOL),
|
SCM_EOL),
|
||||||
tail);
|
tail);
|
||||||
|
|
||||||
/* If we didn't end with a -c or a -s, load the user's customization
|
/* If we didn't end with a -c or a -s, start the repl. */
|
||||||
file, and start the repl. */
|
|
||||||
if (interactive)
|
if (interactive)
|
||||||
{
|
{
|
||||||
tail = scm_cons (scm_cons (sym_load_user_init, SCM_EOL), tail);
|
|
||||||
tail = scm_cons (scm_cons (sym_top_repl, SCM_EOL), tail);
|
tail = scm_cons (scm_cons (sym_top_repl, SCM_EOL), tail);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -597,8 +600,18 @@ scm_compile_shell_switches (int argc, char **argv)
|
||||||
scm_mask_ints = 0;
|
scm_mask_ints = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* After the following line, actions will be added to the front. */
|
||||||
|
tail = scm_reverse_x (tail, SCM_UNDEFINED);
|
||||||
|
|
||||||
|
/* 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)
|
||||||
{
|
{
|
||||||
SCM val = scm_cons (sym_begin, scm_reverse_x (tail, SCM_UNDEFINED));
|
tail = scm_cons (scm_cons (sym_load_user_init, SCM_EOL), tail);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
SCM val = scm_cons (sym_begin, tail);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
scm_write (val, SCM_UNDEFINED);
|
scm_write (val, SCM_UNDEFINED);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue