bug-groff
[Top][All Lists]
Advanced

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

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


From: G. Branden Robinson
Subject: [bug #64356] [PATCH] [troff] tag use of '\~' with 'w' command
Date: Wed, 5 Jul 2023 17:33:51 -0400 (EDT)

Follow-up Comment #3, bug #64356 (project groff):

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();




    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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