emacs: replace use of hook to draw hl-line in search mode
In the thread at id:87fsfuuxwn.fsf@thinkbox, a bug is discussed where
the point and hl-line overlay get out of sync, leading the user to
open the wrong message. As far as I can tell this is caused by
notmuch-hl-mode being invoked too early.
This change bypasses the logic preventing notmuch-search-hook being
called only once, so that the overlay is updated later after the
buffer is full(er).
This change may lead to the overlay being updated multiple times; if
this is annoying we can add a similar buffer local variable to ensure
it is only called once.
The extra logic to check notmuch-search-target-line reduces the
flicker somewhat by not highlighting the first line every time.