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 23CA7431FDD for ; Fri, 5 Jul 2013 11:12:13 -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 EMdgM8l45xvt for ; Fri, 5 Jul 2013 11:12:05 -0700 (PDT) Received: from mail-ee0-f49.google.com (mail-ee0-f49.google.com [74.125.83.49]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id C78DF431FBC for ; Fri, 5 Jul 2013 11:11:42 -0700 (PDT) Received: by mail-ee0-f49.google.com with SMTP id b57so1512761eek.8 for ; Fri, 05 Jul 2013 11:11: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:x-mailer:in-reply-to:references; bh=VORSS5Luaounav5EfpO/eS83tjsFoRLrfuZfFcuvSUg=; b=ti51JpZPgg6bVjdjJs+9n4Gs3ASQ1fmiYZlE0ojqksuIHQoXGgzUa+irgSsy4KcPDM OcvKFOg7BmJIcQdUsNE3nhU76vGqWbdkDhQi58nq+1QPozFVvrSxfron5FCdSggMu4jy bvm3qyBqyN5kixSOZcK2OmifFSfTpw7djQKQgqOeUCa37XLExs+AMmG0hWxeyYkRLHMW Xh+7BZR7mOMyW7pRHJ04b8J5CPwjCz/XTP7pIjyOY1R8UloBfHY3wMJ9evEPj6w4YBdH tlTmATL1pHX3mg+lMVR/nVnrM1bSog4l8v+lHsay57bBrTemAADyRjXyeZzFaOwoOMkB +6ug== X-Received: by 10.15.94.11 with SMTP id ba11mr13308851eeb.101.1373047901633; Fri, 05 Jul 2013 11:11:41 -0700 (PDT) Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) by mx.google.com with ESMTPSA id cg12sm15955158eeb.7.2013.07.05.11.11.40 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 05 Jul 2013 11:11:41 -0700 (PDT) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH 06/11] contrib: pick: add button press helper Date: Fri, 5 Jul 2013 19:11:13 +0100 Message-Id: <1373047878-20822-7-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1373047878-20822-1-git-send-email-markwalters1009@gmail.com> References: <1373047878-20822-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: Fri, 05 Jul 2013 18:12:13 -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 8251b35..775b783 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