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

拥有回忆 提交于 2019-12-13 02:00:50

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/2034814/is-it-possible-to-use-align-regexp-in-wdired-mode-emacs

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