1 Return-Path: <jan@ryngle.com>
\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 6BE6B431FBC
\r
6 for <notmuch@notmuchmail.org>; Wed, 25 Nov 2009 15:48:27 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 Received: from olra.theworths.org ([127.0.0.1])
\r
9 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
10 with ESMTP id D4+BtfR8g-2q for <notmuch@notmuchmail.org>;
\r
11 Wed, 25 Nov 2009 15:48:26 -0800 (PST)
\r
12 Received: from mail-ew0-f213.google.com (mail-ew0-f213.google.com
\r
14 by olra.theworths.org (Postfix) with ESMTP id 6070E431FAE
\r
15 for <notmuch@notmuchmail.org>; Wed, 25 Nov 2009 15:48:26 -0800 (PST)
\r
16 Received: by ewy5 with SMTP id 5so269346ewy.30
\r
17 for <notmuch@notmuchmail.org>; Wed, 25 Nov 2009 15:48:25 -0800 (PST)
\r
18 Received: by 10.213.0.135 with SMTP id 7mr7420766ebb.64.1259192905411;
\r
19 Wed, 25 Nov 2009 15:48:25 -0800 (PST)
\r
20 Received: from x61s.janakj ([213.192.30.141])
\r
21 by mx.google.com with ESMTPS id 10sm347473eyz.15.2009.11.25.15.48.23
\r
22 (version=TLSv1/SSLv3 cipher=RC4-MD5);
\r
23 Wed, 25 Nov 2009 15:48:24 -0800 (PST)
\r
24 Received: by x61s.janakj (Postfix, from userid 1000)
\r
25 id 78DA5440655; Thu, 26 Nov 2009 00:48:22 +0100 (CET)
\r
26 Date: Thu, 26 Nov 2009 00:48:22 +0100
\r
27 From: Jan Janak <jan@ryngle.com>
\r
28 To: notmuch@notmuchmail.org
\r
29 Message-ID: <20091125234822.GH25119@ryngle.com>
\r
30 References: <1259100630-13673-1-git-send-email-jan@ryngle.com>
\r
32 Content-Type: text/plain; charset=us-ascii
\r
33 Content-Disposition: inline
\r
34 In-Reply-To: <1259100630-13673-1-git-send-email-jan@ryngle.com>
\r
35 User-Agent: Mutt/1.5.18 (2008-05-17)
\r
36 Subject: Re: [notmuch] [PATCH 0/4] Make tags applied by 'notmuch new'
\r
38 X-BeenThere: notmuch@notmuchmail.org
\r
39 X-Mailman-Version: 2.1.12
\r
41 List-Id: "Use and development of the notmuch mail system."
\r
42 <notmuch.notmuchmail.org>
\r
43 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
44 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
45 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
46 List-Post: <mailto:notmuch@notmuchmail.org>
\r
47 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
48 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
49 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
50 X-List-Received-Date: Wed, 25 Nov 2009 23:48:27 -0000
\r
54 On 24-11 23:10, Jan Janak wrote:
\r
55 > I would like to propose that we make the list of tags applied by 'notmuch new'
\r
56 > configurable. Right now notmuch applies two tags to all new messages added to
\r
57 > the database, 'inbox' and 'unread'. The two tags are added by the C code in
\r
58 > notmuch-new.c and they cannot be changed without editing the source file and
\r
59 > recompiling notmuch.
\r
61 > The four patches that follow this email allow for configuring the tags to be
\r
62 > added by 'notmuch new' either in the configuration file or on the command
\r
65 > This change was motivated by my desire to remove both tags from newly added
\r
66 > messages. My rules for adding these two tags are more complex and I do it in
\r
67 > a script run after 'notmuch new'. Instead of 'inbox' and 'unread', I configure
\r
68 > 'notmuch new' to add a new tag called 'new' (and only that one). This tag
\r
69 > marks newly added messages that haven't been properly tagged yet by my
\r
70 > auto-tagging scripts. The last script I run after 'notmuch new' removes that
\r
71 > tag. My auto-tagging scripts process only messages with the tag 'new'.
\r
73 > On a side note; It may seem logical to add/omit the tag 'unread' directly in
\r
74 > 'notmuch new' based on the Maildir flags extracted from the filename of the
\r
75 > message. I suggest that we don't do that in 'notmuch new'. A better way would
\r
76 > be writing a small script or command that can be run *after* 'notmuch new'.
\r
77 > We could then distribute it with notmuch (maybe with other small tagging
\r
78 > scripts for common situations).
\r
80 > I think Maildir flags should be processed after 'notmuch new' is because if
\r
81 > there are multiple copies of a message with different flags, we may need to
\r
82 > see all flags from all filenames to set corresponding tags properly and we may
\r
83 > also need to take the directory part into consideration (i.e. the new mail is
\r
84 > in 'new', not 'cur').
\r
86 > The list of tags to be applied by notmuch can be configured in the
\r
87 > configuration file. There is a new section [new] which contains configuration
\r
88 > options for 'notmuch new'. There is only one option called 'tags'. The option
\r
89 > contains a semicolon separated list of tags:
\r
92 > tags=inbox;unread # Emulate the original behavior
\r
94 > One of the patches updates 'notmuch setup' to create the section and add
\r
95 > the tags option with tags 'inbox' and 'unread', but only if a new
\r
96 > configuration file is being created. If the configuration file already exists
\r
97 > then it just copies the contents from the old configuration file to the new
\r
100 > We do not ask the user for the list of tags in the interactive part, that would
\r
101 > have been too much. Users can edit the configuration file manually if they want
\r
102 > to change the list of tags. If they create a new configuration file then they
\r
103 > probably want to accept the default anyway.
\r
105 > There is one catch for users who already have a configuration file and start
\r
106 > using the patches. They will need to add the new section and the tags option
\r
107 > manually if they want to preserve current behavior of applying 'inbox' and
\r
108 > 'unread' automatically by 'notmuch new'.
\r
110 > The last patch in the set adds a new command line option to 'notmuch new'.
\r
111 > The name of the option is --tag and it can be used to override any tags
\r
112 > configured in the configuration file. For example:
\r
114 > notmuch new --tag=outbox --tag=read
\r
116 > adds the tags 'outbox' and 'read' and ignores any tags from the configuration
\r
119 > Comments and opinions are welcome!
\r
121 I updated this patch series, adding features and bug fixes suggested by others
\r
124 The command line option --tag now *adds* tags, so the tags configured in the
\r
125 configuration file are still applied...unless you use the new option
\r
126 --no-config-tag. With this option only the tags specified on the command line
\r
127 will be applied by 'notmuch-new'.
\r