+Sat Nov 4 11:47:09 2006 Ben Pfaff <blp@gnu.org>
+
+ Implement SET ERRORS, SHOW ERRORS. Fixes bug #17609.
+
+ * settings.c: (route_errors_to_terminal) New variable.
+ (route_errors_to_listing) New variable.
+ (get_error_routing_to_terminal) New function.
+ (set_error_routing_to_terminal) New function.
+ (get_error_routing_to_listing) New function.
+ (set_error_routing_to_listing) New function.
+
+ * settings.h: (SET_ROUTE_* enums) Removed, because unused.
+
Tue Oct 31 19:58:27 2006 Ben Pfaff <blp@gnu.org>
* format.c: Completely rewrite, to achieve better abstraction.
static bool errorbreak = false;
+static bool route_errors_to_terminal = true;
+static bool route_errors_to_listing = true;
+
static bool scompress = true;
static bool undefined = true;
errorbreak = errorbreak_;
}
+/* Route error messages to terminal? */
+bool
+get_error_routing_to_terminal (void)
+{
+ return route_errors_to_terminal;
+}
+
+/* Sets whether error messages should be routed to the
+ terminal. */
+void
+set_error_routing_to_terminal (bool route_to_terminal)
+{
+ route_errors_to_terminal = route_to_terminal;
+}
+
+/* Route error messages to listing file? */
+bool
+get_error_routing_to_listing (void)
+{
+ return route_errors_to_listing;
+}
+
+/* Sets whether error messages should be routed to the
+ listing file. */
+void
+set_error_routing_to_listing (bool route_to_listing)
+{
+ route_errors_to_listing = route_to_listing;
+}
+
/* Compress system files by default? */
bool
get_scompression (void)
#include <stdbool.h>
#include <stddef.h>
-/* Types of routing. */
-enum
- {
- SET_ROUTE_SCREEN = 001, /* Output to screen devices? */
- SET_ROUTE_LISTING = 002, /* Output to listing devices? */
- SET_ROUTE_OTHER = 004, /* Output to other devices? */
- SET_ROUTE_DISABLE = 010 /* Disable output--overrides all other bits. */
- };
-
void settings_init (void);
void settings_done (void);
bool get_errorbreak (void);
void set_errorbreak (bool);
+bool get_error_routing_to_terminal (void);
+void set_error_routing_to_terminal (bool);
+bool get_error_routing_to_listing (void);
+void set_error_routing_to_listing (bool);
+
bool get_scompression (void);
void set_scompression (bool);
+Sat Nov 4 11:48:23 2006 Ben Pfaff <blp@gnu.org>
+
+ * set.q: Update ERRORS, MESSAGES, RESULTS command syntax.
+ (cmd_set) Handle ERRORS command.
+ (show_errors) New function.
+ (var show_table[]) Add ERRORS to the table.
+
Tue Oct 31 20:10:24 2006 Ben Pfaff <blp@gnu.org>
* set.q (cmd_set): Drop the `ok' variable, which didn't do
endcmd=string "x==1" "one character long";
epoch=custom;
errorbreak=errbrk:on/off;
- errors=errors:on/off/terminal/listing/both/none;
+ errors=errors:terminal/listing/both/on/none/off;
format=custom;
headers=headers:no/yes/blank;
highres=hires:on/off;
lowres=lores:auto/on/off;
lpi=integer "x>0" "%s must be greater than 0";
menus=menus:standard/extended;
- messages=messages:on/off/terminal/listing/both/none;
+ messages=messages:on/off/terminal/listing/both/on/none/off;
mexpand=mexp:on/off;
miterate=integer "x>0" "%s must be greater than 0";
mnest=integer "x>0" "%s must be greater than 0";
nulline=null:on/off;
printback=prtbck:on/off;
prompt=string;
- results=res:on/off/terminal/listing/both/none;
+ results=res:on/off/terminal/listing/both/on/none/off;
safer=safe:on;
scompression=scompress:on/off;
scripttab=string "x==1" "one character long";
set_endcmd (cmd.s_endcmd[0]);
if (cmd.sbc_errorbreak)
set_errorbreak (cmd.errbrk == STC_ON);
+ if (cmd.sbc_errors)
+ {
+ bool both = cmd.errors == STC_BOTH || cmd.errors == STC_ON;
+ set_error_routing_to_terminal (cmd.errors == STC_TERMINAL || both);
+ set_error_routing_to_listing (cmd.errors == STC_LISTING || both);
+ }
if (cmd.sbc_include)
set_include (cmd.inc == STC_ON);
if (cmd.sbc_mxerrs)
msg (SN, _("ENDCMD is \"%c\"."), get_endcmd ());
}
+static void
+show_errors (const struct dataset *ds UNUSED)
+{
+ bool terminal = get_error_routing_to_terminal ();
+ bool listing = get_error_routing_to_listing ();
+ msg (SN, _("ERRORS is \"%s\"."),
+ terminal && listing ? "BOTH"
+ : terminal ? "TERMINAL"
+ : listing ? "LISTING"
+ : "NONE");
+}
+
static void
show_format (const struct dataset *ds UNUSED)
{
{"CCE", show_cce},
{"DECIMALS", show_decimals},
{"ENDCMD", show_endcmd},
+ {"ERRORS", show_errors},
{"FORMAT", show_format},
{"LENGTH", show_length},
{"MXERRS", show_mxerrs},