SPUG: perltidy HTML colorer

Michael R. Wolf MichaelRunningWolf at att.net
Wed Dec 26 13:49:39 CST 2001

Andrew Sweger <andrew at sweger.net> writes:

> Many editors provide the same service directly on the
> source code in questions. vi/vim/Nedit/etc.

I love the cperl-mode of gnu emacs [1].  Not only does it
color the code, but it provides many handy key binding to
leverage the 3 great virtues of a programmer (as defined in
the "Programming Perl" Glossary):

* laziness - The quality that makes you go to great effort
    to reduce overall energy expenditure.  It makes you
    write labor-saving programs that other people will find
    useful, and document what you wrote so you don't have to
    answer so many questions about it.  Hence, the first
    great virtue of a programmer.  Also hence, this
    book. See also impatience and hubris.

* impatience - The anger you feel when the computer is being
    lazy.  This makes you write programs that don't just
    react to your needs, but actually anticipate them.  Or
    at least that pretend to. Hence, the second great virtue
    of a programmer.  See also laziness and hubris.

* hubris - Excessive pride, the sort of thing Zeus zaps you
    for.  Also the quality that makes you write (and
    maintain) programs that other people won't want to say
    bad things about.  Hence, the third great virtue of a
    programmer.  See also laziness and impatience.

> Of course, they don't clean up your friend's code like
> perltidy does.

In emacs, it's easy to filter a region through an external
pipe.  The end result is that the code is reformatted
according to that outside process, perltidy in this case,
but it's also neat to use indent(1), cb(1), sort(1),
nroff(1), uniq(1), nl(1), etc.

> Very handy on code written by those freaks that use a
> single space indent. I know you're out there!

And even worse -- the no-space-newbies!!!  I *do* have
compassion for the _newbies_ (I'm a regular
reader/contributer to beginners at perl.org mailing list [2]),
but I dispise the style of some of their _code_.  A
cluttered style often indicates a cluttered brain.
Sometimes de-cluttering the code helps de-cluttering the
brain.  Often, the brain must lead.  And most frequently,
it's an iterative brain-code process.

Emacs - an afternoon to learn, a lifetime to master.


[1] http://www.gnu.org/software/emacs/emacs.html

[2] For help and a description of available commands, send a message to:
   <beginners-help at perl.org>

Michael R. Wolf
    All mammals learn by playing!
       MichaelRunningWolf at att.net

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/

More information about the spug-list mailing list