【发布时间】:2014-01-14 19:35:50
【问题描述】:
我尝试使用 align-regexp 对齐某些内容,但无法获得所需的行为。
这是我最初拥有的:
[21:26] <Luke-Jr> btcNeverSleeps: no
[21:26] <dmanderson> Not if it has to wait to make it into the block
[21:26] <btcNeverSleeps> Luke-Jr: can you develop a bit?
[21:26] <Luke-Jr> btcNeverSleeps: Bitcoin is a currency, not an authentication system
[21:26] <dmanderson> your user could be waiting a LONG time for 1 Satoshi to who up
[21:26] <Luke-Jr> btcNeverSleeps: you can use signed messages though
这就是我想要的:
[21:26] <Luke-Jr> btcNeverSleeps: no
[21:26] <dmanderson> Not if it has to wait to make it into the block
[21:26] <btcNeverSleeps> Luke-Jr: can you develop a bit?
[21:26] <Luke-Jr> btcNeverSleeps: Bitcoin is a currency, not an authentication system
[21:26] <dmanderson> your user could be waiting a LONG time for 1 Satoshi to who up
[21:26] <Luke-Jr> btcNeverSleeps: you can use signed messages though
这是我使用“align-rexegp RET > RET”得到的结果:(这不是我想要的)
[21:26] <Luke-Jr > btcNeverSleeps: no
[21:26] <dmanderson > Not if it has to wait to make it into the block
[21:26] <btcNeverSleeps > Luke-Jr: can you develop a bit?
[21:26] <Luke-Jr > btcNeverSleeps: Bitcoin is a currency, not an authentication system
[21:26] <dmanderson > your user could be waiting a LONG time for 1 Satoshi to who up
[21:26] <Luke-Jr > btcNeverSleeps: you can use signed messages though
我想用一个简单的align-regexp 来完成还是我应该研究更高级的东西? (例如,我知道我绝对可以使用宏来完成,但我首先想知道是否可以使用简单的正则表达式来完成)。
【问题讨论】:
-
我不知道 emacs 正则表达式例程。但是,您要查找的对齐需要对源进行完整解析,然后才能使用正确的对齐偏移写入新源。试试
<[^>]*>,不知道RET是什么。 -
@sln: 'RET' 只是 Emacs 文档中使用的一种约定,这里的意思是“此时按回车键”:)(您可以在其中一个答案中看到一些格式很好的内容下面)