bug-groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #62774] [mdoc] cope with degenerate documents (`Dd`, `Dt`, `Os` not


From: G. Branden Robinson
Subject: [bug #62774] [mdoc] cope with degenerate documents (`Dd`, `Dt`, `Os` not called)
Date: Sun, 11 Sep 2022 08:23:55 -0400 (EDT)

Update of bug #62774 (project groff):

                  Status:             In Progress => Fixed                  
             Assigned to:                    None => gbranden               
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #4:


commit 4080ed7f3b4a3c7e361dec2cb4276a2d6398bd89
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Tue Sep 6 18:38:33 2022 -0500

    [mdoc]: Handle setup macro use degeneracy better.
    
    * tmac/mdoc/doc-common: Populate default date string `doc-date-string`
      with "UNDATED".
    
      (Dd, Dt, Os): Make more orthogonal: stop touching `doc-topic-name`.
      It is "doc.tmac"'s job to initialize it and the `Nm` macro's job to
      update it.
    
      (Dd): Do nothing if given no arguments.  (You can still blank
      out the document date with an explicitly empty argument:
        .Dd ""
      .)
    
    Fixes <https://savannah.gnu.org/bugs/?62774> (1/7).
    
    Fix code style nit: end string defs with comment escape sequences.

commit 16fe833f0ae094516aafd4c1b591f21d3a4ba112
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Tue Sep 6 18:57:04 2022 -0500

    [mdoc]: Relieve `Dt` of reinitialization duty.
    
    * tmac/mdoc/doc-common (Dt): Stop reinitializing `doc-volume` and
      `doc-section`.  This is the job of package initialization (and, soon,
      the end-of-input macro).
    
    Fixes <https://savannah.gnu.org/bugs/?62774> (2/7).

commit 1db6f86623c7f4bb5271fa5c5e4f1a2e47e030cd
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Tue Sep 6 19:36:16 2022 -0500

    [mdoc]: Reset strings between documents.
    
    * tmac/mdoc/doc-common (doc-end-macro): Reset strings to reduce info
      leaks from one man page to the next.
    
    Fixes <https://savannah.gnu.org/bugs/?62774> (3/7).

commit a241f55c920b45fcb42f7b8a33bc7a2bbd8f6722
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Tue Sep 6 20:32:05 2022 -0500

    [mdoc]: Manage footer formatting more coherently.
    
    * tmac/mdoc/doc-common (doc-footer): Pull more footer concerns into this
      macro.  Don't bail out if continuously rendering; instead, format the
      appropriate footer text if we are.  For now, break the page only if we
      are not continuously rendering.
    
      (doc-end-macro): Call `doc-footer` instead of fomatting footer here.
    
    Fixes <https://savannah.gnu.org/bugs/?62774> (4/7).
    
    Indentation is _not_ corrected in this commit, for clarity.

commit da5ad142d88d167dd57b722d96b1ca0b2a0bbbbf
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Tue Sep 6 23:03:13 2022 -0500

    [mdoc]: Warn if Dd, Dt called without arguments.
    
    * tmac/mdoc/doc-common (Dt, Dd): Emit diagnostic warnings if macros
      called with no arguments.
    
    Fixes <https://savannah.gnu.org/bugs/?62774> (5/7).
    
    I dislike this diagnostic message format, but it's consistent with
    existing groff mdoc practice.

commit 892703b17e088be214c8d0d91db14d2bd6a8dcd5
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Tue Sep 6 23:47:40 2022 -0500

    [mdoc]: Align footer management closer to man(7).
    
    * tmac/doc.tmac (doc-save-global-vars, doc-restore-global-vars):
    * tmac/mdoc/doc-common (Rd):
    * tmac/mdoc/doc-ditroff:
    * tmac/mdoc/doc-nroff: Stop defining, saving, and restoring
      `doc-footer-space`.
    
    * tmac/mdoc/doc-common (doc-break-body-text): New macro, called only
      when not continuously rendering, schedules a page break.
    
      (doc-footer): Stop vertically spacing by `doc-footer-space`, instead
      relying upon a trap to move us here.
    
    * tmac/mdoc/doc-ditroff (doc-setup-header):
    * tmac/mdoc/doc-nroff (doc-setup-header): Set traps at the end of the
      page where man(7) does by default; break the body text at
      1 inch from the page bottom, and write the footer at ½ inch.
    
    * tmac/mdoc/doc-nroff (doc-setup-header): Add 1/6 inch "thin space"
      between man page name and parenthesized section, for precise parity
      with doc-ditroff implementation.  (`\|` does not take up any character
      cells on nroff devices.)
    
    Fixes <https://savannah.gnu.org/bugs/?62774> (6/7).

commit 50a2d4165f7b82cb78d7ee96484f776c11a47def
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Wed Sep 7 20:00:31 2022 -0500

    [mdoc]: Align trap mgmt more closely with man(7).
    
    * tmac/mdoc/doc-common: Call new macro (see below)
      `doc-set-up-continuous-rendering` when initializing, if that is mode
      is configured.
    
      (doc-ne): New macro replaces `ne` request in continuous rendering
      mode.  It extends the page length by the amount in the argument or by
      1v if none given.
    
      (doc-bp): New macro replaces `bp` request in continuous rendering
      mode, setting the page length to the vertical drawing position.
    
      (doc-set-up-continuous-rendering): New macro renames requests to
      emplace the foregoing.
    
      (Dd): Interpret this macro call strictly as starting a new mdoc(7)
      document.  (andoc.tmac already makes this assumption, and has for over
      20 years.  groff_mdoc(7) and mandoc_mdoc(7) also prescribe the
      sequence `Dd`, `Dt`, `Os`.)  We require this invariant even more
      rigidly now because it's the only way we can be sure that we can
      process multiple documents while rendering headers and footers with
      information corresponding to the appropriate document.  (man(7)'s `TH`
      has an advantage here in that calling it is "atomic": from its
      arguments alone you can obtain everything you need to know to format
      the header and footer.  In mdoc(7), permuting the initialization macro
      order reliably produces chaos.)  Break the page (if necessary)
      _before_ processing any arguments (instead of after), to flush the
      previous page's footer.  Stop calling `doc-set-up-titles` here; we
      don't have enough information to do that yet.  Also stop writing the
      PDF bookmark here, because `doc-document-title` and `doc-section` will
      not reflect the new page content yet.
    
      (Os): Once the `doc-operating-system` string content has been
      determined, call `doc-set-up-titles`, write the PDF bookmark for the
      page, and call `doc-header`, causing the page header to be formatted.
      These changes further imply a stronger requirement on initialization
      macro ordering being canonical.

    Fixes <https://savannah.gnu.org/bugs/?62774> (7/7).



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?62774>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]