granular verbose message suppression mechanics

Switch to using a macro invocation Verbos(n, s) in place of the
flags.verbose checks.

Provide the mechanics for individual suppression of any of the
existing messages that were considered verbose.

Mechanics only - this code update does not provide any means of
setting the suppression bits.

iflags.verbose = 0
is still a master suppression of all the verbose messages.

iflags.verbose = 1
turns on the verbose messages only for those whose suppression
bit is 0 (not set).
This commit is contained in:
nhmall
2022-06-09 13:53:20 -04:00
parent fe235b7292
commit be76727265
41 changed files with 312 additions and 137 deletions

View File

@@ -4543,7 +4543,7 @@ handler_menustyle(void)
}
destroy_nhwindow(tmpwin);
chngd = (flags.menu_style != old_menu_style);
if (chngd || flags.verbose)
if (chngd || Verbose(2, handler_menustyle))
pline("'menustyle' %s \"%s\".", chngd ? "changed to" : "is still",
menutype[(int) flags.menu_style][0]);
return optn_ok;
@@ -4645,7 +4645,7 @@ handler_autounlock(int optidx)
}
destroy_nhwindow(tmpwin);
chngd = (flags.autounlock != oldflags);
if (chngd || flags.verbose) {
if (chngd || Verbose(2, handler_autounlock)) {
optfn_autounlock(optidx, get_val, FALSE, buf, (char *) NULL);
pline("'%s' %s '%s'.", optname,
chngd ? "changed to" : "is still", buf);
@@ -4818,7 +4818,7 @@ handler_msg_window(void)
}
destroy_nhwindow(tmpwin);
chngd = (iflags.prevmsg_window != old_prevmsg_window);
if (chngd || flags.verbose) {
if (chngd || Verbose(2, handler_msg_window)) {
(void) optfn_msg_window(opt_msg_window, get_val,
FALSE, buf, empty_optstr);
pline("'msg_window' %.20s \"%.20s\".",
@@ -5076,7 +5076,8 @@ handler_whatis_coord(void)
"", MENU_ITEMFLAGS_NONE);
Sprintf(buf, "map: upper-left: <%d,%d>, lower-right: <%d,%d>%s",
1, 0, COLNO - 1, ROWNO - 1,
flags.verbose ? "; column 0 unused, off left edge" : "");
Verbose(2, handler_whatis_coord1)
? "; column 0 unused, off left edge" : "");
add_menu(tmpwin, &nul_glyphinfo, &any, 0, 0,
ATR_NONE, buf, MENU_ITEMFLAGS_NONE);
if (strcmp(windowprocs.name, "tty")) /* only show for non-tty */
@@ -5084,7 +5085,7 @@ handler_whatis_coord(void)
"screen: row is offset to accommodate tty interface's use of top line",
MENU_ITEMFLAGS_NONE);
#if COLNO == 80
#define COL80ARG flags.verbose ? "; column 80 is not used" : ""
#define COL80ARG Verbose(2, handler_whatis_coord2) ? "; column 80 is not used" : ""
#else
#define COL80ARG ""
#endif