anchor.diff:     ;; Line position (eg (+ BUFFER-PTR CHARPOS)).  Indentations are stored in this form.
      ;; Total position if all on one line (eg (+ BUFFER-PTR BUFFER-OFFSET))
      ;;  Positions are stored in this form.
  -   (queue :initarg :queue :initform (make-array +queue-min-size+) :accessor queue)
  -   (qleft :initarg :qleft :initform nil :accessor qleft)
  -   (qright :initarg :qright :initform nil :accessor qright)
  +   (buffer :accessor buffer)
  +   (charpos :accessor charpos)
  +   (buffer-ptr :accessor buffer-ptr)
  +   (buffer-offset :accessor buffer-offset)
  +
      ;;This holds a queue of action descriptors.  QLEFT and QRIGHT
      ;;point to the next entry to dequeue and the last entry enqueued
      ;;respectively.  The queue is empty when
  
positive.code: (defconstant +suffix-min-size+ 256)
  
  (defclass xp-structure (sys.gray:fundamental-character-output-stream)
    ((base-stream :initarg :base-stream :initform nil :accessor base-stream) ;;The stream io eventually goes to.
     (linel :initarg :linel :initform nil :accessor linel) ;;The line length to use for formatting.
     (line-limit :initarg :line-limit :initform nil :accessor line-limit) ;;If non-NIL the max number of lines to print.
     (line-no :initarg :line-no :initform nil :accessor line-no) ;;number of next line to be printed.
     (char-mode :initarg :char-mode :initform nil :accessor char-mode) ;;NIL :UP :DOWN :CAP0 :CAP1 :CAPW
     (char-mode-counter :initarg :char-mode-counter :initform nil :accessor char-mode-counter) ;depth of nesting of ~(...~)
     (depth-in-blocks :initarg :depth-in-blocks :initform nil :accessor depth-in-blocks)
     ;;Number of logical blocks at QRIGHT that are started but not ended.
     (block-stack :initarg :block-stack :initform (make-array +block-stack-min-size+) :accessor block-stack)
     (block-stack-ptr :initarg :block-stack-ptr :initform nil :accessor block-stack-ptr)
     ;;This stack is pushed and popped in accordance with the way blocks are
     ;;nested at the moment they are entered into the queue.  It contains the
     ;;following block specific value.
     ;;SECTION-START total position where the section (see AIM-1102)
     ;;that is rightmost in the queue started.
     (buffer :initarg :buffer :initform (make-array +buffer-min-size+ :element-type 'character) :accessor buffer)
     (charpos :initarg :charpos :initform nil :accessor charpos)
     (buffer-ptr :initarg :buffer-ptr :initform nil :accessor buffer-ptr)
     (buffer-offset :initarg :buffer-offset :initform nil :accessor buffer-offset)
     ;;This is a vector of characters (eg a string) that builds up the
     ;;line images that will be printed out.  BUFFER-PTR is the
     ;;buffer position where the next character should be inserted in
  
negative.code:         (T stream)))
  
  (defun do-xp-printing (fn stream args)
    (let ((xp (make-instance 'xp-structure :base-stream stream))
          (*current-level* 0)
          (result nil))
      (catch 'line-limit-abbreviation-exit
  