macros - 如何缩进 m4 宏中的文本 block

标签 macros m4

有没有一种好方法可以统一缩进 m4 宏中的文本 block ?换句话说,宏

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

生成

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

我希望有一种方法将整个文本 block 缩进到指定的数量。

最佳答案

怎么样patsubst :

patsubst(mytext,`^', ` ')

关于macros - 如何缩进 m4 宏中的文本 block ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29026753/

相关文章:

clojure - 在 Clojure 中的嵌套宏之间传递编译时状态

c++ - 一个宏,用于提取其输入文本的字符并使用它们生成代码

c - 如何将可变参数函数转换为宏?

m4 - M4 预处理器中的字符串长度

bash - m4_toupper 返回变量的空字符串

c++ - 这个c++宏在做什么?

c - 如何将可变参数函数调用作为宏定义?

xcode - aclocal/autoconf 报告 Mac OS X 上缺少 m4sugar.m4?

autotools - 用于 python2 和 python3 的 AM_PATH_PYTHON

makefile - autotools 生成的 tarball 的用户收到错误消息 : aclocal-1. 13:找不到命令