[PATCH] emacs: add show view bindings to move to previous/next thread
authorJani Nikula <jani@nikula.org>
Fri, 1 Mar 2013 18:03:08 +0000 (20:03 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:53:48 +0000 (09:53 -0800)
29/d861da93ae1d84a3250b0a430fc097028ce42e [new file with mode: 0644]

diff --git a/29/d861da93ae1d84a3250b0a430fc097028ce42e b/29/d861da93ae1d84a3250b0a430fc097028ce42e
new file mode 100644 (file)
index 0000000..cf8a4d5
--- /dev/null
@@ -0,0 +1,120 @@
+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 2934A431FAF\r
+       for <notmuch@notmuchmail.org>; Fri,  1 Mar 2013 10:03:19 -0800 (PST)\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 hkt75wcD9HCu for <notmuch@notmuchmail.org>;\r
+       Fri,  1 Mar 2013 10:03:18 -0800 (PST)\r
+Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com\r
+       [209.85.217.174]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 6E5CE431FAE\r
+       for <notmuch@notmuchmail.org>; Fri,  1 Mar 2013 10:03:18 -0800 (PST)\r
+Received: by mail-lb0-f174.google.com with SMTP id l12so2455760lbo.19\r
+       for <notmuch@notmuchmail.org>; Fri, 01 Mar 2013 10:03:15 -0800 (PST)\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=UH1hfgDTlrvuWfA8vi+oheRLjTCJOKhmlRvPag5zWdo=;\r
+       b=J+RPHsb11/MNLQcO5DeDoKqilqfEVKZmFLk4g+QX9ebPavRXq8gTQ+39MiE18lY/Jw\r
+       iPsikjBqEqIEDWTQ8nsAniEP59MURWtz4AmHK2oFBvoCQR0XamFwRIkjhkIbQlsZFdP7\r
+       UeZQUo3ItxhYD8LiEZHl0ZoMLNNtehIV5hUm1WKyMsADpvn8M9l9FcmPHJufcTlGREf0\r
+       hAUHfKnoo5eopXZG5DQLc8BkrDPcxgRreXFhjMWlS+QISscePyUL2PPLZWm9lOcw6fZc\r
+       /pWs1hSDvo5P0bSly1hDfb6TSq+JdUB/O5qjrpO84NvxbhgUEuNxK/QTUk3k+GYyZy47\r
+       nonw==\r
+X-Received: by 10.112.17.166 with SMTP id p6mr1107282lbd.41.1362160995308;\r
+       Fri, 01 Mar 2013 10:03:15 -0800 (PST)\r
+Received: from localhost (dsl-hkibrasgw4-50df51-27.dhcp.inet.fi.\r
+       [80.223.81.27])\r
+       by mx.google.com with ESMTPS id k15sm4369710lbd.6.2013.03.01.10.03.13\r
+       (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+       Fri, 01 Mar 2013 10:03:14 -0800 (PST)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] emacs: add show view bindings to move to previous/next thread\r
+Date: Fri,  1 Mar 2013 20:03:08 +0200\r
+Message-Id: <1362160988-24697-1-git-send-email-jani@nikula.org>\r
+X-Mailer: git-send-email 1.7.10.4\r
+X-Gm-Message-State:\r
+ ALoCoQmob3VUoFT/ZLlZr2W9OmqB8WPXd0iz5lRe7CwVKqsyZihf2DEcBmhFmgQUcWinoNDKnBv8\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: Fri, 01 Mar 2013 18:03:19 -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 acaef8e..4f2e8e0 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -40,6 +40,7 @@\r
+ (declare-function notmuch-call-notmuch-process "notmuch" (&rest args))\r
+ (declare-function notmuch-fontify-headers "notmuch" nil)\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
+@@ -1270,6 +1271,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
+@@ -1842,6 +1845,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