The previous version of
notmuch-show-imenu-prev-index-position-function was calling
notmuch-show-previous-message which was recentering the window. This
is a problem when which-func-mode is active because which-func-mode is
called each time the user moves point around.
Because this function is only meant to be executed by imenu, there is
no reason to recenter the window. For the same reason, the new
implementation doesn't have to follow strictly how
notmuch-show-previous-message is implemented because imenu only places
point at very specific locations before calling
notmuch-show-imenu-prev-index-position-function.