From: Carl Worth Date: Tue, 9 Mar 2010 16:11:45 +0000 (-0800) Subject: emacs: Fix backspace to not scroll more than the previous message X-Git-Tag: 0.1~70 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c5085642b8c6495ffea3d5709aa6da14cd1d8688;p=notmuch.git emacs: Fix backspace to not scroll more than the previous message The bug was occuring due to counting invisible lines, but then scrolling past them since they are invisible. --- diff --git a/notmuch.el b/notmuch.el index cd4d9963..c611dcc2 100644 --- a/notmuch.el +++ b/notmuch.el @@ -647,7 +647,13 @@ any effects from previous calls to (condition-case nil (scroll-down nil) ((beginning-of-buffer) nil)) - (goto-char (window-start))) + (goto-char (window-start)) + ; Because count-lines counts invivisible lines, we may have + ; scrolled to far. If so., notice this and fix it up. + (if (< (point) previous) + (progn + (goto-char previous) + (recenter 0)))) (notmuch-show-previous-message)))) (defun notmuch-show-advance-and-archive ()