I saw this somewhere, but cannot find it now. Is there a built-in function in emacs, or does someone have elisp, to line up all the equals signs in a series of inititialization statments in cc-mode?
Before:
int t=9;
Graphics g = new Graphics();
List<String> list = new List<String>();
After:
int t = 9;
Graphics g = new Graphics();
List<String> list = new List<String>();
This is in response to harpo's comment to ShreevatsaR's answer:
Here's what I did to resolve that issue:
Use
M-x align-regexp
(here,M-x align-regexp RET = RET
). You can also add an "alignment rule" to the variablealign-rules-list
, so that in futureM-x align
will do it. See the documentation (C-h f align
) for details.M-x align should do the trick.