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 29DE5429E33 for ; Fri, 13 Jul 2012 20:47:54 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled 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 gdqDqO7rL1Jq for ; Fri, 13 Jul 2012 20:47:53 -0700 (PDT) Received: from dmz-mailsec-scanner-2.mit.edu (DMZ-MAILSEC-SCANNER-2.MIT.EDU [18.9.25.13]) by olra.theworths.org (Postfix) with ESMTP id 948D1431FC3 for ; Fri, 13 Jul 2012 20:47:53 -0700 (PDT) X-AuditID: 1209190d-b7fd56d000000933-f2-5000ebe98422 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP id F4.99.02355.9EBE0005; Fri, 13 Jul 2012 23:47:53 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q6E3lqWH027226; Fri, 13 Jul 2012 23:47:52 -0400 Received: from drake.dyndns.org (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com [209.6.116.242]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q6E3lpNc022354 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Fri, 13 Jul 2012 23:47:52 -0400 (EDT) Received: from amthrax by drake.dyndns.org with local (Exim 4.77) (envelope-from ) id 1SptKh-0000ow-FK; Fri, 13 Jul 2012 23:47:51 -0400 From: Austin Clements To: notmuch@notmuchmail.org Subject: [PATCH] emacs: Make moving to the previous message move to the previous boundary Date: Fri, 13 Jul 2012 23:47:48 -0400 Message-Id: <1342237668-2489-1-git-send-email-amdragon@mit.edu> X-Mailer: git-send-email 1.7.10 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrMIsWRmVeSWpSXmKPExsUixG6nrvvyNUOAwduVXBar5/JYXL85k9mB yWPnrLvsHs9W3WIOYIrisklJzcksSy3St0vgyjiwWbbgHX/Fx9/bWBsYJ/B2MXJwSAiYSMye pNDFyAlkiklcuLeerYuRi0NIYB+jxPz9DYwQzgZGiTU/m6Ayj5gkts/dzQzhzGWUmL12DTtI P5uAhsS2/csZQWwRAWmJnXdns4LYzAKOEp/3L2IDsYUFIiXe/G5hBrFZBFQlZt5bBmbzCthL 7Ji8jgniDnmJp/f72CYw8i5gZFjFKJuSW6Wbm5iZU5yarFucnJiXl1qka6SXm1mil5pSuokR FBackrw7GN8dVDrEKMDBqMTDm+rPECDEmlhWXJl7iFGSg0lJlJf3FVCILyk/pTIjsTgjvqg0 J7X4EKMEB7OSCK95G1CONyWxsiq1KB8mJc3BoiTOeyXlpr+QQHpiSWp2ampBahFMVoaDQ0mC lxkY/kKCRanpqRVpmTklCGkmDk6Q4TxAw91AaniLCxJzizPTIfKnGBWlxHkLQRICIImM0jy4 XljcvmIUB3pFmDcDpIoHGPNw3a+ABjMBDZ71858/0OCSRISUVANjb7KiKM9RR8UHvGHtSa4b VD63FyWyPkyffHhl12G/sCecN6y+Vhk98dPln1AVHe21ykf8+i6B14u8Ex6qOrZ8kpr0SeW3 ae2qJ9tzRB682fyzgOnFH4YVr5n+b+qe2sZ/1d3vXr+/tKBP+Xrzl+uXPy/grpR+wXpXwn7f 5G4vkdD7GeVu6RJKLMUZiYZazEXFiQDDujJptgIAAA== 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: Sat, 14 Jul 2012 03:47:54 -0000 Previously, notmuch-show-previous-message would move to the beginning of the message before the message containing point. This patch makes it instead move to the previous message *boundary*. That is, if point isn't already at the beginning of the message, it moves to the beginning of the current message. This is consistent with notmuch-show-next-message, which can be thought of as moving to the next message boundary. Several people have expressed a preference for this. --- This patch accompanies the series in [0] (though they're independent and can be applied in either order). This makes the behavior of 'p' and 'P' in show-mode conceptually similar to the new behavior of 'p' in search-mode. [0] 1342140319-19859-1-git-send-email-amdragon@mit.edu emacs/notmuch-show.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 6335d45..02e319f 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -1525,9 +1525,11 @@ thread, navigate to the next thread in the parent search buffer." (goto-char (point-max))))) (defun notmuch-show-previous-message () - "Show the previous message." + "Show the previous message or the start of the current message." (interactive) - (notmuch-show-goto-message-previous) + (if (= (point) (notmuch-show-message-top)) + (notmuch-show-goto-message-previous) + (notmuch-show-move-to-message-top)) (notmuch-show-mark-read) (notmuch-show-message-adjust)) @@ -1587,7 +1589,9 @@ to show, nil otherwise." (defun notmuch-show-previous-open-message () "Show the previous open message." (interactive) - (while (and (notmuch-show-goto-message-previous) + (while (and (if (= (point) (notmuch-show-message-top)) + (notmuch-show-goto-message-previous) + (notmuch-show-move-to-message-top)) (not (notmuch-show-message-visible-p)))) (notmuch-show-mark-read) (notmuch-show-message-adjust)) -- 1.7.10