[PATCH 6/7] emacs: Allow custom tags formatting
authorAustin Clements <amdragon@MIT.EDU>
Fri, 13 Jul 2012 00:45:18 +0000 (20:45 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:48:14 +0000 (09:48 -0800)
6d/27e87f8369bda5e7aed96ab6d3056ad268aacd [new file with mode: 0644]

diff --git a/6d/27e87f8369bda5e7aed96ab6d3056ad268aacd b/6d/27e87f8369bda5e7aed96ab6d3056ad268aacd
new file mode 100644 (file)
index 0000000..15062d8
--- /dev/null
@@ -0,0 +1,107 @@
+Return-Path: <amdragon@mit.edu>\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 9C80D41ED72\r
+       for <notmuch@notmuchmail.org>; Thu, 12 Jul 2012 17:45:37 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[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 uMI7CvK4qCiA for <notmuch@notmuchmail.org>;\r
+       Thu, 12 Jul 2012 17:45:36 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-7.mit.edu (DMZ-MAILSEC-SCANNER-7.MIT.EDU\r
+       [18.7.68.36])\r
+       by olra.theworths.org (Postfix) with ESMTP id E4ED541ED74\r
+       for <notmuch@notmuchmail.org>; Thu, 12 Jul 2012 17:45:30 -0700 (PDT)\r
+X-AuditID: 12074424-b7f2a6d0000008bf-c5-4fff6faa8835\r
+Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
+       by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id FD.38.02239.AAF6FFF4; Thu, 12 Jul 2012 20:45:30 -0400 (EDT)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q6D0jUsc021129; \r
+       Thu, 12 Jul 2012 20:45:30 -0400\r
+Received: from drake.dyndns.org\r
+       (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com\r
+       [209.6.116.242]) (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q6D0jST0010705\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Thu, 12 Jul 2012 20:45:29 -0400 (EDT)\r
+Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1SpU0e-0005SC-Mf; Thu, 12 Jul 2012 20:45:28 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 6/7] emacs: Allow custom tags formatting\r
+Date: Thu, 12 Jul 2012 20:45:18 -0400\r
+Message-Id: <1342140319-19859-7-git-send-email-amdragon@mit.edu>\r
+X-Mailer: git-send-email 1.7.10\r
+In-Reply-To: <1342140319-19859-1-git-send-email-amdragon@mit.edu>\r
+References: <1342140319-19859-1-git-send-email-amdragon@mit.edu>\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFtrIIsWRmVeSWpSXmKPExsUixG6nrrsq/7+/wbIVQhbXb85kdmD0eLbq\r
+       FnMAYxSXTUpqTmZZapG+XQJXRvPeLtaCY9wVWzfNZ2tgXMvZxcjBISFgIvF1vWIXIyeQKSZx\r
+       4d56NhBbSGAfo8SJaeVdjFxA9gZGiXtXv7BDOI+YJFZN6YZy5jJKfGr6xArSwiagIbFt/3JG\r
+       EFtEQFpi593ZrCAbmAXUJP50qYCEhQUsJKY272cCsVkEVCWONV1jAbF5BRwkpqx9ywpxhbzE\r
+       0/t9YFdwCjhKbPhygRXiIgeJxmMzmScw8i9gZFjFKJuSW6Wbm5iZU5yarFucnJiXl1qka66X\r
+       m1mil5pSuokRHDIuKjsYmw8pHWIU4GBU4uH9FfvfX4g1say4MvcQoyQHk5Ior0s2UIgvKT+l\r
+       MiOxOCO+qDQntfgQowQHs5II7zp7oBxvSmJlVWpRPkxKmoNFSZz3espNfyGB9MSS1OzU1ILU\r
+       IpisDAeHkgTvuTygRsGi1PTUirTMnBKENBMHJ8hwHqDh20BqeIsLEnOLM9Mh8qcYFaXEeVtA\r
+       EgIgiYzSPLheWEy/YhQHekWYdydIFQ8wHcB1vwIazAQ0eNbPfyCDSxIRUlINjEY1Pz4vWX/r\r
+       +0rT3ivBjoYC17nPpAqeqvh9yWZpf/vExfteyUZelGOaGCiqEBK397p6zvrDB9x2bPb4pPSi\r
+       tlPX8iPHiejv7z9aRSksvKb0Ns+xwkaH5VScpGJrnFXctmmTE47v1M7/17lRaf0mbak3zl8+\r
+       uG7U2s5pqsB+7kW6L/f5jTEVSUosxRmJhlrMRcWJAMuajcDEAgAA\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: Fri, 13 Jul 2012 00:45:37 -0000\r
+\r
+Previously we ignored any notmuch-search-result-format customizations\r
+for tag formatting because we needed to be able to parse back in the\r
+result line and update the tags in place.  We no longer do either of\r
+these things, so we can allow customization of this format.\r
+\r
+(Coincidentally, previously we still allowed too much customization of\r
+the tags format, since moving it earlier on the line or removing it\r
+from the line would interfere with the tagging mechanism.  There is\r
+now no problem with doing such things.)\r
+---\r
+ emacs/notmuch.el |    8 +++-----\r
+ 1 file changed, 3 insertions(+), 5 deletions(-)\r
+\r
+diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+index a5cf0dc..f32cfb0 100644\r
+--- a/emacs/notmuch.el\r
++++ b/emacs/notmuch.el\r
+@@ -755,11 +755,9 @@ non-authors is found, assume that all of the authors match."\r
+     (notmuch-search-insert-authors format-string (plist-get result :authors)))\r
+ \r
+    ((string-equal field "tags")\r
+-    ;; Ignore format-string here because notmuch-search-set-tags\r
+-    ;; depends on the format of this\r
+-    (insert (concat "(" (propertize\r
+-                       (mapconcat 'identity (plist-get result :tags) " ")\r
+-                       'font-lock-face 'notmuch-tag-face) ")")))))\r
++    (let ((tags-str (mapconcat 'identity (plist-get result :tags) " ")))\r
++      (insert (propertize (format format-string tags-str)\r
++                        'face 'notmuch-tag-face))))))\r
+ \r
+ (defun notmuch-search-show-result (result &optional pos)\r
+   ;; Ignore excluded matches\r
+-- \r
+1.7.10\r
+\r