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 2934A431FAF for ; Fri, 1 Mar 2013 10:03:19 -0800 (PST) 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 hkt75wcD9HCu for ; Fri, 1 Mar 2013 10:03:18 -0800 (PST) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com [209.85.217.174]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 6E5CE431FAE for ; Fri, 1 Mar 2013 10:03:18 -0800 (PST) Received: by mail-lb0-f174.google.com with SMTP id l12so2455760lbo.19 for ; Fri, 01 Mar 2013 10:03:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=UH1hfgDTlrvuWfA8vi+oheRLjTCJOKhmlRvPag5zWdo=; b=J+RPHsb11/MNLQcO5DeDoKqilqfEVKZmFLk4g+QX9ebPavRXq8gTQ+39MiE18lY/Jw iPsikjBqEqIEDWTQ8nsAniEP59MURWtz4AmHK2oFBvoCQR0XamFwRIkjhkIbQlsZFdP7 UeZQUo3ItxhYD8LiEZHl0ZoMLNNtehIV5hUm1WKyMsADpvn8M9l9FcmPHJufcTlGREf0 hAUHfKnoo5eopXZG5DQLc8BkrDPcxgRreXFhjMWlS+QISscePyUL2PPLZWm9lOcw6fZc /pWs1hSDvo5P0bSly1hDfb6TSq+JdUB/O5qjrpO84NvxbhgUEuNxK/QTUk3k+GYyZy47 nonw== X-Received: by 10.112.17.166 with SMTP id p6mr1107282lbd.41.1362160995308; Fri, 01 Mar 2013 10:03:15 -0800 (PST) Received: from localhost (dsl-hkibrasgw4-50df51-27.dhcp.inet.fi. [80.223.81.27]) by mx.google.com with ESMTPS id k15sm4369710lbd.6.2013.03.01.10.03.13 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 01 Mar 2013 10:03:14 -0800 (PST) From: Jani Nikula To: notmuch@notmuchmail.org Subject: [PATCH] emacs: add show view bindings to move to previous/next thread Date: Fri, 1 Mar 2013 20:03:08 +0200 Message-Id: <1362160988-24697-1-git-send-email-jani@nikula.org> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQmob3VUoFT/ZLlZr2W9OmqB8WPXd0iz5lRe7CwVKqsyZihf2DEcBmhFmgQUcWinoNDKnBv8 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: Fri, 01 Mar 2013 18:03:19 -0000 We have most of the plumbing in place, add the bindings M-n and M-p. --- emacs/notmuch-show.el | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index acaef8e..4f2e8e0 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -40,6 +40,7 @@ (declare-function notmuch-call-notmuch-process "notmuch" (&rest args)) (declare-function notmuch-fontify-headers "notmuch" nil) (declare-function notmuch-search-next-thread "notmuch" nil) +(declare-function notmuch-search-previous-thread "notmuch" nil) (declare-function notmuch-search-show-thread "notmuch" nil) (defcustom notmuch-message-headers '("Subject" "To" "Cc" "Date") @@ -1270,6 +1271,8 @@ reset based on the original query." (define-key map "P" 'notmuch-show-previous-message) (define-key map "n" 'notmuch-show-next-open-message) (define-key map "p" 'notmuch-show-previous-open-message) + (define-key map (kbd "M-n") 'notmuch-show-next-thread-show) + (define-key map (kbd "M-p") 'notmuch-show-previous-thread-show) (define-key map (kbd "DEL") 'notmuch-show-rewind) (define-key map " " 'notmuch-show-advance-and-archive) (define-key map (kbd "M-RET") 'notmuch-show-open-or-close-all) @@ -1842,6 +1845,27 @@ argument, hide all of the messages." (if show-next (notmuch-search-show-thread))))) +(defun notmuch-show-previous-thread (&optional show-previous) + "Move to the next item in the search results, if any." + (interactive "P") + (let ((parent-buffer notmuch-show-parent-buffer)) + (notmuch-kill-this-buffer) + (when (buffer-live-p parent-buffer) + (switch-to-buffer parent-buffer) + (notmuch-search-previous-thread) + (if show-previous + (notmuch-search-show-thread))))) + +(defun notmuch-show-next-thread-show () + "Show the next thread in the search results, if any." + (interactive) + (notmuch-show-next-thread t)) + +(defun notmuch-show-previous-thread-show () + "Show the previous thread in the search results, if any." + (interactive) + (notmuch-show-previous-thread t)) + (defun notmuch-show-archive-thread (&optional unarchive) "Archive each message in thread. -- 1.7.10.4