[PATCH v2 2/7] emacs: tag split customise option for format-tags into a widget
authorMark Walters <markwalters1009@gmail.com>
Wed, 19 Feb 2014 20:20:07 +0000 (20:20 +0000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:00:04 +0000 (10:00 -0800)
cf/4982602d4555e5ce25a4968cd366ba1c1b18d6 [new file with mode: 0644]

diff --git a/cf/4982602d4555e5ce25a4968cd366ba1c1b18d6 b/cf/4982602d4555e5ce25a4968cd366ba1c1b18d6
new file mode 100644 (file)
index 0000000..08da795
--- /dev/null
@@ -0,0 +1,149 @@
+Return-Path: <markwalters1009@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 3C8A9431FDB\r
+       for <notmuch@notmuchmail.org>; Wed, 19 Feb 2014 12:20:46 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.201\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+       RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id wfkSTnPjjwx6 for <notmuch@notmuchmail.org>;\r
+       Wed, 19 Feb 2014 12:20:40 -0800 (PST)\r
+Received: from mail-we0-f175.google.com (mail-we0-f175.google.com\r
+       [74.125.82.175]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id A2BD8431FC0\r
+       for <notmuch@notmuchmail.org>; Wed, 19 Feb 2014 12:20:37 -0800 (PST)\r
+Received: by mail-we0-f175.google.com with SMTP id q59so768293wes.34\r
+       for <notmuch@notmuchmail.org>; Wed, 19 Feb 2014 12:20:35 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:in-reply-to:references;\r
+       bh=4LzwHar1hpoICTcNkClFjIR6jB6LwIxFvo6/UMygL54=;\r
+       b=mUL5tzOqb1ZnDBB0LQHxJJAx4P9VAJz98FyH2KIbCI44bJ1Ptzm8mq4N31gceuGdK9\r
+       lpFufBFmcQTkX16F4s/zcBsR+4x8cdz+IM7VPNBorlRTnU5eDzgTKZo3+lkOx5Qfx3ch\r
+       W37vfyYTHasGj3rLcsNUVs413cxjUAxDA6DETmaMQF/pgmMfNBCAcnPdwJK3iaHkf3YF\r
+       bVHgTyHs28m9q9B70yaKtxpImhgjaEwkcCHz/coIzLljGa/of31yIL0hVz2D3VpqYlvM\r
+       cIH7SYzurcsS+f9WrILL0/gSRfeVJdAoDYLfbQaQlVTwGf230UuZappvo7HrnaROT5vv\r
+       K4pw==\r
+X-Received: by 10.180.35.36 with SMTP id e4mr3444839wij.8.1392841235117;\r
+       Wed, 19 Feb 2014 12:20:35 -0800 (PST)\r
+Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
+       by mx.google.com with ESMTPSA id d6sm4702686wiz.4.2014.02.19.12.20.33\r
+       for <multiple recipients>\r
+       (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+       Wed, 19 Feb 2014 12:20:34 -0800 (PST)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 2/7] emacs: tag split customise option for format-tags into\r
+       a widget\r
+Date: Wed, 19 Feb 2014 20:20:07 +0000\r
+Message-Id: <1392841212-8494-3-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+In-Reply-To: <1392841212-8494-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1392841212-8494-1-git-send-email-markwalters1009@gmail.com>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 19 Feb 2014 20:20:46 -0000\r
+\r
+We will re-use the customize option for format-tags for formattting\r
+deleted tags to added tags in the next patch so split it into a\r
+widget. There should be no functional change.\r
+---\r
+ emacs/notmuch-tag.el |   55 ++++++++++++++++++++++++++-----------------------\r
+ 1 files changed, 29 insertions(+), 26 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el\r
+index 47e0205..878aaf7 100644\r
+--- a/emacs/notmuch-tag.el\r
++++ b/emacs/notmuch-tag.el\r
+@@ -40,6 +40,34 @@\r
+ This must be called after changes to `notmuch-tag-formats'."\r
+   (clrhash notmuch-tag--format-cache))\r
\r
++(define-widget 'notmuch-tag-format-type 'lazy\r
++  "Customize widget for notmuch-tag-format and friends"\r
++  :type '(alist :key-type (regexp :tag "Tag")\r
++              :extra-offset -3\r
++              :value-type\r
++              (radio :format "%v"\r
++                     (const :tag "Hidden" nil)\r
++                     (set :tag "Modified"\r
++                          (string :tag "Display as")\r
++                          (list :tag "Face" :extra-offset -4\r
++                                (const :format "" :inline t\r
++                                       (propertize tag 'face))\r
++                                (list :format "%v"\r
++                                      (const :format "" quote)\r
++                                      custom-face-edit))\r
++                          (list :format "%v" :extra-offset -4\r
++                                (const :format "" :inline t\r
++                                       (notmuch-tag-format-image-data tag))\r
++                                (choice :tag "Image"\r
++                                        (const :tag "Star"\r
++                                               (notmuch-tag-star-icon))\r
++                                        (const :tag "Empty star"\r
++                                               (notmuch-tag-star-empty-icon))\r
++                                        (const :tag "Tag"\r
++                                               (notmuch-tag-tag-icon))\r
++                                        (string :tag "Custom")))\r
++                          (sexp :tag "Custom")))))\r
++\r
+ (defcustom notmuch-tag-formats\r
+   '(("unread" (propertize tag 'face '(:foreground "red")))\r
+     ("flagged" (propertize tag 'face '(:foreground "blue"))\r
+@@ -69,34 +97,9 @@ of a tag to red, use the expression\r
\r
+ See also `notmuch-tag-format-image', which can help replace tags\r
+ with images."\r
+-\r
+   :group 'notmuch-search\r
+   :group 'notmuch-show\r
+-  :type '(alist :key-type (regexp :tag "Tag")\r
+-              :extra-offset -3\r
+-              :value-type\r
+-              (radio :format "%v"\r
+-                     (const :tag "Hidden" nil)\r
+-                     (set :tag "Modified"\r
+-                          (string :tag "Display as")\r
+-                          (list :tag "Face" :extra-offset -4\r
+-                                (const :format "" :inline t\r
+-                                       (propertize tag 'face))\r
+-                                (list :format "%v"\r
+-                                      (const :format "" quote)\r
+-                                      custom-face-edit))\r
+-                          (list :format "%v" :extra-offset -4\r
+-                                (const :format "" :inline t\r
+-                                       (notmuch-tag-format-image-data tag))\r
+-                                (choice :tag "Image"\r
+-                                        (const :tag "Star"\r
+-                                               (notmuch-tag-star-icon))\r
+-                                        (const :tag "Empty star"\r
+-                                               (notmuch-tag-star-empty-icon))\r
+-                                        (const :tag "Tag"\r
+-                                               (notmuch-tag-tag-icon))\r
+-                                        (string :tag "Custom")))\r
+-                          (sexp :tag "Custom")))))\r
++  :type 'notmuch-tag-format-type)\r
\r
+ (defun notmuch-tag-format-image-data (tag data)\r
+   "Replace TAG with image DATA, if available.\r
+-- \r
+1.7.9.1\r
+\r