b) Can lineup vertically "middles" of rows, like '=' in
a = b;
cc = d;
Great! Now how is this done?
I tried using cperl-lineup on a marked region, but that wasn't it.
(defun perltidy-region ()
"Run perltidy on the current region."
(interactive)
(save-excursion
(shell-command-on-region (point) (mark) "perltidy -q" nil t)))
(global-set-key "\M-t" `perltidy-region)
Then I just mark a region and hit alt-t to pretty it up. I also have a binding to allow me to perltidy the whole file.
-sam
cperl-linup is the correct function, but you have to use it carefully. The mark must be at the character that you wish to line up (hit C-space while on the first "="). Then go to the end of the region and execute cperl-lineup (C-M-| by default I believe).
Good Day,
Dean
It's probably a useful idea to set align-indent-before-aligning t (true) before using align-regexp, otherwise it may muck up the code indentation.
emc
" When in doubt, use brute force." — Ken Thompsonperlmonks.org content © perlmonks.org and duelafn, Roscoe, samtregar, superfrink, swampyankee
prlmnks.org © 2006 edmund von der burg (eccles & toad)
v 0.03