[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Search]

Aligning code in columns



Hello everyone.

I was wondering whether there is some facility in Emacs/Emacspeak to align certain code chunks in columns. Let me describe a scenario that I'm thinking about. I work with Clojure and in my company we use a test framework called Midje. This framework has a feature called tabular tests which offers a syntax sugar to write unit tests that exercise the same function invocation with different inputs and outputs, by organizing them in a tabular structure. Follows an example:
(tabular (fact "about the function +"
(+ ?a ?b) => ?c)
?a ?b ?c
1 1 2
2 3 5
6 1 7)

This framework takes the forms that start with a question mark and substitutes them in the corresponding placeholders in the form under test. However, leaving Midje aside, sighted engineers are used to align the values in the rows of the "table" above in the same columns in order to obtain the visual aspect of a table. While this is totally irrelevant for blind developers, if possible I'd like to obtain the same behavior (if Emacs provides such facility out of the box) in order to make my code more readable for my sighted colleagues.

Let me know whether my question isn't clear enough.

Best regards.

Alan Ghelardi



|All Past Years |Current Year|


If you have questions about this archive or had problems using it, please contact us.

Contact Info Page