Mx align-regexp与Cu Mx align-regexp行为不一致

abb*_*bot 6 emacs elisp alignment

我试图为emacs编写一些新的对齐规则,并发现这种奇怪且不一致的行为.当前缓冲内容:

"some thing" like => this
   hello => world
and => again
Run Code Online (Sandbox Code Playgroud)

输入M-xalign-regexpRET[[:lower:]]+\(\s-+\)=>RET结果后看起来像所需:

"some thing" like => this
             hello => world
             and => again
Run Code Online (Sandbox Code Playgroud)

但在C-uM-xalign-regexpRET[[:lower:]]+\(\s-+\)=>RET1RET1RETyRET我得到这个之后:

"some thing" like => this
   hello          => world
and               => again
Run Code Online (Sandbox Code Playgroud)

如果我把它放进去,就会发生同样的(错误的)事情align-rules-list.如何解决这个问题?我想先得到结果.

eve*_*_jr 7

好问题.

在Emacs中运行命令时,请记住交互式表单是为您预处理的参数.

要查看最终收到的功能,请按C-x ESC ESC

在这种情况下,您将在前一种情况下看到:

(align-regexp 1 57 "\\(\\s-*\\)[[:lower:]]+\\(\\s-+\\)=>" 1 1 nil)
Run Code Online (Sandbox Code Playgroud)

这在后者

(align-regexp 1 57 "[[:lower:]]+\\(\\s-+\\)=>" 1 1 t)
Run Code Online (Sandbox Code Playgroud)