Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id B05C84196F0 for ; Mon, 26 Apr 2010 07:53:51 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] autolearn=ham Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7RfcfU0-SFOW for ; Mon, 26 Apr 2010 07:53:50 -0700 (PDT) Received: from mail-fx0-f53.google.com (mail-fx0-f53.google.com [209.85.161.53]) by olra.theworths.org (Postfix) with ESMTP id 8A2CB431FC1 for ; Mon, 26 Apr 2010 07:53:50 -0700 (PDT) Received: by fxm1 with SMTP id 1so201677fxm.26 for ; Mon, 26 Apr 2010 07:53:49 -0700 (PDT) Received: by 10.86.126.33 with SMTP id y33mr7634650fgc.51.1272293625013; Mon, 26 Apr 2010 07:53:45 -0700 (PDT) Received: from ut.hh.sledj.net (host83-217-165-81.dsl.vispa.com [83.217.165.81]) by mx.google.com with ESMTPS id 2sm323158faf.15.2010.04.26.07.53.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 26 Apr 2010 07:53:43 -0700 (PDT) Received: by ut.hh.sledj.net (Postfix, from userid 1000) id 9771859413B; Mon, 26 Apr 2010 15:53:53 +0100 (BST) From: dme@dme.org To: notmuch@notmuchmail.org Subject: [PATCH] emacs: Fix `notmuch-show-rewind' in the presence of invisible text Date: Mon, 26 Apr 2010 15:53:52 +0100 Message-Id: <1272293632-15715-1-git-send-email-dme@dme.org> X-Mailer: git-send-email 1.7.0 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2010 14:53:51 -0000 From: David Edmondson When determining whether or not to re-align the head of the current message with the top of the window, use `count-screen-lines' rather than `count-lines' to allow for invisible text in the preceding message. When comparing that number of lines against `next-screen-context-lines', realign if the number of lines of the previous message visible is 'smaller than or equal to' rather than just 'smaller than' to improve usability. --- emacs/notmuch-show.el | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index f5de8ae..eb5335f 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -833,8 +833,8 @@ any effects from previous calls to ;; If a small number of lines from the previous message are ;; visible, realign so that the top of the current message is at ;; the top of the screen. - (if (< (count-lines (window-start) (notmuch-show-message-top)) - next-screen-context-lines) + (if (<= (count-screen-lines (window-start) start-of-message) + next-screen-context-lines) (progn (goto-char (notmuch-show-message-top)) (notmuch-show-message-adjust))) -- 1.7.0