Inconsistent M-x align-regexp vs. C-u M-x align-regexp behaviour

半世苍凉 提交于 2019-12-18 17:06:43

问题


I've tried to write some new align rules for emacs and found this strange and inconsistent behaviour. Current buffer contents:

"some thing" like => this
   hello => world
and => again

After typing M-xalign-regexpRET[[:lower:]]+\(\s-+\)=>RET result looks as desired:

"some thing" like => this
             hello => world
             and => again

But after C-uM-xalign-regexpRET[[:lower:]]+\(\s-+\)=>RET1RET1RETyRET I get this instead:

"some thing" like => this
   hello          => world
and               => again

The same (wrong) thing happens if I put this into align-rules-list. How to fix this? I want to get the results like first.


回答1:


Nice question.

When you run commands in Emacs, keep in mind that interactive forms are pre-processing arguments for you.

To see what the function finally receives, press C-x ESC ESC

In this case, you'll see in the former case:

(align-regexp 1 57 "\\(\\s-*\\)[[:lower:]]+\\(\\s-+\\)=>" 1 1 nil)

and this in the latter

(align-regexp 1 57 "[[:lower:]]+\\(\\s-+\\)=>" 1 1 t)


来源:https://stackoverflow.com/questions/12974518/inconsistent-m-x-align-regexp-vs-c-u-m-x-align-regexp-behaviour

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!