登錄站點

用戶名

密碼

How to get Emacs to unwrap a block of code

已有 199 次閱讀  2013-01-24 22:11   標籤Cheap  Oakley 
How to get Emacs to unwrap a block of code

In this case I would use a macro. You can start recording a macro with C-x (, and stop recording it with C-x ). When you want to replay the macro type C-x e.

In this case, I would type,Cheap Oakley Antix Sunglasses White Frame Purple Lens, C-a C-x ( C-s v a l u e C-f C-f \ RET SPC SPC SPC SPC C-x )

That would record a macro that searches for "value", moves forward 2,Cheap Oakley Batwolf Sunglasses Black Frame Yellow Lens, inserts a slash and newline,Cheap Oakley Batwolf Sunglasses pink Frame blue Lens, and finally spaces the new line over to line up. Then you could repeat this macro a few times.

EDIT: I just realized, your literal text may not be as easy to search as "value1". You could also search for spaces and cycle through the hits. For example, hitting, C-s a few times after the first match to skip over some of the matches,Cheap Oakley Sunglasses New Arrival 247.

Note: Since your example is "ad-hoc" this solution will be too. Often you use macros when you need an ad-hoc solution. One way to make the macro apply more consistently is to put the original statement all on one line (can also be done by a macro or manually). Related articles:
分享 舉報