From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id EE8B0421189 for ; Tue, 17 Jan 2012 10:05:46 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.3 X-Spam-Level: X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_MED=-2.3] 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 Fq85mL1sQcK2 for ; Tue, 17 Jan 2012 10:05:46 -0800 (PST) Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu [131.215.239.19]) by olra.theworths.org (Postfix) with ESMTP id 9D1C241ED8A for ; Tue, 17 Jan 2012 10:05:37 -0800 (PST) Received: from fire-doxen.imss.caltech.edu (localhost [127.0.0.1]) by fire-doxen-postvirus (Postfix) with ESMTP id 558932E50D05 for ; Tue, 17 Jan 2012 10:05:37 -0800 (PST) X-Spam-Scanned: at Caltech-IMSS on fire-doxen by amavisd-new Received: from finestructure.net (cpe-76-174-137-84.socal.res.rr.com [76.174.137.84]) (Authenticated sender: jrollins) by fire-doxen-submit (Postfix) with ESMTP id 99637328024 for ; Tue, 17 Jan 2012 10:05:32 -0800 (PST) Received: by finestructure.net (Postfix, from userid 1000) id EC3C353F; Tue, 17 Jan 2012 10:05:31 -0800 (PST) From: Jameson Graef Rollins To: Notmuch Mail Subject: [PATCH 4/6] emacs: add option to notmuch-show-next-open-message to pop out to parent buffer if at end Date: Tue, 17 Jan 2012 10:05:29 -0800 Message-Id: <1326823531-14549-4-git-send-email-jrollins@finestructure.net> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1326823531-14549-3-git-send-email-jrollins@finestructure.net> References: <871uqy19yo.fsf@servo.finestructure.net> <1326823531-14549-1-git-send-email-jrollins@finestructure.net> <1326823531-14549-2-git-send-email-jrollins@finestructure.net> <1326823531-14549-3-git-send-email-jrollins@finestructure.net> 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: Tue, 17 Jan 2012 18:05:47 -0000 This will allow for keybindings that achieve a smoother message processing flow by reducing the number of key presses needed for most common operations. --- emacs/notmuch-show.el | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 207949c..6b2e6e9 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -1270,17 +1270,23 @@ any effects from previous calls to (notmuch-show-mark-read) (notmuch-show-message-adjust)) -(defun notmuch-show-next-open-message () +(defun notmuch-show-next-open-message (&optional pop-at-end) "Show the next message." (interactive) - (let (r) + (let ((r) + (parent-buffer notmuch-show-parent-buffer)) (while (and (setq r (notmuch-show-goto-message-next)) (not (notmuch-show-message-visible-p)))) (if r (progn (notmuch-show-mark-read) (notmuch-show-message-adjust)) - (goto-char (point-max))))) + (if (and parent-buffer pop-at-end) + (progn + (kill-this-buffer) + (switch-to-buffer parent-buffer) + (forward-line 1)) + (goto-char (point-max)))))) (defun notmuch-show-previous-open-message () "Show the previous message." -- 1.7.7.3