How to indent a block of text in an m4 macro

2019-07-24 17:26发布

问题:

Is there a good way to uniformly indent a block of text in an m4 macro? In other words, the macro

define(`mytext',dnl
This is
a
piece of text
that I would like
to indent)
mytext

generates

This is
a
piece of text
that I would like
to indent

I'd like to have a way to indent the whole block of text to a specified amount.

回答1:

How about patsubst:

patsubst(mytext,`^', ` ')


标签: macros m4