groff-commit
[Top][All Lists]
Advanced

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

[groff] 12/16: Revert "[man]: Modify typeset URI breaking strategy."


From: G. Branden Robinson
Subject: [groff] 12/16: Revert "[man]: Modify typeset URI breaking strategy."
Date: Sat, 6 Nov 2021 01:38:20 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit b5461ca30b0f91a3efdead93aa7d5c2dca112d27
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Nov 6 02:53:36 2021 +1100

    Revert "[man]: Modify typeset URI breaking strategy."
    
    This reverts commit c7efb5fd40aae5293d9de87092b7a4b2be89df91.
    
    Unfortunately this was not fully baked with respect to .UR/.UE or
    .MT/.ME embedding within a .TP paragraph tag.  Resolving that means
    coping with nested diversions.
    
    Better luck next time, I tell myself.
    
    tmac/tests/an-ext_link-macros-work-in-paragraph-tags.sh still fails.
    Will fix in next commit.
---
 ChangeLog               | 27 ---------------------------
 tmac/an-ext.tmac        | 41 ++---------------------------------------
 tmac/groff_man.7.man.in | 19 +++++++++++++------
 tmac/tmac.am            |  3 ++-
 4 files changed, 17 insertions(+), 73 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e586b55..5077510 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -120,33 +120,6 @@
 
 2021-11-01  G. Branden Robinson <g.branden.robinson@gmail.com>
 
-       [man]: Try to minimize the number of times a URI is broken when
-       it has to be typeset and prevent it from provoking adjustment
-       warnings.
-
-       * tmac/an-ext.tmac (UE, ME): Do it.  New Boolean register `mL`
-       records whether the URI will cause a break.  New string `m2`
-       contains the user-specified URI (`m1`) plus the angle brackets
-       around it and any user-specified trailing punctuation (\$1).
-       New register `mW` stores the formatted width of `m2`.  If the
-       page offset plus the indentation plus the current horizontal
-       position on the output line plus `mW` exceeds the output line
-       length, turn off adjustment and break the line _before_
-       typesetting `m2`.  Then, if we forced a break, restore the
-       previous adjustment mode.  Shift off the first macro parameter
-       and emit the (undocumented) rest as before.
-
-       * tmac/groff_man.7.man.in (Hyperlink macros): Document it.
-
-       * tmac/tests/an-ext_UE-breaks-before-long-URIs.sh: Test it.
-       * tmac/tmac.am (tmac_TESTS): Run test.
-
-       Prompted by a suggestion from James K. Lowden
-       <https://lists.gnu.org/archive/html/groff/2021-10/msg00048.html>
-       --thanks, James!
-
-2021-11-01  G. Branden Robinson <g.branden.robinson@gmail.com>
-
        * src/devices/grohtml/post-html.cpp
        (html_printer::do_file_components): Add assertion.
 
diff --git a/tmac/an-ext.tmac b/tmac/an-ext.tmac
index 44b347b..7a6e4b9 100644
--- a/tmac/an-ext.tmac
+++ b/tmac/an-ext.tmac
@@ -4,7 +4,6 @@
 .\"
 .\" Written by Eric S. Raymond <esr@thyrsus.com>
 .\"            Werner Lemberg <wl@gnu.org>
-.\"            G. Branden Robinson <g.branden.robinson@gmail.com>
 .\"
 .\" You may freely use, modify and/or distribute this file.
 .\"
@@ -140,30 +139,12 @@
 \&\\$*\"
 .  \}
 .  el \{\
-.    nr mL 0 \" Will the URI+punctuation cause a break?
-.    ds m2 \\*(la\\*(m1\\*(ra\\$1\"
-.    nr mW \\w'\\*(m2'
-.    \" If the URI won't fit on the rest of the line, break early and
-.    \" turn off adjustment.
-.    if \\n(.i+\\n(.ku+\\n(mWu>\\n(.lu \{\
-.      nr mL 1
-.      nr mJ \\n(.j
-.      br
-.      na
-.    \}
 .    nh
-\\*(m2
-.    \" If we had to break before the URI, restore adjustment.
-.    if \\n(mL .ad \\n(mJ
+\\*(la\\*(m1\\*(ra\\$1
 .    do shift
 .    ie \n(.g \&\\$*\"
 .    el \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9\"
 .    hy \\n(HY
-.    rr mJ
-.    rr mW
-.    rr mL
-.    rm m2
-.    rm m1
 .  \}
 ..
 .
@@ -210,30 +191,12 @@
 \&\\$*\"
 .  \}
 .  el \{\
-.    nr mL 0 \" Will the URI+punctuation cause a break?
-.    ds m2 \\*(la\\*(m1\\*(ra\\$1\"
-.    nr mW \\w'\\*(m2'
-.    \" If the URI won't fit on the rest of the line, break early and
-.    \" turn off adjustment.
-.    if \\n(.i+\\n(.ku+\\n(mWu>\\n(.lu \{\
-.      nr mL 1
-.      nr mJ \\n(.j
-.      br
-.      na
-.    \}
 .    nh
-\\*(m2
-.    \" If we had to break before the URI, restore adjustment.
-.    if \\n(mL .ad \\n(mJ
+\\*(la\\*(m1\\*(ra\\$1
 .    do shift
 .    ie \n(.g \&\\$*\"
 .    el \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9\"
 .    hy \\n(HY
-.    rr mJ
-.    rr mW
-.    rr mL
-.    rm m2
-.    rm m1
 .  \}
 ..
 .
diff --git a/tmac/groff_man.7.man.in b/tmac/groff_man.7.man.in
index ade9cb2..90c1469 100644
--- a/tmac/groff_man.7.man.in
+++ b/tmac/groff_man.7.man.in
@@ -1161,12 +1161,6 @@ and
 .B .UR
 URIs are rendered between angle brackets after the linked text.
 .
-If such a URI will not fit on the remainder of the output line,
-the macro package temporarily turns off adjustment
-(if enabled)
-and breaks the line before the URI to minimize the number of output
-lines over which it spreads.
-.
 .
 .P
 .BR .MT ,
@@ -1384,6 +1378,19 @@ home page
 _endif()dnl
 .
 .
+.P
+The hyperlinking of
+.B .TP
+paragraph tags with
+.BR .UR / .UE
+and
+.BR .MT / .ME
+is not yet supported;
+if attempted,
+the hyperlink will be typeset at the beginning of the indented paragraph
+even on hyperlink-supporting devices.
+.
+.
 .\" ====================================================================
 .SS "Font style macros"
 .\" ====================================================================
diff --git a/tmac/tmac.am b/tmac/tmac.am
index 5862be0..08aeb82 100644
--- a/tmac/tmac.am
+++ b/tmac/tmac.am
@@ -197,7 +197,8 @@ EXTRA_DIST += $(tmac_TESTS)
 
 tmac_XFAIL_TESTS = \
   tmac/tests/an-ext_ME-punct-hyphenates.sh \
-  tmac/tests/an-ext_UE-punct-hyphenates.sh
+  tmac/tests/an-ext_UE-punct-hyphenates.sh \
+  tmac/tests/an-ext_UE-breaks-before-long-URIs.sh
 XFAIL_TESTS += $(tmac_XFAIL_TESTS)
 
 tmac/www.tmac: tmac/www.tmac.in



reply via email to

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