bug-bash
[Top][All Lists]
Advanced

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

[PATCH 15/18] doc/bash.1: favor `TP` over `IP` for tagged paragraphs


From: G. Branden Robinson
Subject: [PATCH 15/18] doc/bash.1: favor `TP` over `IP` for tagged paragraphs
Date: Wed, 31 Jan 2024 02:43:19 -0600

In the forthcoming groff 1.24.0, I get the following bad rendering:

            versionThe version test may be used to perform comparisons
                   against specific readline  versions.   The  version

This is due to a pending change.

commit cba927a37a749cf912a183496002d8545d7619d5
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Mon Nov 20 08:33:57 2023 -0600

    [man]: Don't enforce tag separation on `IP`.

    The tags to `IP` macros are often very short, as with bullets or list
    enumerators (and in fact we encourage this practice in our style advice,
    promoting `TP` for definition lists and similar).  We therefore don't
    want to enforce the `TS` tag separation for them.  `.IP \[bu] 2n` is a
    perfectly cromulent usage pattern.

    * tmac/an.tmac: Add new Boolean-valued register,
      `an*enforce-tag-separation` to control this aspect of state.
      Initialize it true.
      (an-write-paragraph-tag): Multiply `TS` by this register to apply
      enforcement (or not).
      (IP): Temporarily clear register while setting paragraph.

    * tmac/groff_man.7.man.in (Paragraphing macros, Options):
    * NEWS: Update documentation.

(`IP` still won't let the tag and the text _overlap_, but they can abut,
as seen above.  This is potentially not objectionable when using
punctuation instead of words for tags; as noted, the `TP` macro is a
better fit for the latter.  `TP` is also more flexible, permitting macro
calls in the tag.)

Diff of rendering (groff Git):

-            versionThe version test may be used to perform comparisons against
+            version
+                   The version test may be used to perform comparisons against

-     $endif This command, as seen in the previous example, terminates an $if
+     $endif
+            This command, as seen in the previous example, terminates an $if
             command.
---
 doc/bash.1 | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/doc/bash.1 b/doc/bash.1
index 93855546..ec1f8ce1 100644
--- a/doc/bash.1
+++ b/doc/bash.1
@@ -6585,7 +6585,8 @@ .SS "Readline Conditional Constructs"
 compilation features of the C preprocessor which allows key
 bindings and variable settings to be performed as the result
 of tests.  There are four parser directives used.
-.IP \fB$if\fP
+.TP
+.B $if
 The
 .B $if
 construct allows bindings to be made based on the
@@ -6594,14 +6595,16 @@ .SS "Readline Conditional Constructs"
 extends to the end of the line;
 unless otherwise noted, no characters are required to isolate it.
 .RS
-.IP \fBmode\fP
+.TP
+.B mode
 The \fBmode=\fP form of the \fB$if\fP directive is used to test
 whether readline is in emacs or vi mode.
 This may be used in conjunction
 with the \fBset keymap\fP command, for instance, to set bindings in
 the \fIemacs\-standard\fP and \fIemacs\-ctlx\fP keymaps only if
 readline is starting out in emacs mode.
-.IP \fBterm\fP
+.TP
+.B term
 The \fBterm=\fP form may be used to include terminal-specific
 key bindings, perhaps to bind the key sequences output by the
 terminal's function keys.  The word on the right side of the
@@ -6614,7 +6617,8 @@ .SS "Readline Conditional Constructs"
 and
 .IR sun\-cmd ,
 for instance.
-.IP \fBversion\fP
+.TP
+.B version
 The \fBversion\fP test may be used to perform comparisons against
 specific readline versions.
 The \fBversion\fP expands to the current readline version.
@@ -6634,7 +6638,8 @@ .SS "Readline Conditional Constructs"
 is assumed to be \fB0\fP.
 The operator may be separated from the string \fBversion\fP
 and from the version number argument by whitespace.
-.IP \fBapplication\fP
+.TP
+.B application
 The \fBapplication\fP construct is used to include
 application-specific settings.  Each program using the readline
 library sets the \fIapplication name\fP, and an initialization
@@ -6653,7 +6658,8 @@ .SS "Readline Conditional Constructs"
 .fi
 .EE
 .RE
-.IP \fIvariable\fP
+.TP
+.I variable
 The \fIvariable\fP construct provides simple equality tests for readline
 variables and values.
 The permitted comparison operators are \fI=\fP, \fI==\fP, and \fI!=\fP.
@@ -6663,13 +6669,16 @@ .SS "Readline Conditional Constructs"
 Both string and boolean variables may be tested. Boolean variables must be
 tested against the values \fIon\fP and \fIoff\fP.
 .RE
-.IP \fB$endif\fP
+.TP
+.B $endif
 This command, as seen in the previous example, terminates an
 \fB$if\fP command.
-.IP \fB$else\fP
+.TP
+.B $else
 Commands in this branch of the \fB$if\fP directive are executed if
 the test fails.
-.IP \fB$include\fP
+.TP
+.B $include
 This directive takes a single filename as an argument and reads commands
 and bindings from that file.  For example, the following directive
 would read \fI/etc/inputrc\fP:
-- 
2.30.2

Attachment: signature.asc
Description: PGP signature


reply via email to

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