]> git.cworth.org Git - notmuch/commit
emacs: replace use of hook to draw hl-line in search mode
authorDavid Bremner <david@tethera.net>
Sat, 10 Aug 2024 17:36:22 +0000 (14:36 -0300)
committerDavid Bremner <david@tethera.net>
Thu, 13 Mar 2025 10:48:53 +0000 (07:48 -0300)
commit5cb06b1893091cb069da990556e822c21a684acf
tree4a804623a81c7d16fd0e83cde5963a380f351d89
parenteb48d78758394c7241a1aa83a24cfd61e0a3c9fa
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.
emacs/notmuch.el
test/T312-emacs-hl-line.sh