[m-rev.] new extras program

Zoltan Somogyi zoltan.somogyi at runbox.com
Sat Jul 9 21:18:27 AEST 2016


For my recent diff to the runtime, I used the attached program
to align the backslashes at the ends of macro definition lines
and the */ signs at the ends of /* */ comments.

Basically, it looks for blocks of lines that all end with the same string
(which is "\\" or "*/" in the two cases above), and pads those lines
with spaces before the pattern to make the patterns line up in the block.
It has options that allow the user to specify the minimum and maximum
column for the pattern. The minimum is to make different blocks align
visually if they wouldn't otherwise. The maximum is to prevent a single line
that exceeds the preferred page width from taking all the other lines
in its block over the page width as well.

I think it would be a good idea to add the program to the extras, but
I think it needs a better name, such as right_align, or right_align_block.
Any ideas?

I know it also needs more documentation; that will come after
the name.

Zoltan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: backslash_align.m
Type: text/x-objcsrc
Size: 13182 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20160709/ac3048f9/attachment.bin>


More information about the reviews mailing list