From a86daf21f93e67eb4f98e729775b32caacba7d99 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Sat, 14 Jul 2012 23:43:25 +2000 Subject: [PATCH] [PATCH v2 6/7] emacs: Allow custom tags formatting --- 15/90a2e7c68d730e2d3348b8b180e2e3753ac766 | 108 ++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 15/90a2e7c68d730e2d3348b8b180e2e3753ac766 diff --git a/15/90a2e7c68d730e2d3348b8b180e2e3753ac766 b/15/90a2e7c68d730e2d3348b8b180e2e3753ac766 new file mode 100644 index 000000000..8f0302e17 --- /dev/null +++ b/15/90a2e7c68d730e2d3348b8b180e2e3753ac766 @@ -0,0 +1,108 @@ +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 BC75D42119B + for ; Fri, 13 Jul 2012 20:43:41 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[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 JIHSj1kdfDxr for ; + Fri, 13 Jul 2012 20:43:39 -0700 (PDT) +Received: from dmz-mailsec-scanner-3.mit.edu (DMZ-MAILSEC-SCANNER-3.MIT.EDU + [18.9.25.14]) + by olra.theworths.org (Postfix) with ESMTP id 9CD66431FAE + for ; Fri, 13 Jul 2012 20:43:39 -0700 (PDT) +X-AuditID: 1209190e-b7fb56d0000008b2-58-5000eaeb61d5 +Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) + by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP + id 6B.44.02226.BEAE0005; Fri, 13 Jul 2012 23:43:39 -0400 (EDT) +Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) + by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q6E3hcYB026807; + Fri, 13 Jul 2012 23:43:38 -0400 +Received: from drake.dyndns.org + (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com + [209.6.116.242]) (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q6E3hbPi021333 + (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); + Fri, 13 Jul 2012 23:43:38 -0400 (EDT) +Received: from amthrax by drake.dyndns.org with local (Exim 4.77) + (envelope-from ) + id 1SptGa-0000a8-V6; Fri, 13 Jul 2012 23:43:36 -0400 +From: Austin Clements +To: notmuch@notmuchmail.org +Subject: [PATCH v2 6/7] emacs: Allow custom tags formatting +Date: Fri, 13 Jul 2012 23:43:25 -0400 +Message-Id: <1342237406-32507-7-git-send-email-amdragon@mit.edu> +X-Mailer: git-send-email 1.7.10 +In-Reply-To: <1342237406-32507-1-git-send-email-amdragon@mit.edu> +References: <1342140319-19859-1-git-send-email-amdragon@mit.edu> + <1342237406-32507-1-git-send-email-amdragon@mit.edu> +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFtrLIsWRmVeSWpSXmKPExsUixG6nrvv6FUOAwdef7Bar5/JYXL85k9mB + yWPnrLvsHs9W3WIOYIrisklJzcksSy3St0vgymibspu14DV3xeqeXrYGxhOcXYycHBICJhJX + 195kg7DFJC7cWw9kc3EICexjlFiz8CczhLOBUeLY5eVMEM4jJon7655DOXMZJX7f38QO0s8m + oCGxbf9yRhBbREBaYufd2awgNrOAo8Tn/YvAdggLWEscaN4OVs8ioCqx5PBRFhCbV8BBYuLb + LVB3yEs8vd8HZnMC9bb13gabKSRQLnH92xqmCYz8CxgZVjHKpuRW6eYmZuYUpybrFicn5uWl + Fuka6+VmluilppRuYgSFEqck3w7GrweVDjEKcDAq8fBm+jMECLEmlhVX5h5ilORgUhLl5QUG + ohBfUn5KZUZicUZ8UWlOavEhRgkOZiURXvM2oBxvSmJlVWpRPkxKmoNFSZz3SspNfyGB9MSS + 1OzU1ILUIpisDAeHkgRvD8hQwaLU9NSKtMycEoQ0EwcnyHAeoOGTQWp4iwsSc4sz0yHypxgV + pcR5C0ASAiCJjNI8uF5YrL9iFAd6RZi3EqSKB5gm4LpfAQ1mAho86+c/f6DBJYkIKakGxrWV + We6PCiYn+1lvmBLyMDZd9oXdbxn2J8Kl0RGT5rhfs195fWbIhp7jbOVT+qJ2M/Y5ik1Ymxcj + 3Nb2zH3uy/NfE+YZd6tcZRNxeXpENtv9w54fvEXpN7ZP8dmx7l3RnxcxZ3VPms3W49Wz0b18 + O94vgyP4fVzAt3cvavPvL968eBHjBZENVUosxRmJhlrMRcWJAIoqkL/QAgAA +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, 14 Jul 2012 03:43:42 -0000 + +Previously we ignored any notmuch-search-result-format customizations +for tag formatting because we needed to be able to parse back in the +result line and update the tags in place. We no longer do either of +these things, so we can allow customization of this format. + +(Coincidentally, previously we still allowed too much customization of +the tags format, since moving it earlier on the line or removing it +from the line would interfere with the tagging mechanism. There is +now no problem with doing such things.) +--- + emacs/notmuch.el | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +diff --git a/emacs/notmuch.el b/emacs/notmuch.el +index 9e061b6..d0a8021 100644 +--- a/emacs/notmuch.el ++++ b/emacs/notmuch.el +@@ -759,11 +759,9 @@ non-authors is found, assume that all of the authors match." + (notmuch-search-insert-authors format-string (plist-get result :authors))) + + ((string-equal field "tags") +- ;; Ignore format-string here because notmuch-search-set-tags +- ;; depends on the format of this +- (insert (concat "(" (propertize +- (mapconcat 'identity (plist-get result :tags) " ") +- 'font-lock-face 'notmuch-tag-face) ")"))))) ++ (let ((tags-str (mapconcat 'identity (plist-get result :tags) " "))) ++ (insert (propertize (format format-string tags-str) ++ 'face 'notmuch-tag-face)))))) + + (defun notmuch-search-show-result (result &optional pos) + "Insert RESULT at POS or the end of the buffer if POS is null." +-- +1.7.10 + -- 2.26.2