From 750b9fefc49ea1362eac79a078c1a4c03f8cccd8 Mon Sep 17 00:00:00 2001 From: Bjarni Ingi Gislason Date: Sat, 28 Apr 2018 00:02:57 +0000 Subject: [PATCH] macro files: Protect space and its visibility Add a '\&' in front of '\"' to preserve the visibility of significant space characters in the case the comment gets stripped off (with "tmac/strip.sed"). Add a missing comment ("Protect space and its visibility") to an empty comment field. Not all readers understand the function of '\"' in these cases. Signed-off-by: Bjarni Ingi Gislason --- contrib/mm/m.tmac | 10 +++++----- contrib/mm/mse.tmac | 2 +- contrib/pdfmark/spdf.tmac | 6 +++--- tmac/cs.tmac | 2 +- tmac/de.tmac | 2 +- tmac/doc.tmac-u | 6 +++--- tmac/fr.tmac | 2 +- tmac/pdfpic.tmac | 8 ++++---- tmac/ptx.tmac | 6 +++--- tmac/sv.tmac | 2 +- tmac/trace.tmac | 14 +++++++------- tmac/www.tmac.in | 10 +++++----- 12 files changed, 35 insertions(+), 35 deletions(-) diff --git a/contrib/mm/m.tmac b/contrib/mm/m.tmac index 3da120ec..c0dd8a36 100644 --- a/contrib/mm/m.tmac +++ b/contrib/mm/m.tmac @@ -313,7 +313,7 @@ Index array!index .\" .\" Copy to (.NS) .ds Letnsdef 0 -.ds Letns!copy Copy \" space! +.ds Letns!copy Copy \&\" space! .ds Letns!to " to .ds Letns!0 Copy to .ds Letns!1 Copy (with att.\&) to @@ -1006,7 +1006,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%] .if (\\n[hd*level]=1)&(\\n[H1dot]=0) .ds hd*mark \\n[H1] .\" .ds hd-mark-trimmed \\*[hd*mark]\" save hd-mark w/o spaces for references -.as hd*mark \ \ \" add spaces between mark and heading +.as hd*mark \ \ \&\" add spaces between mark and heading .if !\\n[hd*arg1] .ds hd*mark\" no mark for unnumbered .\" .if \\n[D]>1 .tm At header \\*[hd*mark] "\\$2" @@ -1015,7 +1015,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%] .if \\n[hd*level]<=\\n[Hb] .nr hd*htype 1 .if \\n[hd*level]<=\\n[Hs] .nr hd*htype 2 . \" two spaces if hd*htype == 0 -.ie (\\n[hd*htype]=0)&(\w@\\$2@) .ds hd*suf-space " \" +.ie (\\n[hd*htype]=0)&(\w@\\$2@) .ds hd*suf-space " \&\" protect space and its visibility .el .ds hd*suf-space .nr hd*need 2v \" hd*need = header need space .\"---------- user macro HX ------------ @@ -2598,8 +2598,8 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%] .ie \\n[Sectf] .ds lix*numb \\n[H1]-\\$3 .el .ds lix*numb \\$3 .\" -.ie !\\n[Of] .ds lix*ds-form .\ \ \" -.el .ds lix*ds-form "\ \(em\ \" +.ie !\\n[Of] .ds lix*ds-form .\ \ \&\" protect space and its visibility +.el .ds lix*ds-form "\ \(em\ \&\" protect space and its visibility .nr lix*in \\n[.i] .ds lix*label \\*[Li\\$1]\ \\*[lix*numb]\\*[lix*ds-form] .if !'\\$5'' \{\ diff --git a/contrib/mm/mse.tmac b/contrib/mm/mse.tmac index ae6677cc..e11c5a53 100644 --- a/contrib/mm/mse.tmac +++ b/contrib/mm/mse.tmac @@ -49,7 +49,7 @@ Please send bug reports with examples to bug-groff@gnu.org. .\" Mottagarens datum .ds LetMDAT Ert datum: .\" Bilaga -.ds LetBIL Bilaga \" +.ds LetBIL Bilaga \&\" Protect space and its visibility .\" Kompletteringsuppgift .ds LetKOMP .\" Dokumentbeteckning eller dokumentnummer diff --git a/contrib/pdfmark/spdf.tmac b/contrib/pdfmark/spdf.tmac index 511abe54..c1c91dd1 100644 --- a/contrib/pdfmark/spdf.tmac +++ b/contrib/pdfmark/spdf.tmac @@ -94,9 +94,9 @@ along with this program. If not, see . .pdfhref O \\n[nh*hl] "\\*(SN \\$*" .XS .if rtc*hl \{\ -. if !dXNVS1 .ds XNVS1 1.0v \" default leading for top level -. if !dXNVS2 .ds XNVS2 0.3v \" default leading at nesting increment -. if !dXNVS3 .ds XNVS3 0.6v \" default leading following nested group +. if !dXNVS1 .ds XNVS1 1.0v \&\" default leading for top level +. if !dXNVS2 .ds XNVS2 0.3v \&\" default leading at nesting increment +. if !dXNVS3 .ds XNVS3 0.6v \&\" default leading following nested group . if \\n[nh*hl]==1 \{\ . sp \\*[XNVS1] . nr tc*hl-max 1 diff --git a/tmac/cs.tmac b/tmac/cs.tmac index 3722378a..9819871e 100644 --- a/tmac/cs.tmac +++ b/tmac/cs.tmac @@ -65,7 +65,7 @@ .ds \*[locale]-letns!7 Separátní\" .ds \*[locale]-letns!8 Dopis\" .ds \*[locale]-letns!9 Zpráva\" -.ds \*[locale]-letns!copy Kopie \" (neodstraňovat mezeru)\" +.ds \*[locale]-letns!copy Kopie \&\" (neodstraňovat mezeru)\" .ds \*[locale]-letns!to " pro\" .ds \*[locale]-letrn Vzhldem k:\" .ds \*[locale]-letsa Do vlastních rukou:\" diff --git a/tmac/de.tmac b/tmac/de.tmac index adfd097b..70acc2b3 100644 --- a/tmac/de.tmac +++ b/tmac/de.tmac @@ -65,7 +65,7 @@ .ds \*[locale]-letns!7 Separat\" .ds \*[locale]-letns!8 Brief an\" .ds \*[locale]-letns!9 Bericht an\" -.ds \*[locale]-letns!copy Kopie \" don't remove the space!) +.ds \*[locale]-letns!copy Kopie \&\" don't remove the space!) .ds \*[locale]-letns!to " an\" .ds \*[locale]-letrn In Bezug auf:\" .ds \*[locale]-letsa An die zuständige Abteilung:\" diff --git a/tmac/doc.tmac-u b/tmac/doc.tmac-u index f172fd89..d49fd739 100644 --- a/tmac/doc.tmac-u +++ b/tmac/doc.tmac-u @@ -4296,14 +4296,14 @@ . nr doc-column-indent-width 0 . . ie (\$1 < 5) \ -. ds doc-str-dsct1 " \" +. ds doc-str-dsct1 " \&\" Protect space and its visibility . el \{\ . ie (\$1 == 5) \ -. ds doc-str-dsct1 " \" +. ds doc-str-dsct1 " \&\" Protect space and its visibility . el \{\ . \" XXX: this is packed abnormally close -- intercolumn width . \" should be configurable -. ds doc-str-dsct1 " \" +. ds doc-str-dsct1 " \&\" Protect space and its visibility . \}\} . . while (\n[doc-reg-dsct] <= \$1) \{\ diff --git a/tmac/fr.tmac b/tmac/fr.tmac index 17bdcc7e..c5dbaaa4 100644 --- a/tmac/fr.tmac +++ b/tmac/fr.tmac @@ -65,7 +65,7 @@ .ds \*[locale]-letns!7 Sous pli s\[e ']par\[e ']\" .ds \*[locale]-letns!8 Lettre \[a `]\" .ds \*[locale]-letns!9 Memorandum \[a `]\" -.ds \*[locale]-letns!copy Copie \" (il faut un espace)\" +.ds \*[locale]-letns!copy Copie \&\" (il faut un espace)\" .ds \*[locale]-letns!to " \[a `]\" .ds \*[locale]-letrn En r\[e ']f\[e ']rence \[a `]:\" .ds \*[locale]-letsa \[A `] la personne concern\[e ']e:\" diff --git a/tmac/pdfpic.tmac b/tmac/pdfpic.tmac index 0400c1cf..fd2b9f3c 100644 --- a/tmac/pdfpic.tmac +++ b/tmac/pdfpic.tmac @@ -32,14 +32,14 @@ . \" left-aligned? . ie '\\$1'-L' \{\ . nr pdf-offset-mode 1 -. if \\n[convert-pdf] .ds pspic-args \\$1 \" +. if \\n[convert-pdf] .ds pspic-args \\$1 \&\" Protect space and its visibility . shift . \} . el \{\ . \" right-aligned? . ie '\\$1'-R' \{\ . nr pdf-offset-mode 2 -. if \\n[convert-pdf] .ds pspic-args \\$1 \" +. if \\n[convert-pdf] .ds pspic-args \\$1 \&\" Protect space and its visibility . shift . \} . el \{\ @@ -47,13 +47,13 @@ . ie '\\$1'-I' \{\ . nr pdf-offset-mode 3 . nr pdf-offset (m;\\$2) -. if \\n[convert-pdf] .ds pspic-args \\$1 \\$2 \" +. if \\n[convert-pdf] .ds pspic-args \\$1 \\$2 \&\" Protect space and its visibility . shift 2 . \} . el \{\ . \" centered is the default . ie '\\$1'-C' \{\ -. if \\n[convert-pdf] .ds pspic-args \\$1 \" +. if \\n[convert-pdf] .ds pspic-args \\$1 \&\" Protect space and its visibility . shift . \} . el .nr pdf-offset-mode 0 diff --git a/tmac/ptx.tmac b/tmac/ptx.tmac index f8b0c03b..1659363c 100644 --- a/tmac/ptx.tmac +++ b/tmac/ptx.tmac @@ -10,9 +10,9 @@ .nr ptx-ref-pos (\n[.l] - .65i) .nr ptx-head-pos (\n[ptx-ref-pos] / 2) . -.ds ptx-sep-2 " \" -.ds ptx-sep-4 " \" -.ds ptx-sep-5 " \" +.ds ptx-sep-2 " \&\" Protect space and its visibility +.ds ptx-sep-4 " \&\" Protect space and its visibility +.ds ptx-sep-5 " \&\" Protect space and its visibility . . .de xx diff --git a/tmac/sv.tmac b/tmac/sv.tmac index e0b7805c..cbcb70ea 100644 --- a/tmac/sv.tmac +++ b/tmac/sv.tmac @@ -65,7 +65,7 @@ .ds \*[locale]-letns!7 Annat f\[o :]rs\[a :]ttsblad\" .ds \*[locale]-letns!8 Brev till\" .ds \*[locale]-letns!9 Dokument till\" -.ds \*[locale]-letns!copy Kopia \" space! +.ds \*[locale]-letns!copy Kopia \&\" space! .ds \*[locale]-letns!to " till\" .ds \*[locale]-letrn Refererande till:\" .ds \*[locale]-letsa Till vederb\[o :]rande:\" diff --git a/tmac/trace.tmac b/tmac/trace.tmac index fb0dd2f8..987b1617 100644 --- a/tmac/trace.tmac +++ b/tmac/trace.tmac @@ -48,7 +48,7 @@ .nr _C \n(.C .cp 0 . -.ds !!!sp " \" +.ds !!!sp " \&\" Protect space and its visibility . .de !!c .. @@ -131,7 +131,7 @@ . do ecs . ec . do tm1 "\*[!!!sp]*** .so \$* { -. do !!as !!!sp " \" +. do !!as !!!sp " \&\" Protect space and its visibility . do ecr . do !!so \$* . do ecs @@ -151,7 +151,7 @@ . do ecs . ec . do tm1 "\*[!!!sp]*** .mso \$* { -. do !!as !!!sp " \" +. do !!as !!!sp " \&\" Protect space and ist visibility . do ecr . do !!mso \$* . do ecs @@ -230,7 +230,7 @@ . el .do !!ds !!!br '\" . ie "\$1"\\$0" .do tm1 "\\*[!!!sp]*** de trace enter: \\*[!!!br]\\$0 \\$@ . el .do tm1 "\\*[!!!sp]*** de trace enter \$1: \\*[!!!br]\\$0 \\$@ -. do !!as !!!sp " \" +. do !!as !!!sp " \&\" Protect space and its visibility . . do nop \\*[!!\\$0]\\ . @@ -257,7 +257,7 @@ . el .!!ds !!!br '\" . ie "\$1"\\$0" .tm1 "\\*[!!!sp]*** de1 trace enter: \\*[!!!br]\\$0 \\$@ . el .tm1 "\\*[!!!sp]*** de1 trace enter \$1: \\*[!!!br]\\$0 \\$@ -. !!as !!!sp " \" +. !!as !!!sp " \&\" Protect space and its visibility . . nop \\*[!!\\$0]\\ . @@ -287,7 +287,7 @@ . el .do !!ds !!!br '\" . ie "\$1"\\$0" .do tm1 "\\*[!!!sp]*** am trace enter: \\*[!!!br]\\$0 \\$@ . el .do tm1 "\\*[!!!sp]*** am trace enter \$1: \\*[!!!br]\\$0 \\$@ -. do !!as !!!sp " \" +. do !!as !!!sp " \&\" Protect space and its visibility . . do nop \\*[!!\\$0]\\ . @@ -314,7 +314,7 @@ . el .!!ds !!!br '\" . ie "\$1"\\$0" .tm1 "\\*[!!!sp]*** am1 trace enter: \\*[!!!br]\\$0 \\$@ . el .tm1 "\\*[!!!sp]*** am1 trace enter \$1: \\*[!!!br]\\$0 \\$@ -. !!as !!!sp " \" +. !!as !!!sp " \&\" Protect space and its visibility . . nop \\*[!!\\$0]\\ . diff --git a/tmac/www.tmac.in b/tmac/www.tmac.in index d9a4d791..b60e1b90 100644 --- a/tmac/www.tmac.in +++ b/tmac/www.tmac.in @@ -240,7 +240,7 @@ following, HTML always denotes XHTML also. . if (\\n[.$] <= 0) \ . break . if '\\$1'space' \{\ -. as \\$0:s " \" +. as \\$0:s " \&\" Protect space and its visibility . shift . continue . \} @@ -983,15 +983,15 @@ following, HTML always denotes XHTML also. .\" -------------------------------------------------------------------- .\" auxiliary definitions for lists .\" -.ds www-ul-level1 \[bu]\ \ \" -.ds www-ul-level2 \[sq]\ \ \" -.ds www-ul-level3 \[ci]\ \ \" +.ds www-ul-level1 \[bu]\ \ \&\" Protect space and its visibility +.ds www-ul-level2 \[sq]\ \ \&\" Protect space and its visibility +.ds www-ul-level3 \[ci]\ \ \&\" Protect space and its visibility .nr www-ul-level 0 . .ds www-ol-level1 decimal\" .ds www-ol-level2 lower-alpha\" .ds www-ol-level3 lower-roman\" -.ds www-ol-tmp 00\ \ \" +.ds www-ol-tmp 00\ \ \&\" Protect space and its visibility .nr www-ol-ctr1 0 1 .nr www-ol-ctr2 0 1 .nr www-ol-ctr3 0 1 -- 2.17.0