It is the right square bracket in the prompt. Try
(add-hook 'inferior-scheme-mode-hook
(lambda () (setq defun-prompt-regexp "^.*>?")))
> It is the right square bracket in the prompt. Try
>
> (add-hook 'inferior-scheme-mode-hook
> (lambda () (setq defun-prompt-regexp "^.*>?")))
I meant "^.*>+", not "^.*>?", but the former does not work. It needs
to match any whitespace after the ">". It is a bit loose too.
"^[^>]*>+\\s-*" is probably best, and seems to work. Thus:
(add-hook 'inferior-scheme-mode-hook
(lambda () (setq defun-prompt-regexp "^[^>]*>+\\s-*")))