bugGNU troff - Bugs: bug #51608, [PATCH] om.tmac-u: Fix some...

 
 

bug #51608: [PATCH] om.tmac-u: Fix some mistakes, fix one bug

Submitted by:  Bjarni Ingi Gislason <bjarniig>
Submitted on:  Fri 28 Jul 2017 09:38:08 PM UTC  
 
Category: Macro - momSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: G. Branden Robinson <gbranden>
Open/Closed: OpenPlanned Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Fri 03 Nov 2017 05:22:38 PM UTC, comment #7:

Thanks, Bjarni. I see what's causing the warnings.

All the undefnined macro warnings except END and BREAK_QUOTE are the result of aliases preceding the definition of the macros being aliased.

END is not a macro, but rather a macro closure argument (second argument to MAC, which is an alias of .de) used throughout. groff shouldn't be treating it as an undefined macro. Since it is, defining it as a blank macro is the only way to remove the warning.

BREAK_QUOTE is not used any more.

The undefined register #EN_Q_AUTOLEAD is the result of a missing backslash.

Rather than apply your patch, I've moved alias definitions to their correct locations, removed the aliases of BREAK_QUOTE, fixed the missing backslash, and defined END near the top of the file. I'll push the changes later today (2017-11-03) and mark this bug Fixed.

Peter Schaffter <PTPi>
Project Member
Fri 03 Nov 2017 03:59:54 AM UTC, comment #6:
Bjarni Ingi Gislason <bjarniig>
Fri 03 Nov 2017 12:04:21 AM UTC, comment #5:
Bjarni Ingi Gislason <bjarniig>
Thu 02 Nov 2017 05:15:54 PM UTC, comment #4:

Which warnings are you seeing? Also, I'm not sure what you mean by "import the mom macros by hand." Can you attach a file and give the command line invocation you're using?

Peter Schaffter <PTPi>
Project Member
Thu 02 Nov 2017 06:23:49 AM UTC, comment #3:

Thanks for the feedback, Peter!

I can reproduce these warnings if I prepare a simple document and import the mom macros "by hand", not messing with pdfroff and similar.

Is that no longer a valid use case for the mom macros? It seems to me like it still could be.

G. Branden Robinson <gbranden>
Project MemberIn charge of this item.
Wed 01 Nov 2017 06:27:54 PM UTC, comment #2:

That seems like it's asking for trouble; if anything ever dereferences the PDFHREF.VIEW.LEADING or PDHREF.VIEW.LEADING.H registers before redefining them, and if they do what their names suggest, the resulting text will be "set solid" with no interline spacing. Won't it?

PDFHREF.VIEW.LEADING controls the distance from the top of the PDF viewer window to the baseline of link targets. It has no effect on the formatting of the .pdf file itself. The register is set in pdf.tmac; the default is 5 points (5000u). There's no need for

There's no need to define the "undefined" macros/registers either since, after loading pdf.tmac and om.tmac, they are, in fact, defined. The assumption that pdf.tmac (Deri's re-write of Keith's pdfmark.tmac) is loaded is correct since pdf.tmac is loaded from troffrc when groff is called with -Tpdf.

The error "can't transparently output node at top level" may safely be ignored, which is documented.

Peter Schaffter <PTPi>
Project Member
Wed 01 Nov 2017 03:08:06 AM UTC, comment #1:

I've fixed all but a few of these problems; unfortunately the ones that remain are probably exactly the ones that got Bjarni's attention because they make groff spew warnings.

<pre>
@@ -221,6 +221,9 @@ end
.ds PDFHREF.TEXTCOL.DEFAULT 0.0 0.3 0.9
.nr PDFHREF.VIEW.LEADING.C 3i
.nr PDFHREF.VIEW.LEADING.T 1i
+.if !r PDFHREF.VIEW.LEADING \{\
+. nr PDFHREF.VIEW.LEADING 0
+.\}
.nr PDFHREF.VIEW.LEADING.H \n[PDFHREF.VIEW.LEADING]
\#
\# ====================================================================
</pre>

That seems like it's asking for trouble; if anything ever dereferences the PDFHREF.VIEW.LEADING or PDHREF.VIEW.LEADING.H registers before redefining them, and if they do what their names suggest, the resulting text will be "set solid" with no interline spacing. Won't it?

<pre>
@@ -264,6 +267,42 @@ end
.nr #L_MARGIN \n[.o] \" Tabs, etc require #L_MARGIN
.cflags 4 /\[en] \" So slash and en-dashes get broken
\#
+\# DEFINE UNDEFINED MACROS AND REGISTERS
+\#
+.if !d AUTO_RELOCATE_TOC \{\
+. de AUTO_RELOCATE_TOC
+. .
+.\}
+.
+.if !d BREAK_QUOTE \{\
+. de BREAK_QUOTE
+. .
+.\}
+.
+.if !d END \{\
+. de END
+. .
+.\}
+.
+.if !d INDENT_REFS \{\
+. de INDENT_REFS
+. .
+.\}
+.
+.if !d PDF_LINK_COLOR \{\
+. de PDF_LINK_COLOR
+. .
+.\}
+.
+.if !d pdfview \{\
+. de pdfview
+. .
+.\}
+.
+.if !r #EN_Q_AUTOLEAD \{\
+. nr #EN_Q_AUTOLEAD 0
+.\}
+\#
</pre>

I'd like to run these by Peter Schaffter. There seems to be some assumption that pdf.tmac or pdfmark.tmac will already be loaded.

G. Branden Robinson <gbranden>
Project MemberIn charge of this item.
Fri 28 Jul 2017 09:38:08 PM UTC, original submission:
Bjarni Ingi Gislason <bjarniig>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by PTPi (Posted a comment)
  • -unavailable- added by gbranden (Posted a comment)
  • -unavailable- added by bgarrigues (Updated the item)
  • -unavailable- added by bjarniig (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 03 Nov 2017 05:22:38 PM UTCPTPiStatusNeed Info=>Fixed
    Wed 01 Nov 2017 03:27:12 AM UTCgbrandenStatusNone=>Need Info
      Assigned toNone=>gbranden
    Fri 01 Sep 2017 07:30:06 PM UTCbgarriguesCategoryNone=>Macro - mom

    Back to the top


    Powered by Savane 3.1-cleanup1