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