anchor.diff:     (t
       (error "Unknown event ~S received in DISTRIBUTE-EVENT" event))))
   
  +(defmacro with-port-locked ((port) &body body)
  +  (let ((fn (gensym "CONT.")))
  +    `(labels ((,fn ()
  +               ,@body))
  +      (declare (dynamic-extent #',fn))
  +      `(invoke-with-port-locked ,port #',fn))))
  +
  +(defmethod invoke-with-port-locked ((port basic-port) continuation)
  +  (with-recursive-lock-held ((port-lock port))
  +    (funcall continuation)))
  +
   (defun map-over-ports (function)
     (mapc function *all-ports*))
   
  -(defmethod restart-port ((port port))
  +(defmethod restart-port ((port basic-port))
     (reset-watcher port :restart)
     nil)
   
  -(defmethod destroy-port ((port port))
  +(defmethod destroy-port ((port basic-port))
     (reset-watcher port :destroy)
     (setf *all-ports* (remove port *all-ports*)))
   
  -(defmethod add-watcher ((port port) watcher)
  +(defmethod add-watcher ((port basic-port) watcher)
     (declare (ignore watcher))
     nil)
   
  -(defmethod delete-watcher ((port port) watcher)
  +(defmethod delete-watcher ((port basic-port) watcher)
     (declare (ignore watcher))
     nil)
   
  -(defmethod reset-watcher ((port port) how)
  +(defmethod reset-watcher ((port basic-port) how)
     (declare (ignore how))
     nil)
   
  -(defmethod make-graft ((port port) &key (orientation :default) (units :device))
  +(defmethod make-graft ((port basic-port) &key (orientation :default) (units :device))
     (let ((graft (make-instance 'graft
   		 :port port :mirror nil
   		 :orientation orientation :units units)))
       (push graft (port-grafts port))
       graft))
   
  -(defmethod make-medium ((port port) sheet)
  +#||
  +(defmethod make-medium ((port basic-port) sheet)
     (make-instance 'basic-medium :port port :graft (graft sheet) :sheet sheet))
  +||#
   
   ;;; Pixmap
   
  -(defmethod port-lookup-mirror ((port port) (pixmap pixmap))
  +(defmethod port-lookup-mirror ((port basic-port) (pixmap pixmap))
     (gethash pixmap (slot-value port 'pixmap->mirror)))
   
  -(defmethod port-lookup-pixmap ((port port) mirror)
  +(defmethod port-lookup-pixmap ((port basic-port) mirror)
     (gethash mirror (slot-value port 'mirror->pixmap)))
   
  -(defmethod port-register-mirror ((port port) (pixmap pixmap) mirror)
  +(defmethod port-register-mirror ((port basic-port) (pixmap pixmap) mirror)
     (setf (gethash pixmap (slot-value port 'pixmap->mirror)) mirror)
     (setf (gethash mirror (slot-value port 'mirror->pixmap)) pixmap)
     nil)
   
  -(defmethod port-unregister-mirror ((port port) (pixmap pixmap) mirror)
  +(defmethod port-unregister-mirror ((port basic-port) (pixmap pixmap) mirror)
     (remhash pixmap (slot-value port 'pixmap->mirror))
     (remhash mirror (slot-value port 'mirror->pixmap))
     nil)
   
  -(defmethod realize-mirror ((port port) (pixmap mirrored-pixmap))
  +(defmethod realize-mirror ((port basic-port) (pixmap mirrored-pixmap))
     (declare (ignorable port pixmap))
     (error "Don't know how to realize the mirror on a generic port"))
   
  -(defmethod destroy-mirror ((port port) (pixmap mirrored-pixmap))
  +(defmethod destroy-mirror ((port basic-port) (pixmap mirrored-pixmap))
     (declare (ignorable port pixmap))
     (error "Don't know how to destroy the mirror on a generic port"))
   
  -(defmethod port-allocate-pixmap ((port port) sheet width height)
  +(defmethod port-allocate-pixmap ((port basic-port) sheet width height)
     (declare (ignore sheet width height))
     (error "ALLOCATE-PIXMAP is not implemented for generic PORTs"))
   
  -(defmethod port-deallocate-pixmap ((port port) pixmap)
  +(defmethod port-deallocate-pixmap ((port basic-port) pixmap)
     (declare (ignore pixmap))
     (error "DEALLOCATE-PIXMAP is not implemented for generic PORTs"))
  
positive.code:    (keyboard-input-focus :initform nil
  			 :initarg :keyboard-input-focus
  			 :accessor port-keyboard-input-focus)
     )
    )
  
  (defun find-port (&key (server-path *default-server-path*))
    (loop for port in *all-ports*
  
negative.code: (defvar *all-ports* nil)
  
  (defclass port ()
    ()
    (:documentation
     "The protocol class that corresponds to a port."))
  
  (defclass basic-port (port)
    ((server-path :initform nil
  		:initarg :server-path
  		:reader port-server-path)
  