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 07F86431FC3 for ; Sat, 22 Mar 2014 04:51:38 -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 J0IdFgV+WF8p for ; Sat, 22 Mar 2014 04:51:32 -0700 (PDT) Received: from mail-wg0-f44.google.com (mail-wg0-f44.google.com [74.125.82.44]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id BDA37431FC4 for ; Sat, 22 Mar 2014 04:51:28 -0700 (PDT) Received: by mail-wg0-f44.google.com with SMTP id m15so2297691wgh.27 for ; Sat, 22 Mar 2014 04:51:27 -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=fEMkOplF/8Mw2hKMo/NCXZC7c+I/0GeCEv5NVgN/9n8=; b=J1TRQ/uxykVrygrbQdzUkA19w6fHjCETv/5XHPpCJtKKLqlKcVCqKvHWyBwGYe+mZl QlfQMlz0BIwVQ8lVP4tyCGVtTICNVeYZdeBMK+TnsMl0hL9iODrL42Jh4Lwi0Cow7bP/ oPc7fB1lTaMkH+flfwOqhb8C+GZl1SZ/XYL50+1M8+M2Cw5ZTEsnOAbyxJwHOPTJovZo NBxNb0ITbTgw+/KswbfVP1EUf/soDNzoQWfejl73zyHxHaTn9/oNRTakG2vSz4xaRb0P gwOkLQaf/MTEHXEFhjTKP8vZPNejsKPSoHAwoQv7hpskNrrZGhs+MS95zVhC32E9PnSo j79Q== X-Received: by 10.180.164.174 with SMTP id yr14mr3171014wib.18.1395489087661; Sat, 22 Mar 2014 04:51:27 -0700 (PDT) Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) by mx.google.com with ESMTPSA id c7sm16853318wjf.19.2014.03.22.04.51.26 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 22 Mar 2014 04:51:26 -0700 (PDT) From: Mark Walters To: notmuch@notmuchmail.org, amdragon@mit.edu Subject: [Patch v4 3/8] emacs: tag split customise option for format-tags into a widget Date: Sat, 22 Mar 2014 11:51:07 +0000 Message-Id: <1395489072-19001-4-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1395489072-19001-1-git-send-email-markwalters1009@gmail.com> References: <1395489072-19001-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: Sat, 22 Mar 2014 11:51:38 -0000 We will re-use the customize option for format-tags for formattting deleted tags to added tags in the next patch so split it into a widget. There should be no functional change. --- emacs/notmuch-tag.el | 55 ++++++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el index 42c425e..a4dea39 100644 --- a/emacs/notmuch-tag.el +++ b/emacs/notmuch-tag.el @@ -28,6 +28,34 @@ (require 'crm) (require 'notmuch-lib) +(define-widget 'notmuch-tag-format-type 'lazy + "Customize widget for notmuch-tag-format and friends" + :type '(alist :key-type (regexp :tag "Tag") + :extra-offset -3 + :value-type + (radio :format "%v" + (const :tag "Hidden" nil) + (set :tag "Modified" + (string :tag "Display as") + (list :tag "Face" :extra-offset -4 + (const :format "" :inline t + (propertize tag 'face)) + (list :format "%v" + (const :format "" quote) + custom-face-edit)) + (list :format "%v" :extra-offset -4 + (const :format "" :inline t + (notmuch-tag-format-image-data tag)) + (choice :tag "Image" + (const :tag "Star" + (notmuch-tag-star-icon)) + (const :tag "Empty star" + (notmuch-tag-star-empty-icon)) + (const :tag "Tag" + (notmuch-tag-tag-icon)) + (string :tag "Custom"))) + (sexp :tag "Custom"))))) + (defcustom notmuch-tag-formats '(("unread" (propertize tag 'face '(:foreground "red"))) ("flagged" (propertize tag 'face '(:foreground "blue")) @@ -57,34 +85,9 @@ (defcustom notmuch-tag-formats See also `notmuch-tag-format-image', which can help replace tags with images." - :group 'notmuch-search :group 'notmuch-show - :type '(alist :key-type (regexp :tag "Tag") - :extra-offset -3 - :value-type - (radio :format "%v" - (const :tag "Hidden" nil) - (set :tag "Modified" - (string :tag "Display as") - (list :tag "Face" :extra-offset -4 - (const :format "" :inline t - (propertize tag 'face)) - (list :format "%v" - (const :format "" quote) - custom-face-edit)) - (list :format "%v" :extra-offset -4 - (const :format "" :inline t - (notmuch-tag-format-image-data tag)) - (choice :tag "Image" - (const :tag "Star" - (notmuch-tag-star-icon)) - (const :tag "Empty star" - (notmuch-tag-star-empty-icon)) - (const :tag "Tag" - (notmuch-tag-tag-icon)) - (string :tag "Custom"))) - (sexp :tag "Custom"))))) + :type 'notmuch-tag-format-type) (defun notmuch-tag-format-image-data (tag data) "Replace TAG with image DATA, if available. -- 1.7.10.4