"If you have to run shell command from the text editor to format your code, why don't you run another one to save the file?.."
Perhaps a misunderstanding? But it is quite simple:
Alternatively you can run perltidy from the commandline. Then you must rename the resulting formatted file and reload the buffer (M-x revert-buffer).
IMHO applying the shell command (perltidy) on a region respectively running perltidy from within emacs is convinient - and the results look good.
Update:
The macro and the binding to F11:
(fset 'perltidy "\C-xh\C-[1\C-[|perltidy\C-m") (global-set-key [f11] 'perltidy)
Run it with F11 or M-x perltidy
Update2:
OK, on a Mac F11 isn't a good idea :-(
(global-set-key [f5] 'perltidy)
Best regards, Karl
P.S.: BTW, i think, many stuff posted on PM is formatted with perltidy, from within emacs or vim. See also
«The Crux of the Biscuit is the Apostrophe»
In reply to Re^2: Formatting Perl code with Emacs
by karlgoethebier
in thread Formatting Perl code with Emacs
by isntvoid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |