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 A6152431FC9 for ; Fri, 14 Feb 2014 01:15:39 -0800 (PST) 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 KR0YeB5pFU4m for ; Fri, 14 Feb 2014 01:15:34 -0800 (PST) Received: from mail-we0-f181.google.com (mail-we0-f181.google.com [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 7AC89431FBD for ; Fri, 14 Feb 2014 01:15:31 -0800 (PST) Received: by mail-we0-f181.google.com with SMTP id w61so8247655wes.26 for ; Fri, 14 Feb 2014 01:15:30 -0800 (PST) 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=rultwBrs7Y3s+niuk9gecquq6NlqzBQEbD5xgohpGMc=; b=s+8YnC40C1vgSh3tKaKq3bj0nGUqsLqJmD60SMQSfmszjLu2ZfuvwINv+4qKDBZO2k HxiG/LxgpONGT2XWhwitQzdIQBF+3MXalSUXS0q1/+gndwLfqR5hHuVuz0qPWnixwInq tt6bA7LjM61iR0dP/mMm9YSr21yOG+JYzz7l78pMV07jlsCtIrR5UyYLlRRjIV4Olkkq xx6y+BtpqxYjA59hA/eDXcM0ds40uysQ0yxx/nEOW4fd6Chidzb9cyxahKqOEqoCwTLP yYM/i99w3iWvC94fSR5M3snD3JD8F3h63WC1bQh3CoSxRkmRVDc3ElagZOlM6df5Xyuk jLUA== X-Received: by 10.181.13.11 with SMTP id eu11mr1253954wid.30.1392369329062; Fri, 14 Feb 2014 01:15:29 -0800 (PST) Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) by mx.google.com with ESMTPSA id uq2sm11141686wjc.5.2014.02.14.01.15.28 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 14 Feb 2014 01:15:28 -0800 (PST) From: Mark Walters To: notmuch@notmuchmail.org, Austin Clements Subject: [WIP Patch 2/7] emacs: tag split customise option for format-tags into a widget Date: Fri, 14 Feb 2014 09:15:14 +0000 Message-Id: <1392369319-24508-3-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1392369319-24508-1-git-send-email-markwalters1009@gmail.com> References: <1392369319-24508-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, 14 Feb 2014 09:15:39 -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 files changed, 29 insertions(+), 26 deletions(-) diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el index cb88fd5..f987291 100644 --- a/emacs/notmuch-tag.el +++ b/emacs/notmuch-tag.el @@ -40,6 +40,34 @@ This must be called after changes to `notmuch-tag-formats'." (clrhash notmuch-tag--format-cache)) +(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")) @@ -73,35 +101,10 @@ this automatically. See also `notmuch-tag-format-image', which can help replace tags with images." - :group 'notmuch-search :group 'notmuch-show :set (lambda (var val) (set-default var val) (notmuch-tag-clear-cache)) - :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.9.1