diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2015-06-20 23:06:20 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2015-06-20 23:18:23 +0300 |
commit | f59f778ea485064a6679892c10c1fd7c9dd65a13 (patch) | |
tree | ded703f8f79cfec5fa49ca71b9059de56568ffa7 | |
parent | 91b66f0a3815e2d1517b4643ba8c15a151aed230 (diff) | |
download | smap-f59f778ea485064a6679892c10c1fd7c9dd65a13.tar.gz smap-f59f778ea485064a6679892c10c1fd7c9dd65a13.tar.bz2 |
Minor changes
* src/smapc.c (prompt): Don't use static string. Fixes coredump
on using "prompt" command.
(get_input_line) [!WITH_READLINE]: Print prompt.
(main): Initialize prompt.
* doc/Makefile.am (GENDOCS): Add html-specific configuration file.
* doc/Config: Renamed to doc/html.init
* modules/guile/guile.c (guile_call_proc): Use scm_c_catch
-rw-r--r-- | doc/Makefile.am | 7 | ||||
-rw-r--r-- | doc/html.init (renamed from doc/Config) | 13 | ||||
-rw-r--r-- | modules/guile/guile.c | 10 | ||||
-rw-r--r-- | src/smapc.c | 14 |
4 files changed, 27 insertions, 17 deletions
diff --git a/doc/Makefile.am b/doc/Makefile.am index f1ac7a9..d67d4ab 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,4 +1,4 @@ # This file is part of Smap. -# Copyright (C) 2010, 2014 Sergey Poznyakoff +# Copyright (C) 2010, 2014, 2015 Sergey Poznyakoff # # Smap is free software; you can redistribute it and/or modify @@ -60,5 +60,6 @@ final: untabify master-menu MAKEINFOFLAGS= -GENDOCS=$(srcdir)/gendocs.sh +GENDOCS=$(srcdir)/gendocs.sh --no-copy-images --html '--init-file=$(abs_srcdir)/html.init' +EXTRA_DIST += gendocs.sh TEXI2DVI=texi2dvi -t '@set $(RENDITION)' @@ -71,5 +72,5 @@ manual: MAKEINFO="$(MAKEINFO) $(MAKEINFOFLAGS)" \ TEXI2DVI="$(TEXI2DVI) -t @finalout" \ - $(GENDOCS) --no-copy-images $(PACKAGE) '$(PACKAGE_NAME) manual' + $(GENDOCS) $(PACKAGE) '$(PACKAGE_NAME) manual' manual.tar.bz2: manual diff --git a/doc/Config b/doc/html.init index 64a7efb..738e2a9 100644 --- a/doc/Config +++ b/doc/html.init @@ -79,12 +79,10 @@ set_from_init_file('DEFAULT_RULE', ''); set_from_init_file('BIG_RULE', ''); -# Turn off footer buttons in section split -set_from_init_file('SECTION_FOOTER_BUTTONS', undef); -#set_from_init_file('SECTION_BUTTONS', undef); -# Turn off navigation bars at the bottom of each section in chapter split mode +# Turn off navigation bars at the bottom of each section in chapter split mode, +# or subsection in section split mode. set_from_init_file('HEADERS', undef) - if (get_conf('SPLIT') and (get_conf('SPLIT') eq 'chapter')); -# Use navigation icons + if ((get_conf('SPLIT') eq 'chapter') or (get_conf('SPLIT') eq 'section')); +# Use navigation icons set_from_init_file('ICONS', 1); @@ -153,6 +151,9 @@ my @gray_buttons = (\&gray_document_title, ' ', 'Contents', 'Index' ); +set_from_init_file('TOP_BUTTONS', undef); set_from_init_file('SECTION_BUTTONS', \@gray_buttons); set_from_init_file('CHAPTER_BUTTONS', \@gray_buttons); +set_from_init_file('NODE_FOOTER_BUTTONS', \@gray_buttons); +set_from_init_file('SECTION_FOOTER_BUTTONS', \@gray_buttons); set_from_init_file('MISC_BUTTONS', [\&gray_document_title, diff --git a/modules/guile/guile.c b/modules/guile/guile.c index afaeef5..ae63a51 100644 --- a/modules/guile/guile.c +++ b/modules/guile/guile.c @@ -1,4 +1,4 @@ /* This file is part of Smap. - Copyright (C) 2010, 2014 Sergey Poznyakoff + Copyright (C) 2010, 2014, 2015 Sergey Poznyakoff Smap is free software; you can redistribute it and/or modify @@ -107,8 +107,8 @@ guile_call_proc(SCM *result, SCM proc, SCM arglist) } - *result = scm_internal_lazy_catch(SCM_BOOL_T, - eval_catch_body, - scm_cons(proc, arglist), - eval_catch_handler, &jmp_env); + *result = scm_c_catch(SCM_BOOL_T, + eval_catch_body, scm_cons(proc, arglist), + eval_catch_handler, &jmp_env, + NULL, NULL); return 0; } diff --git a/src/smapc.c b/src/smapc.c index 3fe930b..3beaa63 100644 --- a/src/smapc.c +++ b/src/smapc.c @@ -49,5 +49,6 @@ int smapc_trace_option; int batch_mode; struct in_addr source_addr; -char *prompt = "(smapc) "; +#define DEFAULT_PROMPT "(smapc) " +char *prompt; int cmdprefix = '.'; char *curmap; @@ -126,9 +127,13 @@ get_input_line(FILE *fp, int interactive) size_t buflevel; -#ifdef WITH_READLINE if (interactive) { +#ifdef WITH_READLINE return readline(prompt); - } +#else + fputs(prompt, stdout); + fflush(stdout); #endif + } + if (bufsize == 0) { bufsize = sizeof(sbuf); @@ -754,4 +759,7 @@ main(int argc, char **argv) } + if (!prompt) + prompt = estrdup(DEFAULT_PROMPT); + if (server_option) smapc_connect(server_option); |