-/* NetHack 3.7 cmd.c $NHDT-Date: 1655114986 2022/06/13 10:09:46 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.572 $ */
+/* NetHack 3.7 cmd.c $NHDT-Date: 1655120485 2022/06/13 11:41:25 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.573 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
doremring, 0, NULL },
{ C('a'), "repeat", "repeat a previous command",
do_repeat, IFBURIED | GENERALCMD, NULL },
+ /* "modify command" is a vague description for use as no-autopickup,
+ no-attack movement as well as miscellaneous non-movement things;
+ key2extcmddesc() constructs a more explicit two line description
+ for display by the '&' command and expects to find "prefix:" as
+ the start of the text here */
{ 'm', "reqmenu", "prefix: request menu or modify command",
do_reqmenu, PREFIXCMD, NULL },
{ C('_'), "retravel", "travel to previously selected travel location",
/* finally, check whether 'key' is a command */
if (g.Cmd.commands[key] && (txt = g.Cmd.commands[key]->ef_txt) != 0) {
Sprintf(key2cmdbuf, "%s (#%s)", g.Cmd.commands[key]->ef_desc, txt);
- /* special case: 'txt' for '#' is "#" and showing that as
+
+ /* special case: for reqmenu prefix (normally 'm'), replace
+ "prefix: request menu or modify command (#reqmenu)"
+ with two-line "movement prefix:...\nnon-movement prefix:..." */
+ if (!strncmpi(key2cmdbuf, "prefix:", 7) && !strcmpi(txt, "reqmenu"))
+ (void) strsubst(key2cmdbuf, "prefix:",
+ /* relies on implicit concatenation of literal strings */
+ "movement prefix:"
+ " move without autopickup and without attacking"
+ "\n"
+ "non-movement prefix:"); /* and rest of buf */
+
+ /* another special case: 'txt' for '#' is "#" and showing that as
"perform an extended command (##)" looks silly; strip "(##)" off */
return strsubst(key2cmdbuf, " (##)", "");
}
-/* NetHack 3.7 pager.c $NHDT-Date: 1642630920 2022/01/19 22:22:00 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.210 $ */
+/* NetHack 3.7 pager.c $NHDT-Date: 1655120486 2022/06/13 11:41:26 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.225 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2018. */
/* NetHack may be freely redistributed. See license for details. */
#endif
reslt = dowhatdoes_core(q, bufr);
if (reslt) {
+ char *p = index(reslt, '\n'); /* 'm' prefix has two lines of output */
+
if (q == '&' || q == '?')
whatdoes_help();
+ if (p)
+ *p = '\0';
pline("%s", reslt);
+ if (p)
+ /* cheat by knowing how dowhatdoes_core() handles key portion */
+ pline("%8.8s%s", reslt, p + 1);
} else {
pline("No such command '%s', char code %d (0%03o or 0x%02x).",
visctrl(q), (uchar) q, (uchar) q, (uchar) q);