From e6034b0e952cbf262182f869ac26600a7dd58ab0 Mon Sep 17 00:00:00 2001 From: h_vogt Date: Fri, 8 Jan 2016 23:56:27 +0100 Subject: [PATCH] postcoms.c, change command `setplot' `setplot' print a list of plots available `setplot ' make the current plot `setplot new' create a new plot --- src/frontend/postcoms.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/frontend/postcoms.c b/src/frontend/postcoms.c index a3f836f9e..2b6b71bbb 100644 --- a/src/frontend/postcoms.c +++ b/src/frontend/postcoms.c @@ -930,31 +930,28 @@ DelPlotWindows(struct plot *pl) } +/* + * command 'setplot' + * print a list of plots available + * command 'setplot ' + * make the current plot + * command 'setplot new' + * create a new plot + */ + void com_splot(wordlist *wl) { struct plot *pl; - char buf[BSIZE_SP], *s, *t; if (wl) { plot_setcur(wl->wl_word); return; } - fprintf(cp_out, "\tType the name of the desired plot:\n\n"); - fprintf(cp_out, "\tnew\tNew plot\n"); + + fprintf(cp_out, "List of plots available:\n\n"); for (pl = plot_list; pl; pl = pl->pl_next) fprintf(cp_out, "%s%s\t%s (%s)\n", (pl == plot_cur) ? "Current " : "\t", pl->pl_typename, pl->pl_title, pl->pl_name); - - fprintf(cp_out, "? "); - if (!fgets(buf, BSIZE_SP, cp_in)) { - clearerr(cp_in); - return; - } - t = buf; - if ((s = gettok(&t)) == NULL) - return; - - plot_setcur(s); }