From: PatR Date: Thu, 17 Dec 2020 03:22:04 +0000 (-0800) Subject: adopt some orphan commands X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d27b8cb04351aa1b7391b54b2cd3c679e9e8598f;p=nethack adopt some orphan commands '? i' shows three keyless commands in the General section. This makes M-X the key for #exploremode. #herecmdmenu and #therecmdmenu are still keyless but now autocomplete. A ridiculous amount of documentation for a three line code change. --- diff --git a/dat/cmdhelp b/dat/cmdhelp index d993c313c..134866d01 100644 --- a/dat/cmdhelp +++ b/dat/cmdhelp @@ -223,3 +223,4 @@ M-T Tip: empty a container M-u Untrap something (trap, door, or chest) M-v Print compile time options for this version of NetHack M-w Wipe off your face +M-X Switch from normal play to explore mode diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index dff313965..4fab00cd7 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -1,4 +1,4 @@ -.\" $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.407 $ $NHDT-Date: 1607936398 2020/12/14 08:59:58 $ +.\" $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.408 $ $NHDT-Date: 1608175317 2020/12/17 03:21:57 $ .\" .\" This is an excerpt from the 'roff' man page from the 'groff' package. .\" Guidebook.mn currently does *not* fully adhere to these guidelines. @@ -35,7 +35,7 @@ .ds vr "NetHack 3.7 .ds f0 "\*(vr .ds f1 -.ds f2 "December 13, 2020 +.ds f2 "December 16, 2020 . .\" A note on some special characters: .\" \(lq = left double quote @@ -969,9 +969,9 @@ the exchange still takes place. Toggle two-weapon combat, if your character can do it. Also available via the \(lq#twoweapon\(rq extended command. .lp "" -(In versions prior to 3.6 this was the command to switch from normal +(In versions prior to 3.6 this keystroke ran the command to switch from normal play to \(lqexplore mode\(rq, also known as \(lqdiscovery mode\(rq, -which has now been moved to \(lq#exploremode\(rq.) +which has now been moved to \(lq#exploremode\(rq and M-X.) .lp \(haX Display basic information about your character. .lp "" @@ -1199,7 +1199,8 @@ Advance or check weapon and spell skills. Autocompletes. Default key is \(oqM-e\(cq. .lp #exploremode -Enter the explore mode. +Switch from normal play to non-scoring explore mode. +Default key is \(oqM-X\(cq. .lp "" Requires confirmation; default response is \f(CRn\fP (no). To really switch to explore mode, respond with \f(CRy\fP. @@ -1222,7 +1223,15 @@ Default key is \(oq?\(cq, and also \(oqh\(cq if .op number_pad is on. .lp #herecmdmenu -Show a menu of possible actions in your current location. +Show a menu of possible actions directed at your current location. +The menu is limited to a subset of the likeliest actions, not an +exhaustive set of all possibilities. +Autocompletes. +.lp "" +If mouse support is enabled and the +.op herecmd_menu +option is On, clicking on the hero (or steed when mounted) will +execute this command. .lp "#history " Show long version and game history. Default key is \(oqV\(cq. @@ -1473,7 +1482,15 @@ In debug mode there are additional choices. Autocompletes. Default key is \(oq\(cq or \(oq\(cq (see \fIDel\fP above). .lp #therecmdmenu -Show a menu of possible actions in a location next to you. +Show a menu of possible actions directed at a location next to you. +The menu is limited to a subset of the likeliest actions, not an +exhaustive set of all possibilities. +Autocompletes. +.\"--invoking it by mouse seems to be broken +.\" .lp "" +.\" If mouse support is enabled and the +.\" .op herecmd_menu +.\" option is On, clicking on an adjacent location will execute this command. .lp "#throw " Throw something. Default key is \(oqt\(cq. @@ -1642,16 +1659,27 @@ with another key, modifies it by setting the \(lqmeta\(rq [8th, or \(lqhigh\(rq] bit), you can invoke many extended commands by meta-ing the first letter of the command. .pg -In \fIWindows\fP, \fIOS/2\fP, \fIPC\fP and \fIST\fP \fINetHack\fP, -the \(lqAlt\(rq key can be used in this fashion; -on the \fIAmiga\fP, set the -.op altmeta -option to get this behavior. +On \fIWindows\fP and \fIMS-DOS\fP, +the \(lqAlt\(rq key can be used in this fashion. +.\" On the \fIAmiga\fP, set the +.\" .op altmeta +.\" option to get this behavior. On other systems, if typing \(lqAlt\(rq plus another key transmits a two character sequence consisting of an \fBEscape\fP followed by the other key, you may set the .op altmeta option to have NetHack combine them into meta+key. +(This combining action only takes place when NetHack is expecting a +command to execute, not when accepting input to name something or to +make a wish.) +.pg +Unlike control characters, where \(hax and \(haX denote the same thing, +meta characters are case-sensitive: M-x and M-X represent different things. +Some commands which can be run via a meta character require that the +letter be capitalized because the lower-case equivalent is used for +another command, so the three key combination meta+shift+letter is needed. +.BR 1 +. .lp M-? #? (not supported by all platforms) .lp M-2 @@ -1706,6 +1734,8 @@ option is enabled) #version .lp M-w #wipe +.lp M-X +#exploremode .lp "" .pg If the diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index c5b89b555..a3dd3fecc 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -45,7 +45,7 @@ %.au \author{Original version - Eric S. Raymond\\ (Edited and expanded for 3.7 by Mike Stephenson and others)} -\date{December 13, 2020} +\date{December 16, 2020} \maketitle @@ -1059,9 +1059,9 @@ the exchange still takes place. Toggle two-weapon combat, if your character can do it. Also available via the ``{\tt \#twoweapon}'' extended command.\\ %.lp "" -(In versions prior to 3.6 this was the command to switch from normal +(In versions prior to 3.6 this keystroke ran the command to switch from normal play to ``explore mode'', also known as ``discovery mode'', which has now -been moved to ``{\tt \#exploremode}''.) +been moved to ``{\tt \#exploremode}'' and M-X.) %.lp \item[\tb{\^{}X}] Display basic information about your character.\\ @@ -1282,7 +1282,8 @@ Advance or check weapon and spell skills. Autocompletes. Default key is `{\tt M-e}'. %.lp \item[\tb{\#exploremode}] -Enter the explore mode.\\ +Switch from normal play to non-scoring explore mode. +Default key is `{\tt M-X}'.\\ %.lp "" Requires confirmation; default response is `{\tt n}' (no). To really switch to explore mode, respond with `{\tt y}'. @@ -1305,7 +1306,14 @@ Default key is `{\tt ?}', and also `{\tt h}' if {\it number\verb+_+pad\/} is on. %.lp \item[\tb{\#herecmdmenu}] -Show a menu of possible actions in your current location. +Show a menu of possible actions directed at your current location. +The menu is limited to a subset of the likeliest actions, not an +exhaustive set of all possibilities. +Autocompletes.\\ +%.lp "" +If mouse support is enabled and the {\it herecmd\verb+_+menu\/} +option is On, clicking on the hero (or steed when mounted) will +execute this command. %.lp \item[\tb{\#history}] Show long version and game history. Default key is `{\tt V}'. @@ -1565,7 +1573,15 @@ Autocompletes. Default key is `' or `' (see {\it Del\/} above). %.lp \item[\tb{\#therecmdmenu}] -Show a menu of possible actions in a location next to you. +Show a menu of possible actions directed at a location next to you. +The menu is limited to a subset of the likeliest actions, not an +exhaustive set of all possibilities. +Autocompletes. +%%--invoking it by mouse seems to be broken +%% \\ +%% .lp "" +%% If mouse support is enabled and the {\it herecmd\verb+_+menu\/} +%% option is On, clicking on an adjacent location will execute this command. %.lp \item[\tb{\#throw}] Throw something. Default key is `{\tt t}'. @@ -1750,13 +1766,26 @@ Help menu: get the list of available extended commands. with another key, modifies it by setting the `meta' [8th, or `high'] bit), you can invoke many extended commands by meta-ing the first letter of the command. -In {\it Windows, OS/2, PC\/ {\rm and} ST NetHack}, -the `Alt' key can be used in this fashion; -on the {\it Amiga}, set the {\it altmeta\/} option to get this behavior. + +On {\it Windows\/} and {\it MS-DOS\/}, +the `Alt' key can be used in this fashion. +%% On the {\it Amiga}, set the {\it altmeta\/} option to get this behavior. On other systems, if typing `Alt' plus another key transmits a two character sequence consisting of an {\tt Escape} followed by the other key, you may set the {\it altmeta\/} option to have {\it NetHack\/} combine them into meta\+key. +(This combining action only takes place when NetHack is expecting a +command to execute, not when accepting input to name something or to +make a wish.) + +%.pg +Unlike control characters, where ^{}x and ^{}X denote the same thing, +meta characters are case-sensitive: M-x and M-X represent different things. +Some commands which can be run via a meta character require that the +letter be capitalized because the lower-case equivalent is used for +another command, so the three key combination meta+shift+letter is needed. + +%.BR 1 \blist{} %.lp \item[\tb{M-?}] @@ -1836,6 +1865,9 @@ option to have {\it NetHack\/} combine them into meta\+key. %.lp \item[\tb{M-w}] {\tt\#wipe} +%.lp +\item[\tb{M-X}] +{\tt\#exploremode} \elist %.pg diff --git a/doc/fixes37.0 b/doc/fixes37.0 index cfcd3f76c..696c3e1af 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -1,4 +1,4 @@ -NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.392 $ $NHDT-Date: 1607936398 2020/12/14 08:59:58 $ +NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.393 $ $NHDT-Date: 1608175317 2020/12/17 03:21:57 $ General Fixes and Modified Features ----------------------------------- @@ -671,6 +671,8 @@ when "?i" (show key bindings) displays commands and their keys, also show commands without any key (so useable via '#', or possibly menu, only; the majority are debugging commands) assign default key binding for or to execute #terrain +assign M-X to #exploremode +make #herecmdmenu and #therecmdmenu autocomplete Platform- and/or Interface-Specific New Features diff --git a/src/cmd.c b/src/cmd.c index 275c71e46..7e98f675d 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 cmd.c $NHDT-Date: 1608116853 2020/12/16 11:07:33 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.435 $ */ +/* NetHack 3.7 cmd.c $NHDT-Date: 1608175318 2020/12/17 03:21:58 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.436 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2013. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1817,7 +1817,7 @@ struct ext_func_tab extcmdlist[] = { { 'E', "engrave", "engrave writing on the floor", doengrave }, { M('e'), "enhance", "advance or check weapon and spell skills", enhance_weapon_skill, IFBURIED | AUTOCOMPLETE }, - { '\0', "exploremode", "enter explore (discovery) mode", + { M('X'), "exploremode", "enter explore (discovery) mode", enter_explore_mode, IFBURIED | GENERALCMD }, { 'f', "fire", "fire ammunition from quiver", dofire }, { M('f'), "force", "force a lock", doforce, AUTOCOMPLETE }, @@ -1825,7 +1825,7 @@ struct ext_func_tab extcmdlist[] = { doquickwhatis, IFBURIED | GENERALCMD }, { '?', "help", "give a help message", dohelp, IFBURIED | GENERALCMD }, { '\0', "herecmdmenu", "show menu of commands you can do here", - doherecmdmenu, IFBURIED | GENERALCMD }, + doherecmdmenu, IFBURIED | AUTOCOMPLETE | GENERALCMD }, { 'V', "history", "show long version and game history", dohistory, IFBURIED | GENERALCMD }, { 'i', "inventory", "show your inventory", ddoinv, IFBURIED }, @@ -1929,7 +1929,7 @@ struct ext_func_tab extcmdlist[] = { doterrain, IFBURIED | AUTOCOMPLETE }, { '\0', "therecmdmenu", "menu of commands you can do from here to adjacent spot", - dotherecmdmenu, GENERALCMD }, + dotherecmdmenu, AUTOCOMPLETE | GENERALCMD }, { 't', "throw", "throw something", dothrow }, { '\0', "timeout", "look at timeout queue and hero's timed intrinsics", wiz_timeout_queue, IFBURIED | AUTOCOMPLETE | WIZMODECMD },