bugGNU roff - Bugs: bug #64356, [PATCH] [troff] tag use of '\~'...

 
 

bug #64356: [PATCH] [troff] tag use of '\~' with 'w' command

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Tue 27 Jun 2023 06:41:38 AM UTC
   
 
Category:  Core Severity:  1 - Wish
Item Group:  Feature change Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.24.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 25 Jul 2023 10:00:23 AM UTC, comment #4: 


commit 5f6e012a5b67972c4fb9a915cb315fe758936b56
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Jul 21 07:02:30 2023 -0500

    [troff]: Fix Savannah #64356.

    * src/roff/troff/node.cpp (unbreakable_space_node::tprint): Write word
      marker ('w' command) to output.

    * doc/groff.texi (Simple Commands):
    * man/groff_out.5.man (Simple commands): Document it.

    * NEWS: Add item.

    Fixes <https://savannah.gnu.org/bugs/?64356>.


G. Branden Robinson <gbranden>
Group administrator
Wed 05 Jul 2023 09:33:50 PM UTC, comment #3: 

Here's the state of this change in my working copy.

The actual code change is one line.


commit 0724915ccd9e94755fbff8703ac8e080fa15abb1
Author:     G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Tue Jun 27 07:35:35 2023 -0500
Commit:     G. Branden Robinson <g.branden.robinson@gmail.com>
CommitDate: Wed Jul 5 15:57:37 2023 -0500

    [troff]: Fix Savannah #64356.

    * src/roff/troff/node.cpp (unbreakable_space_node::tprint): Write word
      marker ('w' "command") to output.

    * doc/groff.texi (Simple Commands):
    * man/groff_out.5.man (Simple commands): Document it.

    * NEWS: Add item.

    Fixes <https://savannah.gnu.org/bugs/?64356>.

diff --git a/ChangeLog b/ChangeLog
index 74f55b1c8..e6877d2e5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2023-06-27  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/roff/troff/node.cpp (unbreakable_space_node::tprint):
+       Write word marker ('w' "command") to output.
+       * NEWS: Add item.
+
+       Fixes <https://savannah.gnu.org/bugs/?64356>.
+
 2023-06-24  G. Branden Robinson <g.branden.robinson@gmail.com>

        * src/roff/troff/input.cpp (while_request): Trivially refactor.
diff --git a/NEWS b/NEWS
index 6570ae1e2..1d6cf3c2f 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,10 @@ VERSION next

 troff
 -----
+o GNU troff output now reports unbreakable spaces (those produced with
+  the `\~` escape sequence) as word breaks with the documentary 'w'
+  command, just as regular breakable spaces do.
+
 o In nroff mode (in other words, when producing output for terminal
   devices), the formatter now reports warning diagnostics regarding
   certain output problems using units of lines instead of inches (or the
diff --git a/doc/groff.texi b/doc/groff.texi
index 37a25e8b4..aad4bce4d 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -17797,10 +17797,10 @@ @node Simple Commands

 @item w
 Indicate an inter-word space.  No action is performed; the command is
-present to make the output more easily parsed.  Only adjustable,
-breakable inter-word spaces are thus described; those resulting from
-@code{\~} or horizontal motion escape sequences are not.  GNU
-@code{troff} issues this command but @code{groff}'s output driver
+present to make the output more easily parsed.  Only inter-word spaces
+on an output line (be they breakable or not) are thus described; those
+resulting from @code{\~} or horizontal motion escape sequences are not.
+GNU @code{troff} issues this command but @code{groff}'s output driver
 library ignores it.  See @code{h} and @code{H} above.
 @end table

diff --git a/man/groff_out.5.man b/man/groff_out.5.man
index 9c1534e2e..de6d872ac 100644
--- a/man/groff_out.5.man
+++ b/man/groff_out.5.man
@@ -822,8 +822,9 @@ .SS "Simple commands"
 No action is performed;
 the command is present to make the output more easily parsed.
 .
-Only adjustable,
-breakable inter-word spaces are thus described;
+Only inter-word spaces on an output line
+(be they breakable or not)
+are thus described;
 those resulting from
 .B \[rs]\[ti]
 or horizontal motion escape sequences are not.
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 43c75898d..75758da17 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -5829,6 +5829,7 @@ int word_space_node::is_tag()
 void unbreakable_space_node::tprint(troff_output_file *out)
 {
   out->fill_color(col);
+  out->word_marker();
   if (is_html) {
     // we emit the space width as a negative glyph index
     out->flush_tbuf();


G. Branden Robinson <gbranden>
Group administrator
Wed 28 Jun 2023 01:42:29 PM UTC, comment #2: 

Documentation update.


diff --git a/doc/groff.texi b/doc/groff.texi
index 37a25e8b4..aad4bce4d 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -17797,10 +17797,10 @@ @node Simple Commands

 @item w
 Indicate an inter-word space.  No action is performed; the command is
-present to make the output more easily parsed.  Only adjustable,
-breakable inter-word spaces are thus described; those resulting from
-@code{\~} or horizontal motion escape sequences are not.  GNU
-@code{troff} issues this command but @code{groff}'s output driver
+present to make the output more easily parsed.  Only inter-word spaces
+on an output line (be they breakable or not) are thus described; those
+resulting from @code{\~} or horizontal motion escape sequences are not.
+GNU @code{troff} issues this command but @code{groff}'s output driver
 library ignores it.  See @code{h} and @code{H} above.
 @end table

diff --git a/man/groff_out.5.man b/man/groff_out.5.man
index 9c1534e2e..de6d872ac 100644
--- a/man/groff_out.5.man
+++ b/man/groff_out.5.man
@@ -822,8 +822,9 @@ .SS "Simple commands"
 No action is performed;
 the command is present to make the output more easily parsed.
 .
-Only adjustable,
-breakable inter-word spaces are thus described;
+Only inter-word spaces on an output line
+(be they breakable or not)
+are thus described;
 those resulting from
 .B \[rs]\[ti]
 or horizontal motion escape sequences are not.


G. Branden Robinson <gbranden>
Group administrator
Wed 28 Jun 2023 01:30:05 PM UTC, comment #1: 


diff --git a/ChangeLog b/ChangeLog
index b250e3f1c..d18e156e1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2023-06-27  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/roff/troff/node.cpp (unbreakable_space_node::tprint):
+       Write word marker ('w' "command") to output.
+       * NEWS: Add item.
+
+       Fixes <https://savannah.gnu.org/bugs/?64356>.
+
 2023-06-24  G. Branden Robinson <g.branden.robinson@gmail.com>

        * src/roff/troff/input.cpp (while_request): Trivially refactor.
diff --git a/NEWS b/NEWS
index 6570ae1e2..1d6cf3c2f 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,10 @@ VERSION next

 troff
 -----
+o GNU troff output now reports unbreakable spaces (those produced with
+  the `\~` escape sequence) as word breaks with the documentary 'w'
+  command, just as regular breakable spaces do.
+
 o In nroff mode (in other words, when producing output for terminal
   devices), the formatter now reports warning diagnostics regarding
   certain output problems using units of lines instead of inches (or the
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 152dfda1b..341edce1f 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -5828,6 +5828,7 @@ int word_space_node::is_tag()
 void unbreakable_space_node::tprint(troff_output_file *out)
 {
   out->fill_color(col);
+  out->word_marker();
   if (is_html) {
     // we emit the space width as a negative glyph index
     out->flush_tbuf();


G. Branden Robinson <gbranden>
Group administrator
Tue 27 Jun 2023 06:41:38 AM UTC, original submission:  

\~ produces a discardable space.  In this respect it is like an ordinary space character in input.  It is also a word boundary.

Horizontal motions are not treated as word boundaries in the page description language, and do not put 'w' commands on the output.

\~ should put 'w' commands on the output, as ordinary (breakable) spaces do.

I grant that almost no one will notice this change.

G. Branden Robinson <gbranden>
Group administrator

 

(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 (Submitted the item)
  •  

    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-07-25 gbranden StatusIn Progress Fixed
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.24.0
    2023-06-28 gbranden StatusNone In Progress
        Assigned toNone gbranden
        Summary[troff] tag use of '\~' with 'w' command [PATCH] [troff] tag use of '\~' with 'w' command

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code