bugGNU roff - Bugs: bug #51312, [PATCH] put \& between spaces...

 
 

bug #51312: [PATCH] put \& between spaces and dots in *roff documents

Submitter:  Bjarni Ingi Gislason <bjarniig>
Submitted:  Sun 25 Jun 2017 09:22:51 PM UTC
   
 
Category:  General Severity:  2 - Minor
Item Group:  Lint Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.23.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Tue 11 Jan 2022 06:31:38 PM UTC, comment #9: 

A typo in comment #8 is making it show up blank here (which seems to me like a bug in the bug tracker).  It showed up fine on bug-groff, and here it is again here:


commit cbbf97b88157283ee1b8d67d98bf15633b8d3921
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Tue Jan 11 19:25:01 2022 +1100

    [docs]: Be more careful with control characters.

    ...when they are word-initial in filled text lines.

    The idea is to prevent baffling surprises if a sentence is recast in a
    text editor, and a word beginning with a dot or neutral apostrophe is
    reflowed onto the beginning of the next input line--suddenly it is
    parsed as a control character.

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


Dave <barx>
Group Member
Tue 11 Jan 2022 11:39:19 AM UTC, comment #8: 


commit cbbf97b88157283ee1b8d67d98bf15633b8d3921
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Tue Jan 11 19:25:01 2022 +1100

    [docs]: Be more careful with control characters.

    ...when they are word-initial in filled text lines.

    The idea is to prevent baffling surprises if a sentence is recast in a
    text editor, and a word beginning with a dot or neutral apostrophe is
    reflowed onto the beginning of the next input line--suddenly it is
    parsed as a control character.

    Fixes <https://savannah.gnu.org/bugs/?51312>.
-verbatim0

G. Branden Robinson <gbranden>
Group administrator
Tue 11 Jan 2022 08:05:22 AM UTC, comment #7: 

...tbl format declarations...


cb cb
cf(CR) l .


G. Branden Robinson <gbranden>
Group administrator
Tue 11 Jan 2022 07:56:56 AM UTC, comment #6: 

...arguments to string interpolations...


\*[SIZE -.7]TOP\*[FU2]\*[UP .5p]\c


(That's from contrib/mom/examples/mom-pdf.mom .)

G. Branden Robinson <gbranden>
Group administrator
Tue 11 Jan 2022 07:55:16 AM UTC, comment #5: 

...`ig`-nored regions...

G. Branden Robinson <gbranden>
Group administrator
Tue 11 Jan 2022 07:53:08 AM UTC, comment #4: 

...inline pic(1) input...

G. Branden Robinson <gbranden>
Group administrator
Tue 11 Jan 2022 07:51:44 AM UTC, comment #3: 

...man(7) paragraph tags (the first line after a `TP` call)...

G. Branden Robinson <gbranden>
Group administrator
Tue 11 Jan 2022 07:48:33 AM UTC, comment #2: 

Another couple of cases that are not problematic.

  • Table data (outside of text blocks)
  • *roff comments


I'm finding these as I review the following.


grep -l "^[^.'].* [.']"


...using a hand-built list of all *roff documents in our source tree.

G. Branden Robinson <gbranden>
Group administrator
Tue 11 Jan 2022 06:20:46 AM UTC, comment #1: 

Some of these are good ideas, and some are not.

I have three observations.

1. The addition of non-printing input breaks before dots in unfilled text or in control lines (such as macro calls) is unnecessary and noisy.  In filled text, they are worthwhile, and a well-taken point of defensive programming.

2. For the remaining cases of good practice, we shouldn't just make our own documents robust, but offer the same advice to the user.

3. The exact same logic applies to the no-break control character, so that should be done as well.  Fortunately, I expect few applicable occasions in groff's documentary corpus: words that begin with an apostrophe are rare in English, especially in formal writing, though I suppose slap-happy man page writers who refuse to learn anything in the groff_char(7) page will have been bitten many times.

I won't be applying the patch as-is, as I have no hope of it being less work compared to my own grepping and sedding.  Nearly every file in the patch has seen immense amounts of revision in the four and a half years since this ticket was filed.

G. Branden Robinson <gbranden>
Group administrator
Sun 25 Jun 2017 09:22:51 PM UTC, original submission:  

 contrib/chem/chem.1.man                       |  2 +-
 contrib/glilypond/glilypond.1.man             |  2 +-
 contrib/gperl/gperl.1.man                     |  4 ++--
 contrib/groff_filenames/groff_filenames.5.man |  6 +++---
 contrib/hdtbl/groff_hdtbl.7.man               |  4 ++--
 contrib/mm/groff_mm.7.man                     | 12 ++++++------
 contrib/pdfmark/pdfroff.1.man                 |  2 +-
 man/groff.7.man                               |  2 +-
 man/groff_out.5.man                           |  4 ++--
 man/groff_tmac.5.man                          |  4 ++--
 man/roff.7.man                                |  6 +++---
 src/devices/grohtml/grohtml.1.man             |  2 +-
 src/devices/grolbp/grolbp.1.man               |  2 +-
 src/devices/grolj4/grolj4.1.man               |  2 +-
 src/devices/grops/grops.1.man                 |  4 ++--
 src/preproc/eqn/eqn.1.man                     |  4 ++--
 src/preproc/pic/pic.1.man                     |  6 +++---
 src/preproc/refer/refer.1.man                 |  2 +-
 src/preproc/soelim/soelim.1.man               |  4 ++--
 src/preproc/tbl/tbl.1.man                     |  6 +++---
 src/roff/groff/groff.1.man                    |  4 ++--
 src/roff/troff/troff.1.man                    |  2 +-
 src/utils/hpftodit/hpftodit.1.man             |  2 +-
 src/utils/pfbtops/pfbtops.1.man               |  2 +-
 tmac/groff_me.7.man                           |  6 +++---
 tmac/groff_trace.7.man                        |  2 +-
 tmac/groff_www.7.man                          |  2 +-
 27 files changed, 50 insertions(+), 50 deletions(-)

  The patch is in the attachment.

Bjarni Ingi Gislason <bjarniig>

 

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

Attach Files:
   
   
Comment:
   

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by barx (Posted a comment)
  • -email is unavailable- added by gbranden (Posted a comment)
  • -email is unavailable- added by bgarrigues (Updated the item)
  • -email is unavailable- added by bjarniig (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 11 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-01-11 gbranden StatusIn Progress Fixed
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.23.0
    2022-01-11 gbranden CategoryNone General
        Item GroupDocumentation Lint
    2022-01-11 gbranden StatusNone In Progress
        Assigned toNone gbranden
        Summary[Patch] Protect full stop (.) [PATCH] put \& between spaces and dots in *roff documents
    2017-09-01 bgarrigues Severity3 - Normal 2 - Minor
        Item GroupNone Documentation
    2017-06-25 bjarniig Attached File- Added 0001-Protect-a-full-stop-.-if-a-blank-white-space-is-in-fro.txt.gz, #41045

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code