[PATCH 05/11] contrib: pick: add in to-message-window function
authorMark Walters <markwalters1009@gmail.com>
Fri, 5 Jul 2013 18:11:12 +0000 (19:11 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:55:52 +0000 (09:55 -0800)
66/9fb74960831d9420eb891481741a6a2e9cb92c [new file with mode: 0644]

diff --git a/66/9fb74960831d9420eb891481741a6a2e9cb92c b/66/9fb74960831d9420eb891481741a6a2e9cb92c
new file mode 100644 (file)
index 0000000..63c7260
--- /dev/null
@@ -0,0 +1,109 @@
+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 5E4AA431FC2\r
+       for <notmuch@notmuchmail.org>; Fri,  5 Jul 2013 11:11:46 -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 KBeQgltsSpUO for <notmuch@notmuchmail.org>;\r
+       Fri,  5 Jul 2013 11:11:40 -0700 (PDT)\r
+Received: from mail-ea0-f180.google.com (mail-ea0-f180.google.com\r
+       [209.85.215.180]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 89558431FAE\r
+       for <notmuch@notmuchmail.org>; Fri,  5 Jul 2013 11:11:35 -0700 (PDT)\r
+Received: by mail-ea0-f180.google.com with SMTP id k10so1638361eaj.25\r
+       for <notmuch@notmuchmail.org>; Fri, 05 Jul 2013 11:11:34 -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:x-mailer:in-reply-to:references;\r
+       bh=o4/hlSSp0f3JwFkmee7H5vDLLetaaaieKVFRt9JSZrA=;\r
+       b=GHu7r2vrZcCek3m1JZnBei66bvjqBvf/5c1qj5rD97/qZTSw61hJvTcmyqKOwzxOBf\r
+       kQ+99RNrCgv2hpATNdYcopDtNifgTn7rp0qNnRnK6G0bQpjeFjPyGjxavG3ha0DUpQj8\r
+       gnoBBTxXuwAVJppBoy+7ngEa6nE7dg1nZlzT2/E897zZsHOHRH8js+9WemJ+8kJHboWi\r
+       p3S+6t+ER/ximv5m6P7F02IKCxupwEHKQtXs6tTZyFN2YEB6E4xV5Wics5zBdI52BXwm\r
+       11FFbAdVjdCZXWctryggya8C5Z9uUzH26F5wEmzZwBi7C1IYtVhhqtyxDiRxeMGk2P0V\r
+       iVAw==\r
+X-Received: by 10.14.48.77 with SMTP id u53mr13160639eeb.154.1373047894391;\r
+       Fri, 05 Jul 2013 11:11:34 -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\r
+       n42sm15853841eeh.15.2013.07.05.11.11.33 for <multiple recipients>\r
+       (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+       Fri, 05 Jul 2013 11:11:33 -0700 (PDT)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 05/11] contrib: pick: add in to-message-window function\r
+Date: Fri,  5 Jul 2013 19:11:12 +0100\r
+Message-Id: <1373047878-20822-6-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+In-Reply-To: <1373047878-20822-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1373047878-20822-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: Fri, 05 Jul 2013 18:11:46 -0000\r
+\r
+This would be very simple but we want to get a useful doc string (so\r
+we get useful help messages).\r
+\r
+We use this for tabbing between and activate buttons in the message\r
+pane but it is trivial for pick or the user to link in other\r
+functions. For example\r
+\r
+(define-key map "h" (notmuch-pick-to-message-pane #'notmuch-show-toggle-visibility-headers))\r
+\r
+Other plausible functions for linking are\r
+\r
+notmuch-show-toggle-elide-non-matching\r
+notmuch-show-toggle-process-crypto\r
+notmuch-show-toggle-thread-indentation\r
+toggle-truncate-lines\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 7313100..8251b35 100644\r
+--- a/contrib/notmuch-pick/notmuch-pick.el\r
++++ b/contrib/notmuch-pick/notmuch-pick.el\r
+@@ -187,6 +187,19 @@ if the user has loaded a different buffer in that window.")\r
+ (make-variable-buffer-local 'notmuch-pick-message-buffer)\r
+ (put 'notmuch-pick-message-buffer 'permanent-local t)\r
\r
++(defun notmuch-pick-to-message-pane (func)\r
++  "Execute FUNC in message pane.\r
++\r
++This function returns a function (so can be used as a keybinding)\r
++which executes function FUNC in the message pane if it is\r
++open (if the message pane is closed it does nothing)."\r
++  `(lambda ()\r
++      ,(concat "(In message pane) " (documentation func t))\r
++     (interactive)\r
++     (when (window-live-p notmuch-pick-message-window)\r
++       (with-selected-window notmuch-pick-message-window\r
++       (funcall #',func)))))\r
++\r
+ (defvar notmuch-pick-mode-map\r
+   (let ((map (make-sparse-keymap)))\r
+     (define-key map [mouse-1] 'notmuch-pick-show-message)\r
+-- \r
+1.7.9.1\r
+\r