Commit Graph
19282 Commits
Author SHA1 Message Date
G. Branden Robinson 2c9bda8660 doc/nethack.6: Respell playername option argument
Spell it as a hyphenated noun phrase.  Use an ellipsis instead of
pluralization to mark its repeatability.  Slightly recast its
description.
2026-05-06 04:53:12 -05:00
G. Branden Robinson 4a76d66ad9 doc/nethack.6: Be more portable to old roffs (4/4)
Define strings for directional single quotation marks.

groff_man_style(7):

Notes
     Some tips on composing and troubleshooting your man pages follow.
...
     • When and how should I use quotation marks?
...
       Obtaining directional single quotation marks is more of a
       challenge.  Historically, man pages used ` and ', which troff
       rendered on typesetters as ‘ and ’, exclusively for them.
       However, in recent years, some distributors of groff have chosen
       to override the meanings of these characters in man pages,
       remapping them to their Unicode Basic Latin code points.
       Unfortunately, ` and ' are the only reliable means of obtaining
       directional single quotation marks in AT&T troff; in that
       implementation, often no special character escape sequences exist
       to obtain them.  Further, AT&T troff’s special character
       identifiers, like its font names, were device‐specific.  To
       achieve quotation portably in man pages rendered both by AT&T and
       more modern troffs, consider adding a preamble to your page after
       the TH call as follows.

              .ie \n(.g \{\
              .  ds oq \[oq]\"
              .  ds cq \[cq]\"
              .\}
              .el \{\
              .  ds oq `\"
              .  ds cq '\"
              .\}

       You must then use the \* escape sequence to interpolate the
       quotation mark strings.

              The command
              .RB \*(oq "while !\& git pull; do sleep 10; done" \*(cq
              retries an update from the repository until it succeeds.

       If this procedure seems complex, petition your distributor to
       revert their remapping of the ` and ' characters.
2026-05-06 04:53:12 -05:00
G. Branden Robinson 1922fb687d doc/nethack.6: Be more portable to old roffs (3/4)
Unbreakable spaces in AT&T troff were always non-adjustable.

Define a string to use groff's `\~` extension if possible.

groff_man_style(7):
   Portability
...
     \~        Adjustable non‐breaking space.  Use this escape sequence
               to prevent a break inside a short phrase or between a
               numerical quantity and its corresponding unit(s).

                      Before starting the motor,
                      set the output speed to\~1.
                      There are 1,024\~bytes in 1\~KiB.
                      CSTR\~#8 documents the B\~language.

               \~ is a GNU extension also supported by Heirloom Doctools
               troff 050915 (September 2005), mandoc 1.9.14
               (2009‐11‐16), neatroff (commit 1c6ab0f6e, 2016‐09‐13),
               and Plan 9 from User Space troff (commit 93f8143600,
               2022‐08‐12), but not by DWB or Solaris troffs.

Fixes bad rendering in DWB 3.3 troff:

@@ -999 +999 @@
-            file.   -s|-s~-v  may  also  be  followed  by  arguments  -p
+            file.   -s|-s -v  may  also  be  followed  by  arguments  -p
@@ -1005 +1005 @@
-            entries  which  match both.  -s|-s~-v may be followed by one
+            entries  which  match both.  -s|-s -v may be followed by one

Solaris 10 troff _would_ misrender as well, but a different portability
problem keeps some of the foregoing text from rendering at all.
2026-05-06 04:53:12 -05:00
G. Branden Robinson afeec3dd65 doc/nethack.6: Be more portable to old roffs (2/4)
Old *roffs don't support the `ti` special character.  Compensate.

Before (DWB, Solaris 10):
            The --nethackrc:RC-file option will use RC-file  instead  of
            the   default   run-time   configuration   file   (typically
            /.nethackrc) and the --no-nethackrc option can  be  used  to
            skip any run-time configuration file.

Before (Plan 9):
          The --nethackrc:RC-file option will use RC-file  instead  of
          the   default   run-time   configuration   file   (typically
          ti/.nethackrc) and the --no-nethackrc option can be  used  to
          skip any run-time configuration file.

After (all):
            The --nethackrc:RC-file option will use RC-file  instead  of
            the   default   run-time   configuration   file   (typically
            ~/.nethackrc) and the --no-nethackrc option can be  used  to
            skip any run-time configuration file.
2026-05-06 04:53:12 -05:00
G. Branden Robinson 14430511bd doc/nethack.6: Be more portable to old roffs (1/4)
Favor the very old `lq` and `rq` extension _strings_ over special
characters of the same name.  This fixes missing punctuation and text
when rendering this document with DWB and Solaris 10 nroffs, and
misrendered text with Plan 9 nroff.

Before (DWB, Solaris 10):
            discovery  mode (also known as explore mode).  -D will start
            the game in debug mode (also known  as  wizard  mode)  after
            changing  the  character  name  to  wizard, if the player is
            allowed.  Otherwise it will switch to -X.  Control of who is
            allowed to use debug mode is done via the

Before (Plan 9):
          discovery  mode (also known as explore mode).  -D will start
          the game in debug mode (also known  as  wizard  mode)  after
          changing  the  character  name to lqwizardrq, if the player is
          allowed.  Otherwise it will switch to -X.  Control of who is
          allowed to use debug mode is done via the lqWIZARDS=rq line in
          NetHack's sysconf file.

After (all):
            The -X option will start the game in a  special  non-scoring
            discovery  mode (also known as explore mode).  -D will start
            the game in debug mode (also known  as  wizard  mode)  after
            changing  the  character  name to "wizard", if the player is
            allowed.  Otherwise it will switch to -X.  Control of who is
            allowed to use debug mode is done via the "WIZARDS=" line in
            NetHack's sysconf file.

(There are minor differences in the page offset amount, and Plan 9 uses
UTF-8 double quotation marks, U+201C and U+201D.)

groff_man(7):
   Strings
     The following strings are defined for use in man pages.  None of
     these is necessary in a contemporary man page; see
     groff_man_style(7). ...
...
     \*(lq
     \*(rq   interpolate special character escape sequences for left and
             right double‐quotation marks, \(lq and \(rq, respectively.

(I see that I should reword the foregoing to something like "None is
necessary in man pages targeting only contemporary *roff formatters".)

   History

     ... 4BSD (1980) added lq and rq strings.  ... Unix System V (1988)
     incorporated the lq and rq strings.

     Except for EX/EE, James Clark implemented the foregoing features in
     early versions of groff.  ... Plan 9 from User Space’s troff ...
     incorporated the lq and rq strings in 2025.

groff_man_style(7):

Notes
     Some tips on composing and troubleshooting your man pages follow.
...
     • When and how should I use quotation marks?

       As noted above in subsection “Font style macros”, apply quotation
       marks to “brief specimens of literal text, such as article
       titles, inline examples, mentions of individual characters or
       short strings, and (sub)section headings in man pages”.  Multi‐
       word literals, such as Unix commands with arguments, when set
       inline (as opposed to displayed between EX and EE), should be
       quoted to ensure that the boundaries of the literal are clear
       even when the material is stripped of font styling by, for
       example, copy‐and‐paste operations.  groff, Heirloom Doctools
       troff, neatroff, and mandoc support all of the special characters
       \[oq], \[cq], \[lq], \[rq], \[aq], and \[dq] described in
       subsection “Portability” above.  DWB, Plan 9, and Solaris troffs
       do not.  Interpolating the strings \*(lq and \*(rq portably
       yields directional double quotation marks, if available, in all
       these formatters (though neatroff does not supply a man macro
       package), but they cannot reliably be used in macro arguments.

Per the final sentence above, do a little dance to avoid using these
strings in macro arguments.
2026-05-06 04:53:12 -05:00
G. Branden Robinson fb611b60bc doc/nethack.6: Spell "NetHack" thus
...when not referring specifically to the command's file name.
2026-05-06 04:53:12 -05:00
G. Branden Robinson 103d5f27e7 doc/makedefs.6: Drop redundant br requests
Paragraphing macros in *roff systems generally break the output line,
and the same is true of all of man(7)'s paragraphing macros.

groff_man(7):
   Paragraphing macros
     These macros break the output line.  An ordinary paragraph (P)
     indents all output lines by the same amount.  A hanging paragraph
     (HP) is a cosmetic variant of P with a hanging indent.  Definition
     lists frequently occur in man pages; these can be set as tagged
     paragraphs, which have one (TP) or more (TQ) leading tags followed
     by a paragraph that has an additional indentation.
2026-05-06 04:53:08 -05:00
G. Branden Robinson 67e724cd75 doc/*.[67]: Set man page xrefs consistently
NetHack's man pages already preponderantly use man(7) `IR` macro for
this purpose.  Align outliers.

The "SEE ALSO" section of doc/mn.7 is a partial exception.  While the
rest of the document sets cross-referenced man page topics in italics,
this section of the page does not.  It seems likely that this decision
was made in deliberate imitation of Seventh Edition Unix manuals (1979)
or their descendants in USG/USL and BSD Unices.  That feature of the
Unix man pages, however, was not deliberate per Doug McIlroy, the author
of the man(7) macros and editor of Volume 1 of the Seventh Edition Unix
Programmer's Manual, per his communication on the groff mailing list.

But NetHack has a policy of not modifying Matt Bishop's "mn" macro
file or its man page, so I leave that exception in place.

References:

https://lists.gnu.org/archive/html/groff/2021-08/msg00023.html
https://lists.gnu.org/archive/html/groff/2021-08/msg00040.html
https://github.com/NetHack/NetHack/pull/977#issuecomment-1424996578
2026-05-06 04:39:57 -05:00
G. Branden Robinson bbcfc474d0 doc/*.[67]: Drop redundant calls and requests
Sectioning and paragraphing macros always break the output line.

(Sub)sectioning macros always set text after the heading as a paragraph.

Fixes:

$ mandoc -T lint doc/*.[67] # output edited
doc/makedefs.6:49:2: WARNING: skipping paragraph macro: PP after SH
doc/nethack.6:367:2: WARNING: skipping paragraph macro: br after PP
doc/nethack.6:365:2: WARNING: skipping paragraph macro: PP empty
doc/nethack.6:157:2: WARNING: skipping paragraph macro: PP after SH
doc/nethack.6:431:2: WARNING: skipping paragraph macro: PP after SH
doc/nethack.6:673:2: WARNING: skipping paragraph macro: PP after SH
doc/nethack.6:676:2: WARNING: skipping paragraph macro: PP after SH
doc/recover.6:29:2: WARNING: skipping paragraph macro: PP after SH
doc/recover.6:125:2: WARNING: skipping paragraph macro: PP after SH
doc/recover.6:141:2: WARNING: skipping paragraph macro: PP after SH
doc/mnh.7:23:2: WARNING: skipping paragraph macro: PP after SH
doc/mnh.7:46:2: WARNING: skipping paragraph macro: PP after SH
2026-05-06 04:39:57 -05:00
G. Branden Robinson d2a49d4f8a doc/nethack.6: Revise "ENVIRONMENT" section
Explain meaning of stacked paragraph tags naming environment variables.

Drop call of deprecated man(7) `DT` macro and invocation of `ta` request
to set tab stops to attempt table-like layout.  (The latter made the
former nilpotent anyway.)  Replace this material with calls of tagged
paragraphing macro `TP` and groff man(7)'s `TQ` extension for setting
multiple tags with a paragraph.  The result takes up more screen lines,
but renders well with more formatters.

Set indentation of tagged paragraph using a constant numeric expression
to accommodate pseudo-roff formatters that don't implement arithmetic
evaluation.  (Some of these ignore _any_ indentation, regardless.)

Slightly recast descriptions of environment variables.

Set file name literals in italics.

Protect file and environment variable names from hyphenation.

Fixes:

an.tmac:doc/nethack.6:608: style: use of deprecated macro: .DT
2026-05-06 04:39:57 -05:00
G. Branden Robinson 6c9e8cb1c9 doc/nethack.6: Revise "FILES" section
* Define string to exercise groff's hyphenless break point feature.
  This helps with file names and URLs.  On formatters that don't claim
  compatibility with groff, define the string as nothing, getting the
  same result as before (a _highly_ ragged right margin, jarring
  adjustment, or overset lines).

* If the formatter does not claim compatibility with groff, define a
  copy of groff man(7)'s `TQ` macro to ease stacking of paragraph tags.

* Set file name literals in italics.  Stop quoting them (which was
  inconsistently done anyway).

* Revise "FILES" section.
  - Drop redundant `PP` paragraphing call.

    $ mandoc -T lint doc/nethack.6
    ...
    mandoc: doc/nethack.6:432:2: WARNING: skipping paragraph macro: PP after SH
    ...

    groff_man(7):

     .SH [heading‐text]
            Set heading‐text as a section heading. ...  Text lines after
            the call are set as an ordinary paragraph (P).

  - Drop call of deprecated man(7) `DT` macro and invocation of `ta`
    request to set tab stops to attempt table-like layout.  (The latter
    made the former nilpotent anyway.)  Replace this material with calls
    of tagged paragraphing macro `TP` and groff man(7)'s `TQ` extension
    for setting multiple tags with a paragraph.  The result takes up
    more screen lines, but renders well with more formatters.

  - Fine-tune styling of file names.

    groff_man_style(7):
            Use italics for file and path names, ... for variant
            (user‐replaceable) portions of syntax synopses, ... and
            anywhere a parameter requiring replacement by the user is
            encountered.  An exception involves variant text in a
            context already typeset in italics, such as file or path
            names with replaceable components; in such cases, follow the
            convention of mathematical typography: set the file or path
            name in italics as usual but use roman for the variant part
            (see IR and RI below), and italics again in running roman
            text when referring to the variant material.

Solaris 10, DWB 3.3, and Plan 9 from User Space nroffs formatted the
table of file names and descriptions quite badly.

Before:
            nethack                     The program itself.
            Guidebook | Guidebook.txt   NetHack's user manual.
            data, oracles, rumors       Data files used by NetHack.
            bogusmon                    Another data file.
            engrave, epitaph, tribute   Still more data files.
            symbols                     Data file holding sets of speci-
            fications
                                        for  how  to  display  monsters,
            objects, and
                                        map features.
            options                     Data file containing a  descrip-
            tion of the
                                        build-time option settings.
            help, hh, cmdhelp           Help data files.  ('cmdhelp'  is
            obsolete.)
...

Now (pagination on AT&T nroffs is omitted):
            nethack
                 The program itself.

            Guidebook
            Guidebook.txt
                 NetHack's user manual.

            data
            oracles
            rumors
                 Data files used by NetHack.

            bogusmon
                 Another data file.

            engrave
            epitaph
            tribute
                 Still more data files.

            symbols
                 Data file holding sets of  specifications  for  how  to
                 display monsters, objects, and map features.

            options
                 Data file containing a description  of  the  build-time
                 option settings.

            help
            hh
            cmdhelp
                 Help data files.  (cmdhelp is obsolete.)

Fixes:

an.tmac:doc/nethack.6:444: style: use of deprecated macro: .DT
2026-05-06 04:39:57 -05:00
G. Branden Robinson a562b80019 doc/makedefs.6: Fix style nits
* End sentence with period, like others in this document.
* Set literal file name in italics like all others in this document, not
  bold.
2026-05-06 04:39:57 -05:00
G. Branden Robinson 0c915adea1 doc/makedefs.6: Break text line at end of sentence
Ensure that *roff programs detect the sentence ending here.

https://www.gnu.org/software/groff/manual/groff.html.node/Sentences.html
2026-05-06 04:39:57 -05:00
G. Branden Robinson 32c1b24f32 doc/makedefs.6: Make punct styling consistent
Elsewhere in this document, punctuation after italicized words is set in
roman, not italics.
2026-05-06 04:39:57 -05:00
G. Branden Robinson 82c174a847 doc/makedefs.6: Fix warning from DWB 3.3 nroff
Not a serious issue in my opinion, but worth fixing.  DWB does not
misrender the document, and the "stack" referred to is not the runtime
stack employed by the operating system, but one in the *roff language
runtime.

The diagnostic appears to be spurious in this case, but it isn't always.

https://github.com/n-t-roff/DWB3.3/issues/10
2026-05-06 04:39:57 -05:00
G. Branden Robinson fc0fd459b1 doc/nethack.6: Drop spurious request arguments
No *roff known to me interprets arguments to the `br` request.  They
don't complain, either, but some day that may change.

https://savannah.gnu.org/bugs/?61450
2026-05-06 04:39:57 -05:00
G. Branden Robinson 9508a133d0 doc/*.6: Fix unescaped hyphens
groff_man_style(7):
     •  Option dashes are specified with the \- escape sequence; this is
        an important practice to make them clearly visible and to
        facilitate copy‐and‐paste from the rendered man page to a shell
        prompt or text file.
...
     \-     Minus sign.  \- produces the basic Latin hyphen‐minus
            (U+002D) specifying Unix command‐line options and frequently
            used in file names.  “-” is a hyphen in roff; some output
            devices format it as U+2010 (hyphen).
2026-05-06 04:39:57 -05:00
G. Branden Robinson 2566ddefdf doc/*.6: Break input lines at sentence endings
...pacifying a warning from the forthcoming groff 1.25.

Fixes:

troff:doc/dlb.6:159: warning: end of sentence detected before end of text line [-w style]
troff:doc/makedefs.6:53: warning: end of sentence detected before end of text line [-w style]
troff:doc/makedefs.6:55: warning: end of sentence detected before end of text line [-w style]
troff:doc/makedefs.6:58: warning: end of sentence detected before end of text line [-w style]
troff:doc/makedefs.6:153: warning: end of sentence detected before end of text line [-w style]
troff:doc/makedefs.6:159: warning: end of sentence detected before end of text line [-w style]
troff:doc/makedefs.6:166: warning: end of sentence detected before end of text line [-w style]
troff:doc/makedefs.6:222: warning: end of sentence detected before end of text line [-w style]
troff:doc/makedefs.6:245: warning: end of sentence detected before end of text line [-w style]
troff:doc/makedefs.6:279: warning: end of sentence detected before end of text line [-w style]
troff:doc/mnh.7:30: warning: end of sentence detected before end of text line [-w style]
troff:doc/nethack.6:225: warning: end of sentence detected before end of text line [-w style]
troff:doc/nethack.6:226: warning: end of sentence detected before end of text line [-w style]
troff:doc/nethack.6:230: warning: end of sentence detected before end of text line [-w style]
troff:doc/nethack.6:234: warning: end of sentence detected before end of text line [-w style]
troff:doc/nethack.6:236: warning: end of sentence detected before end of text line [-w style]
troff:doc/nethack.6:524: warning: end of sentence detected before end of text line [-w style]
troff:doc/nethack.6:577: warning: end of sentence detected before end of text line [-w style]
troff:doc/recover.6:155: warning: end of sentence detected before end of text line [-w style]
2026-05-06 04:39:57 -05:00
G. Branden Robinson a33da92029 doc/*.6: Tweak copyright notices in man pages
Use *roff special character `\(co` for copyright sign.  This special
character identifier is _almost_ universally portable, dating back to
Ossanna troff in 1976.[1]  The exception is Plan 9 nroff, which claims
to be thoroughly UTF-8 oriented and should be able to render a copyright
sign.[2]  If no glyph for the character is available, the output device
driver degrades it to "c" (which is technically correct[3]), except for
groff, which falls back to "(C)"[4] only on its "ascii" output device.
All of groff's other devices have a a proper copyright sign.[5]

References:
[1] https://archive.org/details/unix-programmers-manual-seventh-edition-vol-2-1983/
    (pp. 196ff., see esp. "Table II", p. 227)
[2] https://github.com/9fans/plan9port/pull/735#issuecomment-3391733330
[3] https://www.copyright.gov/circs/circ03.pdf
[4] https://github.com/GitMirroring/groff/blob/a4d6e619afc8042b12084527c3c11eae919533e2/tmac/tty.tmac#L123
[5] https://paste.c-net.org/ComradesCourage
2026-05-06 04:39:57 -05:00
G. Branden Robinson 56d0708ac7 doc/mnh.7: Migrate to use "NH_DATESUB"
Aligns with other NetHack man pages and fixes:
$ nroff -ww -z -rCHECKSTYLE=4 -man doc/*.[67]
an.tmac:doc/mnh.7:2: style: .TH missing fourth argument; suggest package/project name and version (e.g., "groff 1.23.0")
2026-05-06 04:39:57 -05:00
G. Branden Robinson c91ee79dcb doc/nethack.6: Fix inelegant formatting
Replace instances of blank line paragraphing with `PP` macro calls.

There are three problems with the style of paragraphing that this commit
fixes.

1.  A `br` break request is redundant with an adjacent blank text line.
2.  A `br` request is also redundant with a paragraphing macro call.
3.  When you use a paragraphing macro call instead of a blank text line,
    you get the configured amount inter-paragraph space.  When
    typesetting with the man(7) package, the default inter-paragraph
    space amount is 0.4v.  A blank text line usually puts 1v of empty
    space into the document.

See groff_man_style(7).

Fixes:
$ nroff -ww -z -rCHECKSTYLE=4 -man doc/*.[67]
an.tmac:doc/nethack.6:435: style: blank line in input
an.tmac:doc/nethack.6:442: style: blank line in input
an.tmac:doc/nethack.6:535: style: blank line in input
an.tmac:doc/nethack.6:539: style: blank line in input
an.tmac:doc/nethack.6:543: style: blank line in input
an.tmac:doc/nethack.6:568: style: blank line in input
an.tmac:doc/nethack.6:572: style: blank line in input
2026-05-06 04:39:57 -05:00
G. Branden Robinson 723afcd51f doc/*.6: Fix macro usage style errors
Fixes:
$ nroff -ww -z -rCHECKSTYLE=4 -man doc/*.[67]
an.tmac:doc/dlb.6:41: style: .IR expects at least 2 arguments, got 1
an.tmac:doc/makedefs.6:125: style: .IR expects at least 2 arguments, got 1
an.tmac:doc/makedefs.6:131: style: .IR expects at least 2 arguments, got 1
an.tmac:doc/makedefs.6:137: style: .IR expects at least 2 arguments, got 1
an.tmac:doc/nethack.6:89: style: .BR expects at least 2 arguments, got 1
an.tmac:doc/nethack.6:129: style: .BR expects at least 2 arguments, got 1
an.tmac:doc/nethack.6:273: style: .BR expects at least 2 arguments, got 1
2026-05-06 04:39:57 -05:00
G. Branden Robinson d90422f0ce doc/nethack.6: Drop commented-out legacy remark
Unix terminal drivers started transitioning away from paper terminals
and toward video terminals, and therefore away from '#' and '@' as the
"erase" and "kill" characters, respectively, before NetHack was born.
2026-05-06 04:39:57 -05:00
G. Branden Robinson 3871409560 doc/nethack.6: Fix poor commented-out *roff syntax
groff_man_style(7):
   Portability
...
     \e        Format the roff escape character on the output; widely
               used in man pages to render a backslash glyph.  It works
               reliably as long as the “ec” request is not used, which
               should never happen in man pages, and it is slightly more
               portable than the more explicit \[rs] (“reverse solidus”)
               special character escape sequence.

This change's purpose is to put things right in case the change I'm
proposing next to delete this language entirely gets reverted.
2026-05-06 04:39:57 -05:00
G. Branden Robinson 75e2a6a669 doc/nethack.6: Fix invalid *roff syntax
Also fix a case hidden by a comment.

Fixes:
$ nroff -ww -z -man doc/*.[67]
troff:doc/nethack.6:68: warning: escape character ignored before '@'
troff:doc/nethack.6:292: warning: escape character ignored before '@'
2026-05-06 04:39:57 -05:00
Patric Mueller 60de227615 fix ncurses build on macOS with Homebrew 2026-05-06 09:58:00 +02:00
Benjamin de WaalandClaude Opus 4.7 f6afa23e28 libnh: fix native build of libnh.a on macOS
Fixes four issues that prevented `make WANT_LIBNH=1 all` from producing
a libnh.a that could be linked into a host program on macOS.  Before
these patches, it built but the resulting archive was unusable: macOS
ld errored on a nested liblua archive member, was missing date.o and
hacklib symbols (`populate_nomakedefs`, `eos`, `lcase`, `mungspaces`,
...), and had duplicate definitions of `main`, `whoami`, etc.

Specific changes:

1. sys/libnh/libnhmain.c: drop `static` on `whoami()`.  src/earlyarg.c
   declares it `extern` and calls it from `scores_only()`; the static
   makes it file-local and that reference goes unresolved.

2. sys/libnh/libnhmain.c: gate the emscripten-only code in get_nhuuid
   with `#ifdef __EMSCRIPTEN__` instead of `#ifdef NHUUID`.  The macOS
   hints define NHUUID for the libnh build (they did so unconditionally
   before NO_NHUUID even existed), so on native builds the compiler
   tried to call `emscripten_run_script_int` / `_string` and failed
   with implicit-function-declaration errors.  __EMSCRIPTEN__ is the
   real signal for "this is being cross-compiled to WASM."

3. sys/unix/hints/macOS.500: in the WANT_LIBNH block, add an explicit
   `recover: lua_support` dependency (gated by MAKEFILE_TOP).  When
   $(GAME) is overridden to empty, the regular `recover: $(GAME)` chain
   no longer triggers `lua_support`, so include/nhlua.h never gets
   generated and recover.c's transitive #include of hack.h fails.

4. sys/unix/hints/macOS.500: rewrite the libnh.a rule.  The previous
   `ar rcs libnh.a $(HOBJ) $(LIBNHSYSOBJ) liblua-$(LUA_VERSION).a` had
   four problems: (a) ar archives liblua.a as a single opaque member
   that macOS ld can't dereference, (b) date.o (DATE_O, kept separate
   from HOBJ) was never archived, so `populate_nomakedefs` and
   `nomakedefs` were missing, (c) hacklib.a was likewise omitted, and
   (d) HOBJ already contains $(SYSOBJ) (with unixmain.o) and $(WINOBJ)
   (the tty windowport), which duplicated symbols from libnhmain.o /
   winshim.o.

   The fix uses `libtool -static` so hacklib.a and liblua's archive
   have their members merged rather than nested, depends on $(LUALIB)
   so lua_support runs first, includes $(DATE_O) and $(TARGET_HACKLIB),
   and uses $(filter-out $(SYSOBJ) $(WINOBJ),$(HOBJ)) to drop the
   duplicates.

Verified by clean rebuild on macOS 26 (arm64, Apple clang 17):
  make spotless
  make fetch-Lua
  make WANT_LIBNH=1 all
and link-tested with a tiny harness that calls
shim_graphics_set_callback() against the resulting libnh.a.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 07:06:41 +01:00
nhmall 8fcc15a860 mention_decor and tutorial K4372
Bug report stated:
"If 'mention_decor' is set in config file or NETHACKOPTIONS,
starting the game tells you that you are standing on stairs
which lead out of the dungeon.  But if you also start the
tutorial, you won't be on those stairs--they won't even exist
until the tutorial is exited.

The stairs message can't be suppressed until the program
knows whether the tutorial will be entered, and since
prompting is one of the ways to decide that."

What this does:

Don't heed mention_decor option during the primary rcfile()
processing.

Do heed it after the tutorial.

Note:
If mention_decor is expected to actually be active during the
tutorial, then the rcfile_only_this_option(opt_mention_decor)
likely has to be moved to a different line, which should be
easy enough.
2026-05-05 11:03:44 -04:00
nhmall b7735632bf follow-up for issue #1512
The previous fix, while valid, still prompts for input during early
options processing if stdin is a tty. It really shouldn't be doing
that during early options such as --showpaths, so alter the placement
of the program_state.earlyoptions flag within *main().
2026-05-05 06:57:32 -04:00
nhmall d259245a47 Merge branch 'amiga-followups' of https://github.com/ingpaschke/NetHack into NetHack-5.0 2026-05-04 22:58:59 -04:00
Ingo Paschke ed4d100459 Amiga: provide a real v4 UUID via get_nhuuid 2026-05-04 19:13:48 +02:00
Ingo Paschke 5852e8c2a0 Amiga: ship as a NetHack drawer with drawer icon and README 2026-05-04 15:43:12 +02:00
Ingo Paschke d94fb08f8b Amiga: ship Workbench icons for the binary and text files 2026-05-04 15:33:20 +02:00
Ingo Paschke 9a909be7c5 Amiga: auto-assign NetHack: to the program directory 2026-05-04 15:33:14 +02:00
nhmall 400c458fee fix copyright release details
GitHub issue https://github.com/NetHack/NetHack/issues/1513

Starting a new game, at the
'Shall I pick character's race, role, gender and alignment for you? [ynaq]'
prompt, the game shows as 'Version 5.0.0-0 Unix Work-in-progress'
but then once the game has started and you check #version you see
the correct 'Unix NetHack Version 5.0.0-0 post-release' feedback.

Closes #1513
2026-05-04 09:06:52 -04:00
nhmall 60d59f4d55 early startup options could be run non-interactively
https://github.com/NetHack/NetHack/issues/1512

Closes #1512
2026-05-04 08:23:56 -04:00
Ingo Paschke 82efba55f2 Amiga: fix misleading fallback warning and stale comment 2026-05-04 12:42:36 +02:00
Ingo Paschke b72f5cb9a2 Amiga: stop rendering CLR_BLACK and CLR_WHITE as inverse video 2026-05-04 12:42:10 +02:00
Ingo Paschke 548f356cbd Amiga: default number_pad:1 in shipped nethack.cnf 2026-05-04 12:38:21 +02:00
Ingo Paschke 691a8dd7d2 Amiga: promote AMIGA_INTUITION to supported so it shows up in version info 2026-05-04 12:37:34 +02:00
Ingo Paschke f1393bdf6c Amiga: wire altmeta option to sysflags.altmeta 2026-05-04 12:35:33 +02:00
nhmall 3a753dc98e yet another follow-up 2026-05-03 14:13:28 -04:00
nhmall b92c1483bb another libnhmain.c follow-up
Check if it's available before calling.
2026-05-03 14:11:47 -04:00
nhmall b6482d09f4 libnhmain follow-up 2026-05-03 13:26:36 -04:00
nhmall a55ca016eb hints file update for wasm CFLAGS to include -DNHUUID 2026-05-03 13:18:37 -04:00
nhmall ced26a2cea update get_nhuuid() for libnhmain
Try using emscripten_run_script_string("crypto.randomUUID()");
I need to commit this to the repository to test it elsewhere.

If there isn't a revert shortly after this, it must have at least
built without issue.
2026-05-03 13:06:54 -04:00
nhmall 4eefeb30dd Merge branch 'amiga-5.0.0-fixes' of https://github.com/ingpaschke/NetHack into NetHack-5.0 2026-05-03 12:27:14 -04:00
Ingo Paschke b6747f89ca Amiga: fall back to text mode when tile mode is not viable
Detect Workbench depth, display-database MaxDepth, and free chip RAM;
if any signals AMIV can't run (e.g. A1000 with 4-colour WB), swap
windowprocs to amii_procs before opening any screens.
2026-05-03 18:01:07 +02:00
Ingo Paschke 2a59726f18 Amiga: disable SYSCF, drop sysconf from package
SYSCF is for multi-user system-admin lockdown; single-user Amigas
don't need it, and assure_syscf_file() killing the binary when run
outside NetHack: was breaking normal launches.
2026-05-03 17:48:22 +02:00
Ingo Paschke d9da319622 Amiga: honor __stack under libnix
Reference __stkinit so the linker pulls swapstack.o from libnix.a;
without it the program runs on the inherited shell stack and crashes
inside Lua / level-gen.
2026-05-03 17:48:15 +02:00