From: Mark Walters Date: Thu, 22 Aug 2013 17:10:21 +0000 (+0100) Subject: [PATCH v3 06/11] contrib: pick: add button press helper X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f1155639cf163f8fb763b8deb0a9f1fecf288338;p=notmuch-archives.git [PATCH v3 06/11] contrib: pick: add button press helper --- diff --git a/d1/1179476e5d601f1d407cbd9b90c100d04e6a58 b/d1/1179476e5d601f1d407cbd9b90c100d04e6a58 new file mode 100644 index 000000000..cf5385339 --- /dev/null +++ b/d1/1179476e5d601f1d407cbd9b90c100d04e6a58 @@ -0,0 +1,92 @@ +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 1A33B429E3C + for ; Thu, 22 Aug 2013 10:11:08 -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 fg4BsMerOV-2 for ; + Thu, 22 Aug 2013 10:11:02 -0700 (PDT) +Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com + [209.85.212.179]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id D9197429E38 + for ; Thu, 22 Aug 2013 10:10:43 -0700 (PDT) +Received: by mail-wi0-f179.google.com with SMTP id hr7so956125wib.0 + for ; Thu, 22 Aug 2013 10:10:42 -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=oaVgbcd2AUGl64gW7eZZeO92tcE17MeDZSlRV7DNDGo=; + b=VGVqeagH6+UbwlCTKgHZynkxq4wzK9VS2D5KkMOz/4kW+QYxw7+opJ2TfVNK9Fiw2S + iGYbYjh75HdUgSqiTsmZGqouFNnaUUWsufeBTyobL/VVetm7ylT2Nc+lrUDi5qdJz4L0 + aZl/y2l3zrb5QGmRkF2X25yv0lO7Z4yrSRbfwy5VAfJC4aopRGj8rCankK7HLIXLWaYF + 2RK9asaUADqr2U+FFBAlGsiX1QP/ilqFn6BOpubQw8SDqA6tNdu4Bh/+mIU2SQKilktA + PwtiLQxUYvBB2bdq839XYQ5SZXfXw1XfogFDg5yVmiXj8ZQyqo1bvustW+wZMgJWrTqq + DYpg== +X-Received: by 10.194.23.196 with SMTP id o4mr2330390wjf.62.1377191442752; + Thu, 22 Aug 2013 10:10:42 -0700 (PDT) +Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) + by mx.google.com with ESMTPSA id + dt17sm39555888wic.1.1969.12.31.16.00.00 + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Thu, 22 Aug 2013 10:10:42 -0700 (PDT) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH v3 06/11] contrib: pick: add button press helper +Date: Thu, 22 Aug 2013 18:10:21 +0100 +Message-Id: <1377191427-6821-7-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:08 -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 9c1864b..f24f2b3 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 + (call-interactively #',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 +