+(put 'beginning-of-buffer 'isearch-match-scroll 'isearch-beginning-of-buffer)
+(put 'end-of-buffer 'isearch-match-scroll 'isearch-end-of-buffer)
+(put 'scroll-up-command 'isearch-match-scroll 'isearch-scroll-up)
+(put 'scroll-down-command 'isearch-match-scroll 'isearch-scroll-down)
...
+ ((and isearch-allow-match-scroll
+ (symbolp this-command)
+ (get this-command 'isearch-match-scroll))
+ (setq this-command (get this-command 'isearch-match-scroll)))
As noted in another message, this is basically the same as:
(define-key isearch-mode-map [remap beginning-of-buffer]
'isearch-beginning-of-buffer)
(define-key isearch-mode-map [remap end-of-buffer] 'isearch-end-of-buffer)
(define-key isearch-mode-map [remap scroll-up-command] 'isearch-scroll-up)
(define-key isearch-mode-map [remap scroll-down-command] 'isearch-scroll-down)