Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / b0 / 4889af6e9e9ea188e784477fdab481db268f62
1 Return-Path: <jani@nikula.org>\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 57E76429E54\r
6         for <notmuch@notmuchmail.org>; Tue, 28 Jun 2011 00:31:52 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
9 X-Spam-Flag: NO\r
10 X-Spam-Score: -0.7\r
11 X-Spam-Level: \r
12 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
13         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id DVe3kOvsNGWy for <notmuch@notmuchmail.org>;\r
17         Tue, 28 Jun 2011 00:31:52 -0700 (PDT)\r
18 Received: from mail-qy0-f174.google.com (mail-qy0-f174.google.com\r
19         [209.85.216.174]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id D3A82429E4E\r
22         for <notmuch@notmuchmail.org>; Tue, 28 Jun 2011 00:31:51 -0700 (PDT)\r
23 Received: by qyk29 with SMTP id 29so2024996qyk.5\r
24         for <notmuch@notmuchmail.org>; Tue, 28 Jun 2011 00:31:51 -0700 (PDT)\r
25 Received: by 10.229.107.21 with SMTP id z21mr5352869qco.187.1309246311042;\r
26         Tue, 28 Jun 2011 00:31:51 -0700 (PDT)\r
27 Received: from localhost (nikula.org [92.243.24.172])\r
28         by mx.google.com with ESMTPS id l36sm4283398qck.31.2011.06.28.00.31.49\r
29         (version=TLSv1/SSLv3 cipher=OTHER);\r
30         Tue, 28 Jun 2011 00:31:50 -0700 (PDT)\r
31 From: Jani Nikula <jani@nikula.org>\r
32 To: notmuch@notmuchmail.org\r
33 Subject: [PATCH 3/4] emacs: Add pseudo saved search to match mail that no\r
34         saved search matches\r
35 Date: Tue, 28 Jun 2011 07:31:31 +0000\r
36 Message-Id:\r
37  <e599ef4e125ba9410bb7fefe3208a39079ba8383.1309244829.git.jani@nikula.org>\r
38 X-Mailer: git-send-email 1.7.1\r
39 In-Reply-To: <cover.1309244829.git.jani@nikula.org>\r
40 References: <cover.1309244829.git.jani@nikula.org>\r
41 In-Reply-To: <cover.1309244829.git.jani@nikula.org>\r
42 References: <cover.1309244829.git.jani@nikula.org>\r
43 X-Mailman-Approved-At: Tue, 28 Jun 2011 10:59:27 -0700\r
44 X-BeenThere: notmuch@notmuchmail.org\r
45 X-Mailman-Version: 2.1.13\r
46 Precedence: list\r
47 List-Id: "Use and development of the notmuch mail system."\r
48         <notmuch.notmuchmail.org>\r
49 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
50         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
51 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
52 List-Post: <mailto:notmuch@notmuchmail.org>\r
53 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
54 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
55         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
56 X-List-Received-Date: Tue, 28 Jun 2011 07:31:52 -0000\r
57 \r
58 Add a pseudo saved search that matches all the mail that no other saved\r
59 search matches. Add new customization option notmuch-saved-searches-nomatch\r
60 to enable and name the pseudo saved search.\r
61 ---\r
62  emacs/notmuch-hello.el |   30 +++++++++++++++++++++++-------\r
63  1 files changed, 23 insertions(+), 7 deletions(-)\r
64 \r
65 diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
66 index 84bce3a..b9c9b01 100644\r
67 --- a/emacs/notmuch-hello.el\r
68 +++ b/emacs/notmuch-hello.el\r
69 @@ -47,6 +47,12 @@\r
70    :type 'boolean\r
71    :group 'notmuch)\r
72  \r
73 +(defcustom notmuch-saved-searches-nomatch nil\r
74 +  "Name of the pseudo saved search that no other saved search matches."\r
75 +  :type '(choice (const :tag "Off" nil)\r
76 +                string)\r
77 +  :group 'notmuch)\r
78 +\r
79  (defvar notmuch-hello-indent 4\r
80    "How much to indent non-headers.")\r
81  \r
82 @@ -363,6 +369,22 @@ Complete list of currently available key bindings:\r
83               (not (member tag notmuch-hello-hide-tags)))\r
84             (process-lines notmuch-command "search-tags")))))\r
85  \r
86 +(defun notmuch-hello-saved-alist ()\r
87 +  (if notmuch-saved-searches\r
88 +      (let ((saved-alist notmuch-saved-searches))\r
89 +       (when notmuch-saved-searches-nomatch\r
90 +         ;; Append the no-match search.\r
91 +         (add-to-list 'saved-alist\r
92 +                      (cons notmuch-saved-searches-nomatch\r
93 +                            (mapconcat (lambda (arg) (concat "(not (" (cdr arg) "))")) notmuch-saved-searches " and ")) t))\r
94 +       ;; Filter out empty saved searches if required.\r
95 +       (if notmuch-show-empty-saved-searches\r
96 +           saved-alist\r
97 +         (loop for elem in saved-alist\r
98 +               if (> (string-to-number (notmuch-saved-search-count (cdr elem))) 0)\r
99 +               collect elem)))\r
100 +    notmuch-saved-searches))\r
101 +\r
102  ;;;###autoload\r
103  (defun notmuch-hello (&optional no-display)\r
104    "Run notmuch and display saved searches, known tags, etc."\r
105 @@ -433,13 +455,7 @@ Complete list of currently available key bindings:\r
106  \r
107      (let ((found-target-pos nil)\r
108           (final-target-pos nil))\r
109 -      (let* ((saved-alist\r
110 -             ;; Filter out empty saved searches if required.\r
111 -             (if notmuch-show-empty-saved-searches\r
112 -                 notmuch-saved-searches\r
113 -               (loop for elem in notmuch-saved-searches\r
114 -                     if (> (string-to-number (notmuch-saved-search-count (cdr elem))) 0)\r
115 -                     collect elem)))\r
116 +      (let* ((saved-alist (notmuch-hello-saved-alist))\r
117              (saved-widest (notmuch-hello-longest-label saved-alist))\r
118              (alltags-alist (if notmuch-show-all-tags-list (notmuch-hello-generate-tag-alist)))\r
119              (alltags-widest (notmuch-hello-longest-label alltags-alist))\r
120 -- \r
121 1.7.1\r
122 \r