From 3e0911529f78b8d01d0fc75a0e92326b32cb963e Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Sun, 18 Aug 2013 13:14:34 +0100 Subject: [PATCH] [PATCH v2 06/11] contrib: pick: add button press helper --- f4/f2ad41697da352517d26d27116a834f82e5913 | 91 +++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 f4/f2ad41697da352517d26d27116a834f82e5913 diff --git a/f4/f2ad41697da352517d26d27116a834f82e5913 b/f4/f2ad41697da352517d26d27116a834f82e5913 new file mode 100644 index 000000000..230b836a2 --- /dev/null +++ b/f4/f2ad41697da352517d26d27116a834f82e5913 @@ -0,0 +1,91 @@ +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 28445431FD7 + for ; Sun, 18 Aug 2013 05:15:20 -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 YK8EEinJM7Hf for ; + Sun, 18 Aug 2013 05:15:14 -0700 (PDT) +Received: from mail-we0-f175.google.com (mail-we0-f175.google.com + [74.125.82.175]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id C3C32421164 + for ; Sun, 18 Aug 2013 05:14:55 -0700 (PDT) +Received: by mail-we0-f175.google.com with SMTP id q58so2936833wes.20 + for ; Sun, 18 Aug 2013 05:14:54 -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=8EWRF8vVNiTPQ74HFN05E+cDAeAynKjkiAnr4a5Dk7E=; + b=TxYBQFeeupX9afGLws9D9ezFeeOY4+6YCrliHYySnPIm88L12M6fQd7BUg7bQUgUFW + Cl4J5Ej+ofzJ+bqZwUeF+i5cDQnpquhtPv/tTI8crxj2Sab9HiXTlRf4zPa//bSr5r5y + 3Y3Y5+GsNQAmr8rRhEnYpkhs4y48YX86OMbfYZGpjcMs8GXYvg7YpjOhFWXXUS5sGG5p + gSdn/aXPJzP2PpPq32odDFNjPOJAX7KjUTYYmU6XXdr58B8K/KFH9ZDggp7WOP7aC+S+ + fOGyrVaFxhGMIxaj7j5nIgu2PItP2LaL21zqMh28J26PWfRn09UgmAduOW1monh8lhyf + Didg== +X-Received: by 10.180.94.106 with SMTP id db10mr4439353wib.38.1376828094682; + Sun, 18 Aug 2013 05:14:54 -0700 (PDT) +Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) + by mx.google.com with ESMTPSA id b13sm9220481wic.9.1969.12.31.16.00.00 + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Sun, 18 Aug 2013 05:14:54 -0700 (PDT) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH v2 06/11] contrib: pick: add button press helper +Date: Sun, 18 Aug 2013 13:14:34 +0100 +Message-Id: <1376828079-21455-7-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.9.1 +In-Reply-To: <1376828079-21455-1-git-send-email-markwalters1009@gmail.com> +References: <1376828079-21455-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: Sun, 18 Aug 2013 12:15:20 -0000 + +We will want to be able to activate buttons not in the current +buffer (ie in the message pane) so it is helpful to have a way of +activating a button without signalling error if there is no button. +--- + contrib/notmuch-pick/notmuch-pick.el | 8 ++++++++ + 1 files changed, 8 insertions(+), 0 deletions(-) + +diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el +index d00d324..2abb08b 100644 +--- a/contrib/notmuch-pick/notmuch-pick.el ++++ b/contrib/notmuch-pick/notmuch-pick.el +@@ -200,6 +200,14 @@ open (if the message pane is closed it does nothing)." + (with-selected-window notmuch-pick-message-window + (funcall #',func))))) + ++(defun notmuch-pick-button-activate (&optional button) ++ "Activate BUTTON or button at point ++ ++This function does not give an error if there is no button." ++ (interactive) ++ (let ((button (or button (button-at (point))))) ++ (when button (button-activate button)))) ++ + (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