summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org>2015-06-20 20:06:20 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2015-06-20 20:18:23 (GMT)
commitf59f778ea485064a6679892c10c1fd7c9dd65a13 (patch) (side-by-side diff)
treeded703f8f79cfec5fa49ca71b9059de56568ffa7
parent91b66f0a3815e2d1517b4643ba8c15a151aed230 (diff)
downloadsmap-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
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--doc/Makefile.am7
-rw-r--r--doc/html.init (renamed from doc/Config)13
-rw-r--r--modules/guile/guile.c10
-rw-r--r--src/smapc.c14
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,5 +1,5 @@
# 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
@@ -59,7 +59,8 @@ 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)'
@@ -70,7 +71,7 @@ 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
diff --git a/doc/Config b/doc/html.init
index 64a7efb..738e2a9 100644
--- a/doc/Config
+++ b/doc/html.init
@@ -78,14 +78,12 @@ set_from_init_file('PROGRAM_NAME_IN_FOOTER',1);
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',
@@ -152,8 +150,11 @@ my @gray_buttons = (\&gray_document_title, ' ',
'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',
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,5 +1,5 @@
/* 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
@@ -106,10 +106,10 @@ guile_call_proc(SCM *result, SCM proc, SCM arglist)
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;
}
diff --git a/src/smapc.c b/src/smapc.c
index 3fe930b..3beaa63 100644
--- a/src/smapc.c
+++ b/src/smapc.c
@@ -48,7 +48,8 @@
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;
@@ -125,11 +126,15 @@ get_input_line(FILE *fp, int interactive)
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);
@@ -753,6 +758,9 @@ main(int argc, char **argv)
exit(0);
}
+ if (!prompt)
+ prompt = estrdup(DEFAULT_PROMPT);
+
if (server_option)
smapc_connect(server_option);

Return to:

Send suggestions and report system problems to the System administrator.