Skip to main content
    Country/region [select]      Terms of use
     Home      Products      Services & solutions      Support & downloads      My account     

IBM developerWorks
lol:> psychoanalyze-pinhead
e-mail it!
Related content:
More lol:>
Subscribe to the developerWorks newsletter
developerWorks Toolbox subscription
Our favorite Emacs commands

Doug Tidwell
Cyber Evangelist, IBM
April 9, 2002

We're pleased to present an installment of lol:> as part of our continuing effort to make dW your one-stop shop for technology information. (It's also part of our continuing effort to avoid doing real work.) We hope you enjoy it, let us know what you think.

Today we're discussing one of our favorite commands ever, the Emacs psychoanalyze-pinhead command. We'll discuss its components first (the doctor and yow commands), then dive right in to this delightful waste of time!


The doctor command is an implementation of the famous ELIZA program, originally written by Joseph Weizenbaum at MIT in 1966. It uses simple pattern recognition to mimic a Rogerian psychiatrist. When I ran the doctor command, here's part of the dialog between ELIZA and myself:

ELIZA: I am the psychotherapist.  Please, describe your problems.  Each time
       you are finished talking, type RET twice.

   Me: I feel strangely disassociated and emotionally distant.

ELIZA: Why do you say you feel strangely disassociated and emotionally

   Me: Because I can't seem to connect with anyone I care about.

ELIZA: Is it because you cannot seem to connect with anyone you care about
       that you came to me?

   Me: Yes.

ELIZA: I see...  Well, what makes you believe this is so?

And so it goes. What makes ELIZA so interesting is that if you imagine it as a chat session with an actual psychotherapist, it seems almost human. (Check out the Eliza effect in Eric Raymond's jargon file for more info.) On the other hand, if you type in complete nonsense, such as I feel strawberry moonbeams and had twelve for dessert, ELIZA takes that seriously as well.


Speaking of complete nonsense, let's move on to the next portion of our discussion. We mentioned the yow command earlier; this spouts quotes from the mind, such as it is, of Bill Griffith's cartoon character Zippy the Pinhead. (The most famous Zippyism is "Are we having FUN yet?", a phrase that's been added to the latest edition of Barlett's Famous Quotations.) Here are the results from some invocations of yow:

With YOU, I can BE MYSELF... We don't need DAN RATHER!

I was making donuts and now I'm on a bus!


Look into my eyes and try to forget that you have a Macy's charge card!

..The TENSION mounts as I MASSAGE your RIGHT ANKLE according to
 ancient Tibetan ACCOUNTING PROCEDURES..are you NEUROTIC yet??

Given the active imaginations and vast spare time of the Emacs community, it was only a matter of time that someone combined these two delightful pieces of code. That's where psychoanalyze-pinhead comes in. When you run this command, Emacs starts doctor, then uses yow to channel Zippyisms in response. This leads ELIZA to respond, which elicits further non sequiturs from Zippy, etc. Here's a small sampling of the output from psychoanalyze-pinhead:

ELIZA: I am the psychotherapist.  Please, describe your problems.  Each time
       you are finished talking, type RET twice.

Zippy: NEWARK has been REZONED!!  DES MOINES has been REZONED!!

ELIZA: Why do you say des moines has been rezoned?

Zippy: Clear the laundromat!!  This whirl-o-matic just had a nuclear meltdown!!

ELIZA: What makes you believe that?

Zippy: I was in EXCRUCIATING PAIN until I started reading JACK AND JILL

ELIZA: Perhaps you should consult a doctor of medicine, I am a psychiatrist.

Zippy: I'm EMOTIONAL now because I have MERCHANDISING CLOUT!!

ELIZA: Is it because you have merchandising clout that you came to me?

Zippy: I predict that by 1993 everyone will live in and around LAS VEGAS and
       wear BEATLE HAIRCUTS!

ELIZA: When did you first know that by 1993 everyone will live in and around
       las vegas and wear beatle haircuts?

Zippy: Yow!  Are you the self-frying president?

ELIZA: Earlier you said you have merchandising clout?

If you let the command run, it'll generate thousands of lines of text, useful for filling your hard drive and most of a lazy afternoon. Type Ctrl-G to stop it.

About the author
author This installment of lol:> was written by Doug Tidwell, who feels strangely disassociated and emotionally distant. Before he joined developerWorks, he was recognized internationally as a neurotic expert on ancient Tibetan accounting procedures. In 1998, he wrote and performed a one-man tribute to Tuesday Weld, a role that led to his current job as Cyber Evangelist for dW. When not riding the whirl-o-matic, he and his Beatles haircut live in and around Raleigh, North Carolina. You can reach him at

e-mail it!
What do you think of this document?
Killer! (5)Good stuff (4)So-so; not bad (3)Needs work (2)Lame! (1)


IBM developerWorks
  About IBM  |  Privacy  |  Terms of use  |  Contact