[PATCH REBASE] emacs: add show view bindings to move to previous/next thread
authorJani Nikula <jani@nikula.org>
Thu, 2 May 2013 17:05:02 +0000 (20:05 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:54:34 +0000 (09:54 -0800)
eb/f9b2ab8be7dfc446f6724df29fb91daf90a0f4 [new file with mode: 0644]

diff --git a/eb/f9b2ab8be7dfc446f6724df29fb91daf90a0f4 b/eb/f9b2ab8be7dfc446f6724df29fb91daf90a0f4
new file mode 100644 (file)
index 0000000..cf407d6
--- /dev/null
@@ -0,0 +1,122 @@
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 3E3E3431FB6\r
+       for <notmuch@notmuchmail.org>; Thu,  2 May 2013 10:05:16 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id PTklB2Zthz0l for <notmuch@notmuchmail.org>;\r
+       Thu,  2 May 2013 10:05:10 -0700 (PDT)\r
+Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com\r
+       [209.85.217.175]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 7C051431FAF\r
+       for <notmuch@notmuchmail.org>; Thu,  2 May 2013 10:05:10 -0700 (PDT)\r
+Received: by mail-lb0-f175.google.com with SMTP id w20so744576lbh.6\r
+       for <notmuch@notmuchmail.org>; Thu, 02 May 2013 10:05:09 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=google.com; s=20120113;\r
+       h=x-received:from:to:cc:subject:date:message-id:x-mailer\r
+       :x-gm-message-state;\r
+       bh=o4cDO/8Uz8NDQkLVKyVHvUrwFmSMKnsf7vjCvoGL7EA=;\r
+       b=REnd15y0c6hrf+7gVWWWimTzHvToNQvBu/zEw035t9lHGMiqgtJHTf4STM80h3q60s\r
+       odecf7Fwf30USs4Q9VRnMsFxs4v1uj1v7eQwgzUVTL12SdGXv5W8IROku3pwjMH4qulX\r
+       Sd1wrY3YM64lfBtqwiCXj2yNrQF+QO5xAg/mwSXms5wmB2IHF9NPe9ltellTRzycOfLN\r
+       634Q7/5GCwdF+o7rVwMA934WVmY9FSKilYRs0ZI+F5cmcE3L4nce/rQ/UkUX9c8Aqogb\r
+       RS+3Cg82NpJLx1Z97FXBRjqJ6eDI77EG4krJKUtabIfj1Az0WbB/5QmDqv6s98zqBhQd\r
+       Ok9A==\r
+X-Received: by 10.152.4.40 with SMTP id h8mr2865267lah.34.1367514308886;\r
+       Thu, 02 May 2013 10:05:08 -0700 (PDT)\r
+Received: from localhost (dsl-hkibrasgw2-58c376-211.dhcp.inet.fi.\r
+       [88.195.118.211])\r
+       by mx.google.com with ESMTPSA id s1sm3079505lag.2.2013.05.02.10.05.06\r
+       for <multiple recipients>\r
+       (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+       Thu, 02 May 2013 10:05:07 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH REBASE] emacs: add show view bindings to move to previous/next\r
+       thread\r
+Date: Thu,  2 May 2013 20:05:02 +0300\r
+Message-Id: <1367514302-30196-1-git-send-email-jani@nikula.org>\r
+X-Mailer: git-send-email 1.7.10.4\r
+X-Gm-Message-State:\r
+ ALoCoQk6Hig7Fuv3MjqtcDJfrpQDz0Vdnpum2vOrnwNR0tTZGf+G4c8SpZSPubsc3jIKvxqQNca5\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 02 May 2013 17:05:16 -0000\r
+\r
+We have most of the plumbing in place, add the bindings M-n and M-p.\r
+---\r
+ emacs/notmuch-show.el |   24 ++++++++++++++++++++++++\r
+ 1 file changed, 24 insertions(+)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index face2a0..7f6ea65 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -39,6 +39,7 @@\r
\r
+ (declare-function notmuch-call-notmuch-process "notmuch" (&rest args))\r
+ (declare-function notmuch-search-next-thread "notmuch" nil)\r
++(declare-function notmuch-search-previous-thread "notmuch" nil)\r
+ (declare-function notmuch-search-show-thread "notmuch" nil)\r
\r
+ (defcustom notmuch-message-headers '("Subject" "To" "Cc" "Date")\r
+@@ -1267,6 +1268,8 @@ reset based on the original query."\r
+       (define-key map "P" 'notmuch-show-previous-message)\r
+       (define-key map "n" 'notmuch-show-next-open-message)\r
+       (define-key map "p" 'notmuch-show-previous-open-message)\r
++      (define-key map (kbd "M-n") 'notmuch-show-next-thread-show)\r
++      (define-key map (kbd "M-p") 'notmuch-show-previous-thread-show)\r
+       (define-key map (kbd "DEL") 'notmuch-show-rewind)\r
+       (define-key map " " 'notmuch-show-advance-and-archive)\r
+       (define-key map (kbd "M-RET") 'notmuch-show-open-or-close-all)\r
+@@ -1839,6 +1842,27 @@ argument, hide all of the messages."\r
+       (if show-next\r
+         (notmuch-search-show-thread)))))\r
\r
++(defun notmuch-show-previous-thread (&optional show-previous)\r
++  "Move to the next item in the search results, if any."\r
++  (interactive "P")\r
++  (let ((parent-buffer notmuch-show-parent-buffer))\r
++    (notmuch-kill-this-buffer)\r
++    (when (buffer-live-p parent-buffer)\r
++      (switch-to-buffer parent-buffer)\r
++      (notmuch-search-previous-thread)\r
++      (if show-previous\r
++        (notmuch-search-show-thread)))))\r
++\r
++(defun notmuch-show-next-thread-show ()\r
++  "Show the next thread in the search results, if any."\r
++  (interactive)\r
++  (notmuch-show-next-thread t))\r
++\r
++(defun notmuch-show-previous-thread-show ()\r
++  "Show the previous thread in the search results, if any."\r
++  (interactive)\r
++  (notmuch-show-previous-thread t))\r
++\r
+ (defun notmuch-show-archive-thread (&optional unarchive)\r
+   "Archive each message in thread.\r
\r
+-- \r
+1.7.10.4\r
+\r