anchor.diff:      (setq *replace-after-string* after)
       (list before after)))
   
  -(defun query-replace-internal-body (cur-marker goal-marker before after)
  +(defun query-replace-internal-body (cur-point goal-point before after)
     (let ((pass-through nil))
       (loop
  -      (when (or (not (funcall *isearch-search-forward-function* cur-marker before))
  -                (and goal-marker (point< goal-marker cur-marker)))
  -        (when goal-marker
  -          (lem::move-point (current-point) goal-marker))
  +      (when (or (not (funcall *isearch-search-forward-function* cur-point before))
  +                (and goal-point (point< goal-point cur-point)))
  +        (when goal-point
  +          (lem::move-point (current-point) goal-point))
           (return))
  -      (lem::with-point ((end cur-marker))
  -        (isearch-update-buffer cur-marker before)
  -        (funcall *isearch-search-backward-function* cur-marker before)
  -        (lem::with-point ((start cur-marker))
  +      (lem::with-point ((end cur-point))
  +        (isearch-update-buffer cur-point before)
  +        (funcall *isearch-search-backward-function* cur-point before)
  +        (lem::with-point ((start cur-point))
             (loop :for c := (unless pass-through
                               (minibuf-read-char (format nil "Replace ~s with ~s" before after)))
                   :do (cond
                         ((or pass-through (char= c #\y))
                          (lem::delete-between-points start end)
  -                       (lem::insert-string-at cur-marker after)
  +                       (lem::insert-string-at cur-point after)
                          (return))
                         ((char= c #\n)
  -                       (lem::move-point cur-marker end)
  +                       (lem::move-point cur-point end)
                          (return))
                         ((char= c #\!)
                          (setf pass-through t)))))))))
  
positive.code:             (buffer (current-buffer)))
          (when (and before after)
            (if (buffer-mark-p buffer)
                (lem::with-point ((mark-marker (lem::buffer-mark buffer) :right-inserting))
                  (if (point< mark-marker (lem::buffer-point buffer))
                      (query-replace-internal-body mark-marker
                                                   (lem::buffer-point buffer)
                                                   before after)
                      (query-replace-internal-body (lem::buffer-point buffer)
                                                   mark-marker
                                                   before after)))
                (query-replace-internal-body (lem::buffer-point buffer)
                                             nil
  
negative.code: (define-command isearch-forward () ()
    (isearch-start
     "ISearch: "
     (lambda (point str)
       (search-forward (or (lem::character-offset point (- (length str)))
                           point)
                       str))
     #'search-forward
     #'search-backward
  