bugGNU roff - Bugs: bug #63121, [mdoc] default value for...

 
 

bug #63121: [mdoc] default value for doc-volume-operating-system string should not be "BSD"

Submitter:  None
Submitted:  Wed 28 Sep 2022 12:40:08 PM UTC
   
 
Category:  Macro package mdoc Severity:  3 - Normal
Item Group:  Incorrect behaviour Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.23.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 28 Sep 2022 07:19:21 PM UTC, comment #1: 

Thanks for the report.

This is already fixed in groff Git and is expected in the groff 1.23 release.

Here is the commit message.  I am including a part of the associated diff that you can perhaps employ as a patch (I don't know how well it will apply to your system's installation).


commit f911d0075cdae4a9f940ef2cad27e53a7af01b61
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Wed Sep 7 23:29:29 2022 -0500

    [mdoc]: Stop prefixing center header with "BSD".

    Stop prefixing center header with name of operating system.  This was
    hard-coded to "BSD" and stuck on all mdoc(7) pages using a default
    manual section number, regardless of host operating system.  Bad idea.
    Further, the argument to the `Os` call, if any, or a default, is always
    disclosed in the left footer, so the foregoing practice gave the reader
    no new information.  (On the other hand, header and footer rendering was
    not reliable in continuous rendering mode, the default for terminals, in
    groff 1.22.4 and earlier.  It is now.)

    * tmac/mdoc/doc-common: Do it.

      (Dt): Initialize `doc-volume` as empty and annotate it; calling the
      macro with a numeric second argument overrides the fallback default of
      "LOCAL".  A slash is no longer needed to separate a recognized
      architecture string from the OS name, so drop it.

    * tmac/groff_mdoc.7.man: Stop using the string in examples.  Also
      correct table format specification declaring 3 columns but using 2.

    * tmac/tests/doc_smoke-test.sh: Update test expectations.

diff --git a/tmac/mdoc/doc-common b/tmac/mdoc/doc-common
index 3845a507e..dd936a808 100644
--- a/tmac/mdoc/doc-common
+++ b/tmac/mdoc/doc-common
@@ -348,7 +348,6 @@
 .
 .\" an alternative, more detailed scheme for naming the manual sections
 .\"
-.ds doc-volume-operating-system BSD
 .ds doc-volume-ds-1 General Commands Manual
 .ds doc-volume-ds-2 System Calls Manual
 .ds doc-volume-ds-3 Library Functions Manual
@@ -472,10 +471,10 @@
 .    ds doc-section \$2
 .    ie \B'\$2' \{\
 .      if ((\$2 >= 1) & (\$2 <= 9)) \{\
-.        ds doc-volume "\*[doc-volume-operating-system]
+.        ds doc-volume \" empty (not "LOCAL")
 .        if \A'\$3' \{\
 .          if d doc-volume-as-\$3 \
-.            as doc-volume "/\*[doc-volume-as-\$3]
+.            as doc-volume "\*[doc-volume-as-\$3]
 .          \}
 .        as doc-volume " \*[doc-volume-ds-\$2]
 .      \}


I was doing quite a bit of work on mdoc a couple of weeks ago, so you may well need or want some other changes in the vicinity.

https://git.savannah.gnu.org/cgit/groff.git/log/?ofs=50
https://git.savannah.gnu.org/cgit/groff.git/log/?ofs=100

Alternatively, you might wish to run a groff built from Git source.

https://git.savannah.gnu.org/cgit/groff.git/tree/INSTALL.REPO

G. Branden Robinson <gbranden>
Group administrator
Wed 28 Sep 2022 12:40:08 PM UTC, original submission:  

I've created a manual page in mdoc format and my surprise comes when I tried to initialize the .Os macro to Petalinux and I got it correctly in the manual page footers, but incorrectly in the manual section headers.  Looking for the macro definition, I found in /usr/share/groff/1.22.4/tmac/mdoc/doc-common that either

.ds doc-default-operating-system BSD

and later

.ds doc-volume-operating-system BSD

My proposal is to define it as

.ds doc-volume-operating-system \\*[doc-operating-system]

so, if I change the operating system in the document .Os macro, it also gets changed in the manual section headers.  This, despite of what /usr/share/groff/site-tmac/mdoc.local has.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-06-27 gbranden SummaryDefault value for doc-volume-operating-system string in tmac/mdoc/doc-common [mdoc] default value for doc-volume-operating-system string should not be "BSD"
    2022-09-28 gbranden Item GroupNone Incorrect behaviour
        StatusNone Fixed
        Assigned toNone gbranden
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.23.0

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code