Subject: Re: bug#14742: 24.3.50; enhancement request: be able to prepend stuff from buffer when search backward

From: Stefan Monnier <[email-masked]>
Date: Fri, 05 Jul 2013 20:40:30 -0400

> then code for `isearch-allow-scroll' should be moved to a separate
> function like `isearch-handle-scroll-function' too.

That would be nice, as well, yes.

> But still I don't understand how this would be possible to handle
> outside of `isearch-other-meta-char', because this code changes the
> local variables `key', `keylist', `main-event', `move-command'
> locally bound in `isearch-other-meta-char'.

AFAICT, `move-command' is not used by the rest of the code, so `setq'ing
it is not needed.  For the other three, I guess you could do something
like

   +       ((let ((hmf (isearch-handle-motion-function <blabla>)))
   +          (when hmf (setq key (nth 0 hmf))
   +                    (setq keylist (nth 1 hmf))
   +                    (setq main-event (nth 2 hmf))
   +                    (nth 3 hmf))))

It's not super elegant, but the reason is the messed up data-flow, so at
least this formulation makes the mes more clear and self-evident.
Hopefully someone will find a way to clean it up at some point.

        Stefan