开发者

Is it possible to use align-regexp in wdired mode (Emacs)?

开发者 https://www.devze.com 2022-12-15 18:55 出处:网络
Is it possible to use align-regexp in wdired mode (Emacs)? I want to align folder names that contain a space after the first word.

Is it possible to use align-regexp in wdired mode (Emacs)?

I want to align folder names that contain a space after the first word.

So:

folder1xxx xxxxx
folder2xx xxxxxx
folder3xxxx xxxxx

开发者_如何转开发where x can be any alphanumeric character, should become something like this:

folder1xxx  xxxxx
folder2xx   xxxxxx
folder3xxxx xxxxx

As of now I only get a 'Text is read-only' message, because not the whole buffer is editable.

Thanks.


A possibility is to select the filenames by putting the mark on the first "f" and point on the last "x", C-x r k (kill-rectangle), go to a temp buffer, C-x r y (yank-rectangle), do the align-regexp there, and then kill/yank rectangle back to the wdired buffer.

More about rectangles here.

0

精彩评论

暂无评论...
验证码 换一张
取 消