anchor.diff:      (terpri (irc-connection irc))))
   
   (define-command eval (irc text)
  -  (declare (ignore irc))
  -  (format t "[eval] ~A~%" text)
  -  (eval (read-from-string text))
  -  (fresh-line))
  +  (let ((*standard-output* (display-pane irc)))
  +    (format t "[eval] ~A~%" text)
  +    (eval (read-from-string text))
  +    (fresh-line)))
   
   (define-command say (irc text)
  -  (when (and (irc-connection irc) (current-channel irc))
  -    (format t "[~A]<~A> ~A~%" (current-channel irc) (nickname irc) text)
  -    (send (irc-connection irc) "PRIVMSG ~A :~A~%"
  -          (current-channel irc) text)))
  +  (cond ((and (irc-connection irc) (current-channel irc))
  +         (format (display-pane irc) "[~A]<~A> ~A~%" (current-channel irc) (nickname irc) text)
  +         (send (irc-connection irc) "PRIVMSG ~A :~A~%"
  +               (current-channel irc) text))
  +        (t (error "Not connected or not joined to a channel."))))
   
   (define-command me (irc text)
  -  (when (and (irc-connection irc) (current-channel irc))
  -    (format t "[~A]* ~A ~A~%" (current-channel irc) (nickname irc) text)
  -    (send (irc-connection irc) "PRIVMSG ~A :~AACTION ~A~A~%"
  -          (current-channel irc) (code-char 1) text (code-char 1))))
  +  (cond ((and (irc-connection irc) (current-channel irc))
  +         (format (display-pane irc) "[~A]* ~A ~A~%" (current-channel irc) (nickname irc) text)
  +         (send (irc-connection irc) "PRIVMSG ~A :~AACTION ~A~A~%"
  +               (current-channel irc) (code-char 1) text (code-char 1)))
  +        (t (error "Not connected or not joined to a channel."))))
   
   (define-command nick (irc text)
  -  (format t "Changing nickname to ~A.~%" text)
  +  (format (display-pane irc) "~&Changing nickname to ~A.~%" text)
  +  ;; FIXME: Check status.
     (setf (nickname irc) text)
     (when (irc-connection irc)
       (send (irc-connection irc) "NICK ~A~%" (nickname irc))))
   
   (define-command connect (irc text)
     (cond ((not (nickname irc))
  -         (format t "Use /nick to set a nickname before connecting.~%"))
  +         (error "No nickname set. Use /nick to set a nickname before connecting."))
           ((irc-connection irc)
  -         (format t "Already connected.~%"))
  +         (error "Already connected to ~S." (irc-connection irc)))
           (t (multiple-value-bind (address port)
                  (resolve-server-name text)
  -             (setf (irc-connection irc) (sys.net::tcp-stream-connect address port))
  -             (sys.int::process-enable (irc-receive-process irc))
  +             (format (display-pane irc) "Connecting to ~A (~A:~A).~%" text address port)
  +             (setf (mezzanine.gui.widgets:frame-title (frame irc)) (format nil "IRC - ~A" text))
  +             (mezzanine.gui.widgets:draw-frame (frame irc))
  +             (mezzanine.gui.compositor:damage-window (window irc)
  +                                                     0 0
  +                                                     (mezzanine.gui.compositor:width (window irc))
  +                                                     (mezzanine.gui.compositor:height (window irc)))
  +             (setf (irc-connection irc) (sys.net::tcp-stream-connect address port)
  +                   (receive-thread irc) (mezzanine.supervisor:make-thread (lambda () (irc-receive irc))
  +                                                                          :name "IRC receive"))
                (send (irc-connection irc) "USER ~A hostname servername :~A~%" (nickname irc) (nickname irc))
                (send (irc-connection irc) "NICK ~A~%" (nickname irc))))))
   
   (define-command join (irc text)
  -  (if (find text (joined-channels irc) :test 'equal)
  -      (format t "Already joined to ~A.~%" text)
  -      (when (irc-connection irc)
  -        (send (irc-connection irc) "JOIN ~A~%" text)
  -        (push text (joined-channels irc))
  -        (unless (current-channel irc)
  -          (setf (current-channel irc) text)))))
  +  (cond ((find text (joined-channels irc) :test 'string-equal)
  +         (error "Already joined to channel ~A." text))
  +        ((irc-connection irc)
  +         (send (irc-connection irc) "JOIN ~A~%" text)
  +         (push text (joined-channels irc))
  +         (unless (current-channel irc)
  +           (setf (current-channel irc) text)))
  +        (t (error "Not connected."))))
   
   (define-command chan (irc text)
     (when (irc-connection irc)
  -    (if (find text (joined-channels irc) :test 'equal)
  +    (if (find text (joined-channels irc) :test 'string-equal)
           (setf (current-channel irc) text)
  -        (format t "Not joined to channel ~A." text))))
  +        (error "Not joined to channel ~A." text))))
   
   (define-command part (irc text)
     (when (and (irc-connection irc) (current-channel irc))
  
positive.code:     (values prefix command (nreverse parameters))))
  
  (defun parse-command (line)
    (let ((command-end nil)
          (rest-start nil)
          (rest-end nil))
      (dotimes (i (length line))
        (when (eql (char line i) #\Space)
          (setf command-end i
                rest-start i)
          (return)))
      (when rest-start
        ;; Eat leading spaces.
        (do () ((or (>= rest-start (length line))
                    (not (eql (char line rest-start) #\Space))))
          (incf rest-start)))
      (values (subseq line 1 command-end)
              (subseq line (or rest-start (length line)) rest-end))))
  
  (defun send (stream control-string &rest arguments)
    "Buffered FORMAT."
  
negative.code:            (declare (system:lambda-name (irc-command ,name)))
             ,@body)))
  
  (define-command quit (irc text)
    (when (irc-connection irc)
      (send (irc-connection irc) "QUIT :~A~%" text))
    (throw 'quit nil))
  
  (define-command raw (irc text)
    (when (irc-connection irc)
  