Sorry; I sent the wrong patch. It needs to call `re-search-backward' with a non-nil, non-t 3rd arg: (re-search-backward regexp nil 'MOVE), not (re-search-backward regexp nil t). The attached patch should be OK.