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,8 +1,8 @@ # 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 # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # @@ -56,24 +56,25 @@ untabify: @emacs -batch -l untabify.el $(info_TEXINFOS) $(mailfromd_TEXINFOS) 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)' # Make sure you set TEXINPUTS. # TEXINPUTS=/usr/share/texmf/pdftex/plain/misc/ is ok for most distributions .PHONY: manual manual: TEXINPUTS=$(srcdir):$(top_srcdir)/build-aux:$(TEXINPUTS) \ MAKEINFO="$(MAKEINFO) $(MAKEINFOFLAGS)" \ TEXI2DVI="$(TEXI2DVI) -t @finalout" \ - $(GENDOCS) --no-copy-images $(PACKAGE) '$(PACKAGE_NAME) manual' + $(GENDOCS) $(PACKAGE) '$(PACKAGE_NAME) manual' manual.tar.bz2: manual tar cf manual.tar manual tar -r -f manual.tar --transform 's|^|graphics/|' smapflow.png bzip2 -f manual.tar diff --git a/doc/Config b/doc/html.init index 64a7efb..738e2a9 100644 --- a/doc/Config +++ b/doc/html.init @@ -75,20 +75,18 @@ set_from_init_file('PRE_BODY_CLOSE', set_from_init_file('PROGRAM_NAME_IN_FOOTER',1); # Disable horizontal bars 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); set_from_init_file('ACTIVE_ICONS', { 'Top' => "$graphics_dir/top.png", 'Contents' => "$graphics_dir/ctx.png", @@ -149,14 +147,17 @@ sub gray_chap_ref($$) my @gray_buttons = (\&gray_document_title, ' ', \&gray_sec_ref, 'Back', 'Forward', ' ', \&gray_chap_ref, 'FastBack', ' ', 'Up', ' ', 'FastForward', ' ', '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, 'Contents', 'Index', ' ', 'About' 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,8 +1,8 @@ /* 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 it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. @@ -103,16 +103,16 @@ guile_call_proc(SCM *result, SCM proc, SCM arglist) char *name = proc_name(proc); smap_error("procedure `%s' failed", name); free(name); return 1; } - *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; } struct load_closure { char *filename; int argc; diff --git a/src/smapc.c b/src/smapc.c index 3fe930b..3beaa63 100644 --- a/src/smapc.c +++ b/src/smapc.c @@ -45,13 +45,14 @@ #include <smap/module.h> #include <smap/url.h> 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; char *curserver; int norc; int quiet_startup; char *server_option; @@ -122,17 +123,21 @@ get_input_line(FILE *fp, int interactive) { char sbuf[512]; static char *buf = NULL; static size_t bufsize = 0; 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); buf = emalloc(bufsize); } buflevel = 0; while (fgets(sbuf, sizeof sbuf, fp)) { @@ -750,12 +755,15 @@ main(int argc, char **argv) if (!smapc_connect(argv[0])) exit(EX_UNAVAILABLE); /* FIXME: or EX_USAGE */ smapc_query(iostr, argv[1], argv[2]); exit(0); } + if (!prompt) + prompt = estrdup(DEFAULT_PROMPT); + if (server_option) smapc_connect(server_option); if (argc) { curmap = estrdup(*argv++); argc--; |