SPUG: tidy in 3 flavors; Perl, HTML, JavaScript

Bill Campbell bill at celestial.com
Thu Oct 5 13:53:51 PDT 2006

On Thu, Oct 05, 2006, Itay Furman wrote:
>On Thu, 5 Oct 2006, Michael R. Wolf wrote:
>> When _I_ *write* code, I use emacs' built-in cperl-mode, html-mode, and
>> java-mode.   I'm mostly happy with them -- they're right there under my
>> finger tips, and they happen automagically.
>> But this is a *rewrite* (or reformat) job, and I'm lazy (one of 3 virtues).
>> I don't want to fat-finger all the code in emacs.
>In emacs: marking the whole buffer, or some region, and then
> 	'M-x ident-region'
>does save me a lot of work.  (After making sure I'm in 
>cperl-mode, or whatever appropriate mode.)
>There might be some mode-specific functions but I don't remeber 
>for sure -- I always use the above.

Cleaning up code like this may well cause more problems than it solves if
one has to incorporate updates from a third party as it can render
``patch'' worthless.

I've ofen used ``indent'' to clean up third party C code so that I can
figure out the program logic.  Once I've figured out what's going on, I'll
make changes in the original so diff and patch are useful with outside

IHMO Stallman standards and emacs tends to create C code that look OK in
emacs, but is incomprehensible with a sensible editor like vi :-).

INTERNET:   bill at Celestial.COM  Bill Campbell; Celestial Systems, Inc.
UUCP:               camco!bill  PO Box 820; 6641 E. Mercer Way
FAX:            (206) 232-9186  Mercer Island, WA 98040-0820; (206) 236-1676
URL: http://www.celestial.com/

When you have an efficient government, you have a dictatorship.
                -- Harry Truman

More information about the spug-list mailing list