From 0048ce06ea3367630e2dd8c361af7255bdb5dc7f Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Sun, 22 Jul 2012 13:37:10 +2000 Subject: [PATCH] [PATCH v4 6/8] emacs: Allow custom tags formatting --- 92/c1d5f6f85716195a0e8ac038c8a38f6ef9ea12 | 108 ++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 92/c1d5f6f85716195a0e8ac038c8a38f6ef9ea12 diff --git a/92/c1d5f6f85716195a0e8ac038c8a38f6ef9ea12 b/92/c1d5f6f85716195a0e8ac038c8a38f6ef9ea12 new file mode 100644 index 000000000..1a6be6631 --- /dev/null +++ b/92/c1d5f6f85716195a0e8ac038c8a38f6ef9ea12 @@ -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 AD20E431FC3 + for ; Sat, 21 Jul 2012 10:37:24 -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 84ilyN6GYoTu for ; + Sat, 21 Jul 2012 10:37:23 -0700 (PDT) +Received: from dmz-mailsec-scanner-8.mit.edu (DMZ-MAILSEC-SCANNER-8.MIT.EDU + [18.7.68.37]) + by olra.theworths.org (Postfix) with ESMTP id 487C2431FC7 + for ; Sat, 21 Jul 2012 10:37:20 -0700 (PDT) +X-AuditID: 12074425-b7f9b6d0000008c4-d6-500ae8ce8ee7 +Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) + by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP + id C0.FE.02244.EC8EA005; Sat, 21 Jul 2012 13:37:18 -0400 (EDT) +Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) + by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id q6LHbHIU029420; + Sat, 21 Jul 2012 13:37:17 -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 q6LHbF5o008018 + (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); + Sat, 21 Jul 2012 13:37:16 -0400 (EDT) +Received: from amthrax by drake.dyndns.org with local (Exim 4.77) + (envelope-from ) + id 1SsdcB-0001Zr-Eg; Sat, 21 Jul 2012 13:37:15 -0400 +From: Austin Clements +To: notmuch@notmuchmail.org +Subject: [PATCH v4 6/8] emacs: Allow custom tags formatting +Date: Sat, 21 Jul 2012 13:37:10 -0400 +Message-Id: <1342892232-5659-7-git-send-email-amdragon@mit.edu> +X-Mailer: git-send-email 1.7.10 +In-Reply-To: <1342892232-5659-1-git-send-email-amdragon@mit.edu> +References: <1341354059-29396-1-git-send-email-amdragon@mit.edu> + <1342892232-5659-1-git-send-email-amdragon@mit.edu> +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFjrCIsWRmVeSWpSXmKPExsUixCmqrHvuBVeAwdrXkhZ79nlZrJ7LY3H9 + 5kxmB2aPu6e5PHbOusvu8WzVLeYA5igum5TUnMyy1CJ9uwSujI5Hs5kKXnNXHGnpYm5gPMHZ + xcjJISFgIvHqwAZmCFtM4sK99WxdjFwcQgL7GCW+ffvECOFsYJQ48/4zC0iVkMAjJom1zfkQ + ibmMEgePPWUFSbAJaEhs27+cEcQWEZCW2Hl3NlicWSBN4nv7W7C4sIC1xN+5d8HiLAKqEvtn + H2IDsXkF7CX2bGhihThDXuLp/T6wOKeAg8SjswegFpdJLO44zDiBkX8BI8MqRtmU3Crd3MTM + nOLUZN3i5MS8vNQiXQu93MwSvdSU0k2MoMBid1HdwTjhkNIhRgEORiUeXgslrgAh1sSy4src + Q4ySHExKorx994FCfEn5KZUZicUZ8UWlOanFhxglOJiVRHg3nQbK8aYkVlalFuXDpKQ5WJTE + eW+k3PQXEkhPLEnNTk0tSC2CycpwcChJ8PIBI0hIsCg1PbUiLTOnBCHNxMEJMpwHaLgYSA1v + cUFibnFmOkT+FKOilDjvv+dACQGQREZpHlwvLPJfMYoDvSLMawDSzgNMGnDdr4AGMwENls4C + G1ySiJCSamAsYQ9vlchgeLpdZO08vh3Lfk2vNWJMsFNIcRTf6JfQmJTXUnAmQKOhOmhD1XrL + S/uz5taq+xxZbMkysWzFx5jnnrtXhnLP+tLr3H17Sey0aBXWM8qO12P8Uy42/CzKb1QQ+sG2 + Jpsr03TP7k2Ju3XkIo9JiAgsaJwflfLhqoL8JVeufkE+fiWW4oxEQy3mouJEAMyYE0fXAgAA +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, 21 Jul 2012 17:37:25 -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 7180b9d..d092528 100644 +--- a/emacs/notmuch.el ++++ b/emacs/notmuch.el +@@ -775,11 +775,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