--- /dev/null
+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 30118431FC9\r
+ for <notmuch@notmuchmail.org>; Tue, 11 Mar 2014 21:10:11 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 2.7\r
+X-Spam-Level: **\r
+X-Spam-Status: No, score=2.7 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
+ FREEMAIL_REPLY=2.499, 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 Ge3pxO3KeIP5 for <notmuch@notmuchmail.org>;\r
+ Tue, 11 Mar 2014 21:10:05 -0700 (PDT)\r
+Received: from mail-we0-f172.google.com (mail-we0-f172.google.com\r
+ [74.125.82.172]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 5ABD7431FBD\r
+ for <notmuch@notmuchmail.org>; Tue, 11 Mar 2014 21:10:05 -0700 (PDT)\r
+Received: by mail-we0-f172.google.com with SMTP id t61so10935384wes.31\r
+ for <notmuch@notmuchmail.org>; Tue, 11 Mar 2014 21:10:02 -0700 (PDT)\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;\r
+ bh=ushI8sUyDdfc3tZh/Ec3wHxTnIQti1POySXlq7loy8M=;\r
+ b=cn6p7+5AqY+v7+OUNAasM1W2dybTInO6NQZ30cEdkJzjV6HpbZZJ9Mjo4LU3vwokJM\r
+ Y48hpt2BGZeQj8OpZGJvE45fOjhB70Dvii8acQp23onSYgEHaimJDmqPtCj3HkC8nIzk\r
+ z/EmrME60hzrHGhs+962npirUrzjkw6/j+nH/G10gv6LmXBb5YVXauA4Pe0MijpzDdwc\r
+ AwGeDQjTyqoaB/qjJ+MmWK5jRm9IhdCL3FVUDwMf4HbRWoHHIxIZlu5+4SQfEsxl4f7s\r
+ /VhrMGbiwKJuGmtPFrL7qCNn22vEQIx73dQluKR+4HVPWnyJE3j3B15zi8P2j3+ftMPR\r
+ ZZXA==\r
+X-Received: by 10.194.1.242 with SMTP id 18mr2235058wjp.22.1394597401363;\r
+ Tue, 11 Mar 2014 21:10:01 -0700 (PDT)\r
+Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
+ by mx.google.com with ESMTPSA id 12sm66447776wjm.10.2014.03.11.21.10.00\r
+ for <multiple recipients>\r
+ (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+ Tue, 11 Mar 2014 21:10:00 -0700 (PDT)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org,\r
+ amdragon@mit.edu\r
+Subject: [Patch v3 0/8] emacs: show tag changes in buffer\r
+Date: Wed, 12 Mar 2014 04:09:49 +0000\r
+Message-Id: <1394597397-8486-1-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\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, 12 Mar 2014 04:10:11 -0000\r
+\r
+This is version 3 of this patch set. Version 2 is at\r
+id:1392841212-8494-1-git-send-email-markwalters1009@gmail.com.\r
+\r
+This includes a (very) slightly tweaked version of Austin's\r
+notmuch-apply-face patch so that face properties for deleted/added\r
+tags get applied on top of rather than instead of the default face for\r
+that tag.\r
+\r
+Otherwise I think this addesses all of Austin's review comments.\r
+\r
+A diff from v2 is below: I have deleted the parts related to the\r
+notmuch-apply-face addition.\r
+\r
+Best wishes\r
+\r
+Mark\r
+\r
+diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el\r
+index 869b97d..cfccb8e 100644\r
+--- a/emacs/notmuch-tag.el\r
++++ b/emacs/notmuch-tag.el\r
+@@ -28,18 +28,6 @@\r
+ (require 'crm)\r
+ (require 'notmuch-lib)\r
+ \r
+-;; (notmuch-tag-clear-cache will be called by the defcustom\r
+-;; notmuch-tag-formats, so it has to be defined first.)\r
+-\r
+-(defvar notmuch-tag--format-cache (make-hash-table :test 'equal)\r
+- "Cache of tag format lookup. Internal to `notmuch-tag-format-tag'.")\r
+-\r
+-(defun notmuch-tag-clear-cache ()\r
+- "Clear the internal cache of tag formats.\r
+-\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
+@@ -51,7 +39,7 @@ (define-widget 'notmuch-tag-format-type 'lazy\r
+ (string :tag "Display as")\r
+ (list :tag "Face" :extra-offset -4\r
+ (const :format "" :inline t\r
+- (propertize tag 'face))\r
++ (notmuch-apply-face tag))\r
+ (list :format "%v"\r
+ (const :format "" quote)\r
+ custom-face-edit))\r
+@@ -102,7 +90,11 @@ (defcustom notmuch-tag-formats\r
+ :type 'notmuch-tag-format-type)\r
+ \r
+ (defcustom notmuch-tag-deleted-formats\r
+- '((".*" (propertize tag 'face\r
++ '(("unread" (notmuch-apply-face "unread"\r
++ (if (display-supports-face-attributes-p '(:strike-through "red"))\r
++ '(:strike-through "red")\r
++ '(:inverse-video t))))\r
++ (".*" (notmuch-apply-face tag\r
+ (if (display-supports-face-attributes-p '(:strike-through "red"))\r
+ '(:strike-through "red")\r
+ '(:inverse-video t)))))\r
+@@ -115,14 +107,14 @@ (defcustom notmuch-tag-deleted-formats\r
+ unless strike-through is not available (e.g., emacs is running in\r
+ a terminal) in which case it uses inverse video. To hide deleted\r
+ tags completely set this to\r
+- '((\"\" nil))\r
++ '((\".*\" nil))\r
+ \r
+ See `notmuch-tag-formats' for full documentation."\r
+ :group 'notmuch-show\r
+ :type 'notmuch-tag-format-type)\r
+ \r
+ (defcustom notmuch-tag-added-formats\r
+- '((".*" (propertize tag 'face '(:underline "green"))))\r
++ '((".*" (notmuch-apply-face tag '(:underline "green"))))\r
+ "Custom formats for tags when added.\r
+ \r
+ For added tags the formats in `notmuch-tag-formats` are applied\r
+@@ -185,8 +177,15 @@ (defun notmuch-tag-tag-icon ()\r
+ </g>\r
+ </svg>")\r
+ \r
++(defvar notmuch-tag--format-cache (make-hash-table :test 'equal)\r
++ "Cache of tag format lookup. Internal to `notmuch-tag-format-tag'.")\r
++\r
++(defun notmuch-tag-clear-cache ()\r
++ "Clear the internal cache of tag formats."\r
++ (clrhash notmuch-tag--format-cache))\r
++\r
+ (defun notmuch-tag-format-tag-by-state (tag formatted-tag tag-state)\r
+- "Format TAG by looking into the appropriate `notmuch-tag-formats`.\r
++ "Format TAG according to the appropriate `notmuch-tag-formats`.\r
+ \r
+ Applies formats for TAG from the appropriate one of\r
+ `notmuch-tag-formats`, `notmuch-tag-deleted-formats` and\r
+@@ -194,11 +193,15 @@ (defun notmuch-tag-format-tag-by-state (tag formatted-tag tag-state)\r
+ formatted tag FORMATTED-TAG."\r
+ (let ((formatted (gethash (cons tag tag-state) notmuch-tag--format-cache 'missing)))\r
+ (when (eq formatted 'missing)\r
+- (let* ((tag-formats (cond ((null tag-state) notmuch-tag-formats)\r
+- ((eq 'deleted tag-state) notmuch-tag-deleted-formats)\r
+- ((eq 'added tag-state) notmuch-tag-added-formats)))\r
++ (let* ((tag-formats (case tag-state\r
++ ((list nil) notmuch-tag-formats)\r
++ (deleted notmuch-tag-deleted-formats)\r
++ (added notmuch-tag-added-formats)))\r
+ (formats\r
+ (save-match-data\r
++ ;; Don't use assoc-default since there's no way to\r
++ ;; distinguish a missing key from a present key with a\r
++ ;; null cdr:.\r
+ (assoc* tag tag-formats\r
+ :test (lambda (tag key)\r
+ (and (eq (string-match key tag) 0)\r
+@@ -224,7 +227,7 @@ (defun notmuch-tag-format-tag-by-state (tag formatted-tag tag-state)\r
+ formatted))\r
+ \r
+ (defun notmuch-tag-format-tag (tags orig-tags tag)\r
+- "Format TAG by looking into `notmuch-tag-formats'.\r
++ "Format TAG according to `notmuch-tag-formats'.\r
+ \r
+ TAGS and ORIG-TAGS are lists of the current tags and the original\r
+ tags; tags which have been deleted (i.e., are in ORIG-TAGS but\r
+@@ -246,7 +249,7 @@ (defun notmuch-tag-format-tags (tags orig-tags &optional face)\r
+ "Return a string representing formatted TAGS."\r
+ (let ((face (or face 'notmuch-tag-face))\r
+ (all-tags (sort (delete-dups (append tags orig-tags nil)) #'string<)))\r
+- (notmuch-combine-face-text-property-string\r
++ (notmuch-apply-face\r
+ (mapconcat #'identity\r
+ ;; nil indicated that the tag was deliberately hidden\r
+ (delq nil (mapcar\r
+ \r
+\r
+\r
+\r
+Austin Clements (2):\r
+ emacs: Combine notmuch-combine-face-text-property{,-string}\r
+ Make keys of notmuch-tag-formats regexps and use caching\r
+\r
+Mark Walters (6):\r
+ emacs: tag split customise option for format-tags into a widget\r
+ emacs: tag: add customize for deleted/added tag formats\r
+ emacs: show: mark tags changed since buffer loaded\r
+ emacs: show: use orig-tags for tag display\r
+ emacs: search: use orig-tags in search\r
+ emacs: tree: use orig-tags in search\r
+\r
+ emacs/notmuch-lib.el | 35 +++++----\r
+ emacs/notmuch-show.el | 7 +-\r
+ emacs/notmuch-tag.el | 194 +++++++++++++++++++++++++++++++++++++------------\r
+ emacs/notmuch-tree.el | 12 ++-\r
+ emacs/notmuch.el | 44 +++++++----\r
+ test/test-lib.el | 5 +\r
+ 6 files changed, 210 insertions(+), 87 deletions(-)\r
+\r
+-- \r
+1.7.9.1\r
+\r