From 489b69c51ed0a6fbb2daefc628303d348114fecc Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Thu, 22 Aug 2013 18:10:20 +0100 Subject: [PATCH] [PATCH v3 05/11] contrib: pick: add in to-message-window function --- a9/9fe1a4737694ad05fd781c009602099a130edb | 93 +++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 a9/9fe1a4737694ad05fd781c009602099a130edb diff --git a/a9/9fe1a4737694ad05fd781c009602099a130edb b/a9/9fe1a4737694ad05fd781c009602099a130edb new file mode 100644 index 000000000..d8d9cbc5a --- /dev/null +++ b/a9/9fe1a4737694ad05fd781c009602099a130edb @@ -0,0 +1,93 @@ +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 C9AAD429E27 + for ; Thu, 22 Aug 2013 10:11:04 -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 qxr8-ryehrqe for ; + Thu, 22 Aug 2013 10:11:00 -0700 (PDT) +Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com + [209.85.212.178]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 63B76431FC9 + for ; Thu, 22 Aug 2013 10:10:43 -0700 (PDT) +Received: by mail-wi0-f178.google.com with SMTP id j17so951608wiw.17 + for ; Thu, 22 Aug 2013 10:10:41 -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=Q82z/MQ8iIT8v0TDk+YcJtKbbEihaCNC0xInVup8xBo=; + b=PinvyPr6F4asKXo9Lw19VJhAg0IiyCydZp4X79qpiDBP2iwiYsC2ZEPFXlNL+bIFZ+ + S2ItWcliVguimBcZfDcoZXgsNE2relkru1v8SuZxcGecoUoiKr57666RuVLkJb1Tc930 + gIjxRyk76mxcTLjmcG1C/w9n9AUS2J/UAtBiRzYf+zdEdkuiVk+SvD17JPUglxves/OA + oprDO09emgDy3sgpv6nt7GDAe1m5qdJDdDQtj0m1bIigosmzfXttVJIdztoBr/1PgKOC + Ha1B6xjlvMWX9V3JEZJvIBP5Se7gAfWNM0LOpwhIXPL2P2j3AFgcROZ6OCXRJdJMVQmz + S7QQ== +X-Received: by 10.180.109.35 with SMTP id hp3mr21689558wib.52.1377191440979; + Thu, 22 Aug 2013 10:10:40 -0700 (PDT) +Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) + by mx.google.com with ESMTPSA id l5sm18216331wia.6.1969.12.31.16.00.00 + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Thu, 22 Aug 2013 10:10:40 -0700 (PDT) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH v3 05/11] contrib: pick: add in to-message-window function +Date: Thu, 22 Aug 2013 18:10:20 +0100 +Message-Id: <1377191427-6821-6-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.9.1 +In-Reply-To: <1377191427-6821-1-git-send-email-markwalters1009@gmail.com> +References: <1377191427-6821-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: Thu, 22 Aug 2013 17:11:05 -0000 + +--- + 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 89e6d4b..9c1864b 100644 +--- a/contrib/notmuch-pick/notmuch-pick.el ++++ b/contrib/notmuch-pick/notmuch-pick.el +@@ -187,6 +187,19 @@ if the user has loaded a different buffer in that window.") + (make-variable-buffer-local 'notmuch-pick-message-buffer) + (put 'notmuch-pick-message-buffer 'permanent-local t) + ++(defun notmuch-pick-to-message-pane (func) ++ "Execute FUNC in message pane. ++ ++This function returns a function (so can be used as a keybinding) ++which executes function FUNC in the message pane if it is ++open (if the message pane is closed it does nothing)." ++ `(lambda () ++ ,(concat "(In message pane) " (documentation func t)) ++ (interactive) ++ (when (window-live-p notmuch-pick-message-window) ++ (with-selected-window notmuch-pick-message-window ++ (call-interactively #',func))))) ++ + (defvar notmuch-pick-mode-map + (let ((map (make-sparse-keymap))) + (define-key map [mouse-1] 'notmuch-pick-show-message) +-- +1.7.9.1 + -- 2.26.2