[PATCH] configure: add --without-api-docs option
[notmuch-archives.git] / c1 / 212a3401274cc78e263e55fb3e05942b9ef03e
1 Return-Path: <jrollins@finestructure.net>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 3C24F431FBD\r
6         for <notmuch@notmuchmail.org>; Thu,  4 Feb 2010 16:38:22 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -2.976\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.976 tagged_above=-999 required=5\r
12         tests=[AWL=-0.377, BAYES_00=-2.599] autolearn=ham\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id xM9bvqegwjPU for <notmuch@notmuchmail.org>;\r
16         Thu,  4 Feb 2010 16:38:21 -0800 (PST)\r
17 Received: from tarap.cc.columbia.edu (tarap.cc.columbia.edu [128.59.29.7])\r
18         by olra.theworths.org (Postfix) with ESMTP id 86E08431FAE\r
19         for <notmuch@notmuchmail.org>; Thu,  4 Feb 2010 16:38:21 -0800 (PST)\r
20 Received: from servo.finestructure.net (geco.phys.columbia.edu\r
21         [128.59.170.159])\r
22         (user=jgr2110 author=jrollins@finestructure.net mech=PLAIN bits=0)\r
23         by tarap.cc.columbia.edu (8.14.3/8.14.3) with ESMTP id o150cKHD021997\r
24         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT)\r
25         for <notmuch@notmuchmail.org>; Thu, 4 Feb 2010 19:38:20 -0500 (EST)\r
26 Received: from jrollins by servo.finestructure.net with local (Exim 4.71)\r
27         (envelope-from <jrollins@finestructure.net>) id 1NdCDE-000288-63\r
28         for notmuch@notmuchmail.org; Thu, 04 Feb 2010 19:38:20 -0500\r
29 From: Jameson Graef Rollins <jrollins@finestructure.net>\r
30 To: Notmuch Mail <notmuch@notmuchmail.org>\r
31 In-Reply-To: <87aavpb3wh.fsf@servo.finestructure.net>\r
32 References: <87aavpb3wh.fsf@servo.finestructure.net>\r
33 Date: Thu, 04 Feb 2010 19:38:20 -0500\r
34 Message-ID: <87r5p01pqb.fsf@servo.finestructure.net>\r
35 MIME-Version: 1.0\r
36 Content-Type: text/plain; charset=us-ascii\r
37 X-No-Spam-Score: Local\r
38 X-Scanned-By: MIMEDefang 2.68 on 128.59.29.7\r
39 Subject: [notmuch] [PATCHv2] notmuch.el: colorize lines in notmuch-search\r
40         based on thread tags.\r
41 X-BeenThere: notmuch@notmuchmail.org\r
42 X-Mailman-Version: 2.1.13\r
43 Precedence: list\r
44 List-Id: "Use and development of the notmuch mail system."\r
45         <notmuch.notmuchmail.org>\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
47         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
49 List-Post: <mailto:notmuch@notmuchmail.org>\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
52         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
53 X-List-Received-Date: Fri, 05 Feb 2010 00:38:22 -0000\r
54 \r
55 Arbitrary font faces can be specified for given thread tags.  By\r
56 default, no coloring is applied.  To specify coloring, place something\r
57 like this in your .emacs:\r
58 \r
59 (setq notmuch-search-line-faces '(("delete" . (:foreground "red"))\r
60                                   ("unread" . (:foreground "green"))))\r
61 \r
62 Order matters: line faces listed first will take precedence (in the\r
63 example above, a thread tagged both "delete" and "unread" will be\r
64 colored red, since the "delete" face is listed before the "unread").\r
65 ---\r
66  notmuch.el |   34 +++++++++++++++++++++++++++++++++-\r
67  1 files changed, 33 insertions(+), 1 deletions(-)\r
68 \r
69 diff --git a/notmuch.el b/notmuch.el\r
70 index a21c6a6..6c42b37 100644\r
71 --- a/notmuch.el\r
72 +++ b/notmuch.el\r
73 @@ -1203,6 +1203,36 @@ This function advances the next thread when finished."\r
74                             (insert (format " (process returned %d)" exit-status)))\r
75                         (insert "\n"))))))))))\r
76  \r
77 +(defcustom notmuch-search-line-faces\r
78 +  '(("delete" . (:foreground "DarkGrey")))\r
79 +  "Tag/face mapping for line highlighting in notmuch-search.\r
80 +\r
81 +Here is an example of how to color search results based on tags.\r
82 +(the following text would be placed in your ~/.emacs file):\r
83 +\r
84 +(setq notmuch-search-line-faces '((\"delete\" . (:foreground \"red\"))\r
85 +                                 (\"unread\" . (:foreground \"green\"))))\r
86 +\r
87 +Order matters: for lines with multiple tags, the the first\r
88 +matching will be applied."\r
89 +  :type '(alist :value-type (string face))\r
90 +  :group 'notmuch)\r
91 +\r
92 +(defun notmuch-search-color-line (start end line-tag-list)\r
93 +  "Colorize lines in notmuch-search based on tags"\r
94 +  (if notmuch-search-line-faces\r
95 +      (let ((overlay (make-overlay start end))\r
96 +           (tags-faces (copy-alist notmuch-search-line-faces)))\r
97 +       (while tags-faces\r
98 +         (let* ((tag-face (car tags-faces))\r
99 +                (tag (car tag-face))\r
100 +                (face (cdr tag-face)))\r
101 +           (cond ((member tag line-tag-list)\r
102 +                  (overlay-put overlay 'face face)\r
103 +                  (setq tags-faces nil))\r
104 +                 (t\r
105 +                  (setq tags-faces (cdr tags-faces)))))))))\r
106 +\r
107  (defun notmuch-search-process-filter (proc string)\r
108    "Process and filter the output of \"notmuch search\""\r
109    (let ((buffer (process-buffer proc)))\r
110 @@ -1220,12 +1250,14 @@ This function advances the next thread when finished."\r
111                            (authors (match-string 4 string))\r
112                            (authors-length (length authors))\r
113                            (subject (match-string 5 string))\r
114 -                          (tags (match-string 6 string)))\r
115 +                          (tags (match-string 6 string))\r
116 +                          (tag-list (if tags (save-match-data (split-string tags)))))\r
117                       (if (> authors-length 40)\r
118                           (set 'authors (concat (substring authors 0 (- 40 3)) "...")))\r
119                       (goto-char (point-max))\r
120                       (let ((beg (point-marker)))\r
121                         (insert (format "%s %-7s %-40s %s (%s)\n" date count authors subject tags))\r
122 +                       (notmuch-search-color-line beg (point-marker) tag-list)\r
123                         (put-text-property beg (point-marker) 'notmuch-search-thread-id thread-id)\r
124                         (put-text-property beg (point-marker) 'notmuch-search-authors authors)\r
125                         (put-text-property beg (point-marker) 'notmuch-search-subject subject))\r
126 -- \r
127 1.6.5\r