In the rare event that
make fetch-lua
is not working because the primary Lua site is not available,
provide another target
make fetch-lua-mirror
that uses the official lua mirror site documented at:
https://www.lua.org/mirrors.html
where calling term_start_color(NO_COLOR) would have the same
effect as calling term_end_color().
That change only included a change for termcap, but not any of
the NO_TERMS configurations. (NO_TERMS is defined for an
implementation where termcap is not used).
This attempts to make sys/msdos/video.c and sys/windows/consoletty.c
honor the change.
The msdos change has not yet been tested.
No attempt was made to alter the term_start_color() implementations
within the outdated tree.
Allow 'make USE_MANDOC=1 distrib' to be used for generating
the doc/*.txt files for systems that have mandoc and may not have groff.
(macOS Ventura doesn't include groff in the OS).
USE_MANDOC=1 is not restricted only to macOS.
Have hints/macOS.370 specify the /usr/share/man/man6 directory for the macOS
man pages, so that 'make manpages' will target the correct directory on
that platform.
add a 'distrib' target to the top level Makefile so that the
distribution doc/*.txt files can be created via 'make distrib'
from the top directory. It utilizes the existing 'distrib'
target in the doc/Makefile.
Have hints/linux.370 specify the correct directory for Linux
man pages of /usr/share/man/man6, so that 'sudo make manpages'
works on that platform,
Some changes to achieve the following MAN2TXT commands...
If groff version is 1.23 or greater:
nroff -man -Tascii -P -cbou
If groff version is less than 1.23:
nroff -man -Tascii -c | col -b
If non-groff nroff:
nroff -man | col -b
Closes#1153 again.
Following a commit for Issue #1153, g-branden-robinson commented:
> Mac OS X stayed on _groff_ 1.19.2 for over a decade (presumably due to
> _groff_ 1.20 adopting to GNU GPLv3), until finally dropping _groff_
> altogether for macOS Ventura (2022).
>
> There _has_ been an interface change in that time. The [`-P` option I
> advised about is new to _groff_ 1.23.0 (July 2023)]
> (https://git.savannah.gnu.org/cgit/groff.git/tree/NEWS?h=1.23.0#n86).
> [...]
>
> There is a significant number of _groff_ users via Homebrew (enough that
> we hear from them occasionally via bug reports). Some of these have
> upgraded to 1.23.0 via that mechanism.
> [...]
>
> `nroff -` is not necessary with any _nroff_ known to me; like many other
> Bell Labs Unix programs, it reads from the standard input stream by default
> if not given any operands.
Action taken:
1. Remove the unnecessary ' -' from the nroff command in Makefile.doc.
2. In the misc.370 file containing make snippets to include, test whether
groff >= 1.23, and only insert the -P option for 1.23 or greater.
rename hints/include/multiw-3.370 to hints/include/misc.370
keep the portable nroff options in sys/unix/Makefile.doc,
and relocate the non-portable bits to a variable defined
in sys/unix/hints/include/misc.370
This assumes that the groff options are compatible between
Linux and macOS implementations of groff.
If that turns out not to be the case, this bit:
ifneq "$(NROFFISGROFF)" "" # It's groff
# add the groff-specific plain text flags
MORE_MAN2TXT_FLAGS += -Tascii -P -cbou
endif
should relocate from sys/unix/hints/include/misc.370
to sys/unix/hints/linux.370 and sys/unix/hints/macOS.370,
immediately following the inclusion of misc.370, and the
appropriate platform-specific groff options can be
adjused in whichever of those appropriately needs it.
Closes#1153
Rebuild doc/*.txt (other than Guidebook) with 'nroff -man -c -Tascii'
rather than just 'nroff -man' to prevent it generating non-ASCII
characters for hyphen, aprostrophe, single and double quotes, long
dash, possibly others. Also preprocess with '--grep-define ALLDOCS'
so that a few parts of the text don't end up being specific to the
local configuration.
The next time they're rebuilt they'll probably be subject to the
ping-pong effect of inserting padding spaces for justification
(alternating right-to-left vs left-to-right as intended but starting
with different parity so lots of gratuitous changes) since my quite
old version of groff triggers that for Guidebook.txt.
linux.370 and macOS.370 pass the name of the hints file
and the list of included files, that they use, to Makefile.check.
The name of the hints file is in variable HINTSFILE, the
definition of which is now inserted by setup.sh
The list of hints include files is in variable HINTSINCLFILES.
../lib/pdcursesmod/dos/../common/dosutil.c:36:15: warning: comparison of integer expressions of different signedness: 'long int' and 'long unsigned int' [-Wsign-compare]
36 | while( ms > MAX_NAP_SPAN)
| ^
It isn't something that we can actually resolve within NetHack,
so just suppress the submodule build warning.
This commit will trigger the CI to carry out a test of the build.
There could be some follow-up after the results.
I realized that failed explore-mode authorization on a special-mode
saved game cannot downgrade the game mode further down to a normal game,
because this would dump the player back into a state where she has
completed some part of the game in explore mode but is eligible for the
topten list. This is even more true when the game was formerly a
wizard-mode game. Unforunately, that was the state my previous commits
left the game in.
Instead, if restoring an explore-mode or wizard-mode savegame, and the
player is authorized via sysconf for neither of those modes, fail
restoration entirely and start a new game instead. That's sort of
clunky and there could probably be more explanation provided, but it
should be an exceedingly rare occurance and I'm not sure what
alternative exists that would still honor the EXPLORERS and WIZARDS
restrictions. This shouldn't affect the way they default 'down a mode'
in other circumstances, i.e. the overwhelming majority of situations in
which EXPLORERS authorization is needed/checked.
For the same reason, I realized that the player can't be prompted
whether or not to enter explore mode, if being downgraded from a
no-longer-authorized wizmode save while explore mode is authorized. The
change from wizard mode to explore mode must be mandatory. I have also
switched that up so that it will force the change -- unfortunately, this
has the side effect of allowing the preservation of the save, but it's
more important to make sure a wizard mode game doesn't get reverted to
normal mode. They won't be able to load the save into wizard mode
anyway.
If an unauthorized player requests the game launch in wizard mode, it
will try to put her in explore mode instead. If this happened during
restoration of a previous (normal) saved game, the setting of discover
in wd_message() would bypass iflags.deferred_X, allowing the player to
select to keep the non-explore-mode save file. [Actually, when I tested
it I always got an error when answering yes to the "keep the save file?"
prompt, but that's a problem too...] Because deferred_X was still 1
after this, the pline "You are already in explore mode" would also be
printed following the prompt (when moveloop_preamble() attempted to set
explore mode).
Fix this so that loading a normal game with -D, then failing the
authorization, boots into explore mode via iflags.deferred_X and the
"really enter explore mode?" prompt, as it would have if -X were
specified on the command line to begin with.
The sysconf EXPLORERS list restricting access to explore mode was being
evaluated and used when a player used the #exploremode command in-game,
or when specifying -X or OPTIONS=playmode:explore on the command line
when resuming a normal game, but not when starting an entirely new game.
When SYSCF is avilable, check for authorization early, similar to debug
mode authorization, to restrict access to explore mode to EXPLORERS
under (hopefully) all circumstances.
Now that CHECK_PLNAME is a sysconf option, it can be possible to
authorize wizard mode even if get_unix_pw() fails to return the user's
login name, so I think the call to check_user_string() should go out
either way in case that's what's happening.
doc/Gbk-1pg-sfx.mn is already using one half of a sound technique: set
the page length to a very large value, guaranteed to overshoot the
vertical space required by the document's text. The other half is to,
at the end of the document, set the page length to the current vertical
position, so that it ends immediately.
https://www.gnu.org/software/groff/manual/groff.html.node/Manipulating-Spacing.html
String definitions were being used with a pointless leading double
quote. This syntax is used only to define strings containing leading
space characters. (You might also use it defensively if you're defining
one string whose contents start with the interpolation of another, and
the latter might interpolate leading space--but that is not the case
here.)
Remove unnecessary leading quotes from string definitions.
* doc/Guidebook.mn: Do it. Also annotate empty strings with comment.
* sys/unix/hints/include/gbdates-post.370: Don't put them back.
https://www.gnu.org/software/groff/manual/groff.html.node/Strings.html
'nethack --show' is rejected, which is ok, but the feedback is
'prscore: bad arguments (2)' which is pretty confusing.
Reject any --s unless it's the start of --scores or --showpath[s].
'nethack --show' will be rejected as "Unknown option: --show."
'nethack -show' is still accepted and will report that it can't find
any scores for how as it always has (assuming that there aren't any
score entries for "how" :-).