From 7e267adc5e800230926788376db9207f39eb6f49 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Thu, 2 May 2013 20:05:02 +0300 Subject: [PATCH] [PATCH REBASE] emacs: add show view bindings to move to previous/next thread --- eb/f9b2ab8be7dfc446f6724df29fb91daf90a0f4 | 122 ++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 eb/f9b2ab8be7dfc446f6724df29fb91daf90a0f4 diff --git a/eb/f9b2ab8be7dfc446f6724df29fb91daf90a0f4 b/eb/f9b2ab8be7dfc446f6724df29fb91daf90a0f4 new file mode 100644 index 000000000..cf407d621 --- /dev/null +++ b/eb/f9b2ab8be7dfc446f6724df29fb91daf90a0f4 @@ -0,0 +1,122 @@ +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 3E3E3431FB6 + for ; Thu, 2 May 2013 10:05:16 -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 PTklB2Zthz0l for ; + Thu, 2 May 2013 10:05:10 -0700 (PDT) +Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com + [209.85.217.175]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 7C051431FAF + for ; Thu, 2 May 2013 10:05:10 -0700 (PDT) +Received: by mail-lb0-f175.google.com with SMTP id w20so744576lbh.6 + for ; Thu, 02 May 2013 10:05:09 -0700 (PDT) +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=o4cDO/8Uz8NDQkLVKyVHvUrwFmSMKnsf7vjCvoGL7EA=; + b=REnd15y0c6hrf+7gVWWWimTzHvToNQvBu/zEw035t9lHGMiqgtJHTf4STM80h3q60s + odecf7Fwf30USs4Q9VRnMsFxs4v1uj1v7eQwgzUVTL12SdGXv5W8IROku3pwjMH4qulX + Sd1wrY3YM64lfBtqwiCXj2yNrQF+QO5xAg/mwSXms5wmB2IHF9NPe9ltellTRzycOfLN + 634Q7/5GCwdF+o7rVwMA934WVmY9FSKilYRs0ZI+F5cmcE3L4nce/rQ/UkUX9c8Aqogb + RS+3Cg82NpJLx1Z97FXBRjqJ6eDI77EG4krJKUtabIfj1Az0WbB/5QmDqv6s98zqBhQd + Ok9A== +X-Received: by 10.152.4.40 with SMTP id h8mr2865267lah.34.1367514308886; + Thu, 02 May 2013 10:05:08 -0700 (PDT) +Received: from localhost (dsl-hkibrasgw2-58c376-211.dhcp.inet.fi. + [88.195.118.211]) + by mx.google.com with ESMTPSA id s1sm3079505lag.2.2013.05.02.10.05.06 + for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Thu, 02 May 2013 10:05:07 -0700 (PDT) +From: Jani Nikula +To: notmuch@notmuchmail.org +Subject: [PATCH REBASE] emacs: add show view bindings to move to previous/next + thread +Date: Thu, 2 May 2013 20:05:02 +0300 +Message-Id: <1367514302-30196-1-git-send-email-jani@nikula.org> +X-Mailer: git-send-email 1.7.10.4 +X-Gm-Message-State: + ALoCoQk6Hig7Fuv3MjqtcDJfrpQDz0Vdnpum2vOrnwNR0tTZGf+G4c8SpZSPubsc3jIKvxqQNca5 +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: Thu, 02 May 2013 17:05:16 -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 face2a0..7f6ea65 100644 +--- a/emacs/notmuch-show.el ++++ b/emacs/notmuch-show.el +@@ -39,6 +39,7 @@ + + (declare-function notmuch-call-notmuch-process "notmuch" (&rest args)) + (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") +@@ -1267,6 +1268,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) +@@ -1839,6 +1842,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 + -- 2.26.2