I'm not sure this would work, because it's not always (isearch-repeat
'forward). For example with M-v it would be 'backward, regardless of
the current direction of the search. So I guess it means that another
symbol property would be necessary.
A function attached to a symbol could return its search direction.
Indeed, the definitions will be slightly longer, but still this is
better than defining new commands. So this could look like:
(put 'beginning-of-buffer 'isearch-match-scroll (lambda () (goto-char
(point-min))) 'forward)
(put 'end-of-buffer 'isearch-match-scroll (lambda () (goto-char (point-max))
'backward))
(put 'scroll-up-command 'isearch-match-scroll (lambda () (goto-char
(window-end)) 'forward))
(put 'scroll-down-command 'isearch-match-scroll (lambda () (goto-char
(window-start)) 'backward))