:type 'file
:group 'notmuch)
-(defcustom notmuch-search-hook '(notmuch-hl-line-mode)
+(defcustom notmuch-search-hook nil
"List of functions to call when notmuch displays the search results."
:type 'hook
- :options '(notmuch-hl-line-mode)
:group 'notmuch-search
:group 'notmuch-hooks)
(notmuch-sexp-parse-partial-list 'notmuch-search-append-result
results-buf))
(with-current-buffer results-buf
+ (when (and notmuch-hl-line
+ ;; If we know where the cursor will end up (from
+ ;; the call to notmuch-search), avoid redrawing the
+ ;; hl-line overlay until the buffer is sufficiently
+ ;; filled. This check is intended as an
+ ;; optimization to reduce flicker.
+ (>=
+ (line-number-at-pos (point-max) t)
+ (or notmuch-search-target-line -1)))
+ (notmuch-hl-line-mode))
(notmuch--search-hook-wrapper)))))
;;; Commands (and some helper functions used by them)
(line-number-at-pos (overlay-start hl-line-overlay)) 12))'
test_begin_subtest "line 12, search, refresh"
-test_subtest_known_broken
test_emacs_expect_t '(let ((notmuch-hl-line t))
(notmuch-search "tag:inbox")
(notmuch-test-wait)
(line-number-at-pos (overlay-start hl-line-overlay)) 12))'
test_begin_subtest "hl-line disabled, search"
-test_subtest_known_broken
test_emacs_expect_t '(let ((notmuch-hl-line nil))
(notmuch-search "tag:inbox")
(notmuch-test-wait)