About
perltidy in Emacs:
I'm not sure I understand, isn't that just a shell-command-on-region command after a mark-whole-buffer?
Yes, these are parts of the solution. The other parts are:
- Be able to restrict the perltidy-run to the current function, or the current region (i.e. avoid cosmetic changes in untouched places of the file which mess up VC history)
- Don't let .tdy and .ERR files mess up your source directories
- Present the source before and after tidying in an ediff session (with a bit of fine print like re-using an existing ediff session, so that you can re-run the command from within the ediff session, e.g. after accepting some changes)
...And indeed, indenting can be a mess. But it is improving. That's what I get with "hot" cperl-mode.el and PBP settings. The closing braces are under the first nonspace character of the line containing the opening braces, which I find ok.
Note the newline before the last semicolon. This indicates that this semicolon is a new statement (or superfluous)!
for my $x (@x) {
my %h = (
'truncate' => {
'desc' => 'shorten a file',
'usage' => [
'truncate FILEHANDLE,LENGTH',
'truncate EXPR,LENGTH',
]
}
);
}
;