Bertrand --

On Sun, Jan 21, 2018, Bertrand Garrigues wrote:
> I've just pushed on the 'unique-version' branch a commit on the mom
> macro package to use the new .Y, could you please have a look?  I had to
> define a string (to use the .substring command) inside 2 macro, maybe it
> could be defined once a the begining of the macro package.

By coincidence, I just took care of the same thing in the master
branch om.tmac-u, for inclusion in my next commit.  You're right: the
(sub)string can be--should be--defined at the top of om.tmac and
checked for in .FAMILY and .FONT.

Patch attached.

-- 
Peter Schaffter
http://www.schaffter.ca
diff --git a/contrib/mom/om.tmac-u b/contrib/mom/om.tmac-u
index 072740e..96c06f3 100644
--- a/contrib/mom/om.tmac-u
+++ b/contrib/mom/om.tmac-u
@@ -58,6 +58,9 @@ extensions, and float management).
 .if dVERSION \{\
 .   ab [mom]: Version \*[version]
 .\}
+\# Groff revision
+.ds short_revision \n[.Y]
+.substring short_revision 0 0
 \#
 \# Add supplementary styles
 .sty \n[.fp] UL      \"  Ultra Light
@@ -552,8 +555,6 @@ end
 .       fam \\*[$TYPEWRITER_FAM]
 .       return
 .    \}
-.    .ds short_revision \\n[.Y]
-.    .substring short_revision 0 0
 .    if (\\n[.x]\\n[.y]\\*[short_revision] >= 1192) .ds $SAVED_STYLE \\n[.sty]
 .    ft 0
 .    fam \\*[$FAMILY]
@@ -594,8 +595,6 @@ end
 .    \}
 .    ft 0
 .    ft \\*[$FONT]
-.    .ds short_revision \\n[.Y]
-.    .substring short_revision 0 0
 .    if (\\n[.x]\\n[.y]\\*[short_revision] >= 1192) \{\
 .       if '\\n[.sty]'' \{\
 .          if !F\\n[.fn] \{\

Reply via email to