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',
]
}
);
}
;
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.