#fix-#unfix
Enclosing portions of a config file within #fix-#unfix (alternate forms: #freeze-#unfreeze) preprocessor directives has the effect of fixing (freezing) those sections of the file, thereby preventing comment elimination and macro expansion. You can fix individual lines, stanzas, or even entire files in this way.
For example, in macros.cfg, you might use #fix-#unfix in this way:
// a filter to render, e.g., 'perl foo.pl' as simply 'foo.pl' in a ps display #fix zapinterpreters /bin/sed 's/.usr.bin.perl //' | /bin/sed 's/perl //' | /bin/sed\ 's/.usr.bin.python //' | /bin/sed 's/python //' | /bin/sed 's/.bin.bash //' | \/bin/sed 's/bash //' | /bin/sed 's/.bin.sh -c //' #unfixWithout the #fix-#unfix, the first '//' would be interpreted as a comment marker, and the line would process to:
zapinterpreters /bin/sed 's/.usr.bin.perlAs another example, we use PIKT as a content management system (CMS) for the PIKT Reference. In the PIKT configuration files for these web pages, we use #fix-#unfix retain the comment markers '//...', as in:
<pre> #fix /////////////////////////////////////////////////////////////////////////////// // // files_system_suse_linux_objects.cfg // /////////////////////////////////////////////////////////////////////////////// #unfix ... </pre>Without the #fix-#unfix, the file header above would be entirely commented out in the installed web page.
As a final example, in the spell_check_programs.cfg file, we suppress the commenting out in this Perl script line:
#fix $word =~ s/\s//g; # remove spaces #unfixWithout the #fix-#unfix, the installed script would have the line:
$word =~ s/\sNote that, instead of using #fix-#unfix, you could suppress commenting out by backslash escaping the '//':
$word =~ s/\s\/\/g; # remove spacesIn the first example above, dispensing with #fix-#unfix, one could instead do long lines of this:
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/...
In many cases, however, it is much cleaner, more readable, and more concise to use #fix-#unfix instead of the backslash escape.
(Note that in certain situations, one could also achieve the same effect of #fix-#unfix by means of the #verbatim directive.)
Refer to the Samples section for more examples.
prev page | 1st page | next page |