The better way to "x-out" macros in XPP style setups

I wanted to offer a better way to "x-out" macros in style setups.

Often when working with customer samples and composing them (or looking through the composition messages with View Log), I see lots of composition messages such as the following:

invalid xycode name (2) name = <xxmc;test;macro1;macro2>

It seems that many customers are in the habit of "x'ing out" macros in their style setups (by adding something like an "xx" prefix to the macro name) when they don't want them executed, but at the same time want them left "visible" when looking at the setup (probably in case they need to revisit the changes).

However, sometimes there are so many of these types of "error" messages that it's hard to pick out the significant composition errors. And when background queues are used to run many composition tasks, such "junk" error messages (en mass) can quickly cause queue log files to grow very large in size.

There's a better way to do this.

If you take a look at the xy_sys spec (in Lsyslib), you will see that the very first macro definition has a name of "__" (two underlines) and has an empty expansion. This definition was added years ago for use by import/export (toxsf/fromxsf) to "mark" non-XPP PI macros in the (SGML/XML) data on import so that they would be ignored by composition (and then on export the special "__ " prefix gets removed so that the data round-trips w/o any changes).

But this same mechanism can be used for macros within style setup that you want to be ignored (i.e. in xx and mx spec Expansion fields and in if spec Prestring, Poststring, and XML/SGML End fields).

So, for example, in an xx Expansion field instead of doing:

<xxmc;test;macro1;macro2>
<xxqa>

you would do:

<__;mc;test;macro1;macro2>
<__;qa>

You can also use this to do things like the following:

<__;/qa>
<mc;test;__(macro1);macro2> (as long as macro1 is not "skp" or "nul")
<mc;test;__(macro1,arg1,arg2),macro2>

The macro is still there, but by virtue of adding the "__" name it effectively gets ignored by composition (due to the empty expansion for the "__" macro) - and the bonus is that no "invalid xycode" error messages are output either. Now the composition error messages/logs are only filled with significant error messages.

Just to be clear, this suggestion is only in regards to the "style" setup within XPP; do not do this in the imported data (stream) itself.

Jonathan Dagresta
SDL XPP Engineering

Parents
  • I appreciate Chris mentioning an alternative; users are certainly free to define their own "ignore" macro.

    Just keep in mind that one advantage of using the "__" macro is that it is already defined in the standard XPP setup (in the xy_sys spec) and so, if you use "__" you do not have to worry about any potential future naming conflict with standard macro definitions that might get added to XPP. And it's just as easy to search for as well.

    Of course, XPP developers are not likely to add a standard macro named just "x" (or even "xx").  Wink

    Jonathan Dagresta
    SDL XPP Engineering

Reply
  • I appreciate Chris mentioning an alternative; users are certainly free to define their own "ignore" macro.

    Just keep in mind that one advantage of using the "__" macro is that it is already defined in the standard XPP setup (in the xy_sys spec) and so, if you use "__" you do not have to worry about any potential future naming conflict with standard macro definitions that might get added to XPP. And it's just as easy to search for as well.

    Of course, XPP developers are not likely to add a standard macro named just "x" (or even "xx").  Wink

    Jonathan Dagresta
    SDL XPP Engineering

Children
No Data