[Patch v4 3/3] contrib: pick: bind M-p and M-n to prev/next thread
authorMark Walters <markwalters1009@gmail.com>
Sun, 25 Aug 2013 19:55:34 +0000 (20:55 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:56:39 +0000 (09:56 -0800)
a8/dec2a6478477a6f7650121a14b9bc930c7058f [new file with mode: 0644]

diff --git a/a8/dec2a6478477a6f7650121a14b9bc930c7058f b/a8/dec2a6478477a6f7650121a14b9bc930c7058f
new file mode 100644 (file)
index 0000000..bb8af72
--- /dev/null
@@ -0,0 +1,107 @@
+Return-Path: <markwalters1009@gmail.com>\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 92E0F431FD5\r
+       for <notmuch@notmuchmail.org>; Mon, 26 Aug 2013 10:38:38 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.201\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+       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 uekLk+4Ejiqv for <notmuch@notmuchmail.org>;\r
+       Mon, 26 Aug 2013 10:38:31 -0700 (PDT)\r
+Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com\r
+       [209.85.212.180]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id C1FB5431FD7\r
+       for <notmuch@notmuchmail.org>; Mon, 26 Aug 2013 10:38:30 -0700 (PDT)\r
+Received: by mail-wi0-f180.google.com with SMTP id l12so2842388wiv.7\r
+       for <notmuch@notmuchmail.org>; Mon, 26 Aug 2013 10:38:29 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:in-reply-to:references;\r
+       bh=654EuTuuxIePCVBZiuCYbK0tCq2brcrOM8JwcXL3ztY=;\r
+       b=HFrPm7ggUo2ENybUvzbDO155F3SV/i+Oonm36oUfTp8+VZor7tksp8EykRxh1vRA0W\r
+       eCeuiYMTSqdbVPhu1T4j2Sfg3CXqHOpM24+cCrMkVvzNHxssD47Sk1FtrvIwE1lHPrwf\r
+       RCYaxJG6h19eOv5/IIdQglPFH6/lBLPnYNPTZpLCqQI/07jNpuV7lC8Kpqx9sygcDyA5\r
+       KeFPSq63eNdT7HPAcncfhtjZjbI0Nzw2J2HcE0AfT6cciQ+3KOMIenW6OgWDhPGofXqZ\r
+       mWE0BCTKUG8JEPT/Kk1kDlty/eKiHnEk7DfZ7aAPnjO4HQ6E+VkQY627mm4bKW1kvKTL\r
+       M6ZQ==\r
+X-Received: by 10.180.182.74 with SMTP id ec10mr5197345wic.4.1377460547050;\r
+       Sun, 25 Aug 2013 12:55:47 -0700 (PDT)\r
+Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
+       by mx.google.com with ESMTPSA id r6sm13302220wiw.0.1969.12.31.16.00.00\r
+       (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+       Sun, 25 Aug 2013 12:55:46 -0700 (PDT)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [Patch v4 3/3] contrib: pick: bind M-p and M-n to prev/next thread\r
+Date: Sun, 25 Aug 2013 20:55:34 +0100\r
+Message-Id: <1377460534-6022-4-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+In-Reply-To: <1377460534-6022-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1377460534-6022-1-git-send-email-markwalters1009@gmail.com>\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: Mon, 26 Aug 2013 17:38:39 -0000\r
+\r
+This adds functions to go to the previous or next thread to\r
+pick. Prev-thread behaves similarly to prev-message in show: if you\r
+are on the top line of a thread it will go to the top of the previous\r
+thread, otherwise it will go to the top of the current thread. Next\r
+thread will always go to the top of the next thread (or the end of\r
+buffer). These are bound to "M-p" and "M-n" by default (matching the\r
+bindings in show).\r
+---\r
+ contrib/notmuch-pick/notmuch-pick.el |   13 +++++++++++++\r
+ 1 files changed, 13 insertions(+), 0 deletions(-)\r
+\r
+diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el\r
+index 258cfc3..84d27b3 100644\r
+--- a/contrib/notmuch-pick/notmuch-pick.el\r
++++ b/contrib/notmuch-pick/notmuch-pick.el\r
+@@ -255,6 +255,8 @@ FUNC."\r
+     (define-key map "p" 'notmuch-pick-prev-matching-message)\r
+     (define-key map "N" 'notmuch-pick-next-message)\r
+     (define-key map "P" 'notmuch-pick-prev-message)\r
++    (define-key map (kbd "M-p") 'notmuch-pick-prev-thread)\r
++    (define-key map (kbd "M-n") 'notmuch-pick-next-thread)\r
+     (define-key map "-" 'notmuch-pick-remove-tag)\r
+     (define-key map "+" 'notmuch-pick-add-tag)\r
+     (define-key map "*" 'notmuch-pick-tag-thread)\r
+@@ -606,6 +608,17 @@ message will be \"unarchived\", i.e. the tag changes in\r
+     (while (not (or (notmuch-pick-get-prop :first) (eobp)))\r
+       (forward-line -1))))\r
\r
++(defun notmuch-pick-prev-thread ()\r
++  (interactive)\r
++  (forward-line -1)\r
++  (notmuch-pick-thread-top))\r
++\r
++(defun notmuch-pick-next-thread ()\r
++  (interactive)\r
++  (forward-line 1)\r
++  (while (not (or (notmuch-pick-get-prop :first) (eobp)))\r
++    (forward-line 1)))\r
++\r
+ (defun notmuch-pick-thread-mapcar (function)\r
+   "Iterate through all messages in the current thread\r
+  and call FUNCTION for side effects."\r
+-- \r
+1.7.9.1\r
+\r