Re: [PATCH v4 01/16] add util/search-path.{c, h} to test for executables in $PATH
[notmuch-archives.git] / 7b / 37e68741913a8d2a051ad59ec5dfbb5e539821
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 3033B431FBF\r
6         for <notmuch@notmuchmail.org>; Tue, 24 Nov 2009 14:10:36 -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 E1nKBnS1gPu7 for <notmuch@notmuchmail.org>;\r
11         Tue, 24 Nov 2009 14:10:33 -0800 (PST)\r
12 Received: from mail-fx0-f214.google.com (mail-fx0-f214.google.com\r
13         [209.85.220.214])\r
14         by olra.theworths.org (Postfix) with ESMTP id A97F1431FAE\r
15         for <notmuch@notmuchmail.org>; Tue, 24 Nov 2009 14:10:33 -0800 (PST)\r
16 Received: by fxm6 with SMTP id 6so7397311fxm.0\r
17         for <notmuch@notmuchmail.org>; Tue, 24 Nov 2009 14:10:32 -0800 (PST)\r
18 Received: by 10.102.14.4 with SMTP id 4mr3091420mun.2.1259100632770;\r
19         Tue, 24 Nov 2009 14:10:32 -0800 (PST)\r
20 Received: from x61s.janakj (r2c34.net.upc.cz [62.245.66.34])\r
21         by mx.google.com with ESMTPS id 14sm109259muo.34.2009.11.24.14.10.31\r
22         (version=TLSv1/SSLv3 cipher=RC4-MD5);\r
23         Tue, 24 Nov 2009 14:10:31 -0800 (PST)\r
24 Received: by x61s.janakj (Postfix, from userid 1000)\r
25         id 9A4B0440651; Tue, 24 Nov 2009 23:10:30 +0100 (CET)\r
26 From: Jan Janak <jan@ryngle.com>\r
27 To: notmuch@notmuchmail.org\r
28 Date: Tue, 24 Nov 2009 23:10:26 +0100\r
29 Message-Id: <1259100630-13673-1-git-send-email-jan@ryngle.com>\r
30 X-Mailer: git-send-email 1.6.3.3\r
31 Subject: [notmuch] [PATCH 0/4] Make tags applied by 'notmuch new'\r
32         configurable.\r
33 X-BeenThere: notmuch@notmuchmail.org\r
34 X-Mailman-Version: 2.1.12\r
35 Precedence: list\r
36 List-Id: "Use and development of the notmuch mail system."\r
37         <notmuch.notmuchmail.org>\r
38 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
39         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
40 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
41 List-Post: <mailto:notmuch@notmuchmail.org>\r
42 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
43 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
44         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
45 X-List-Received-Date: Tue, 24 Nov 2009 22:10:36 -0000\r
46 \r
47 I would like to propose that we make the list of tags applied by 'notmuch new'\r
48 configurable. Right now notmuch applies two tags to all new messages added to\r
49 the database, 'inbox' and 'unread'. The two tags are added by the C code in\r
50 notmuch-new.c and they cannot be changed without editing the source file and\r
51 recompiling notmuch.\r
52 \r
53 The four patches that follow this email allow for configuring the tags to be\r
54 added by 'notmuch new' either in the configuration file or on the command\r
55 line.\r
56 \r
57 This change was motivated by my desire to remove both tags from newly added\r
58 messages. My rules for adding these two tags are more complex and I do it in\r
59 a script run after 'notmuch new'. Instead of 'inbox' and 'unread', I configure\r
60 'notmuch new' to add a new tag called 'new' (and only that one). This tag\r
61 marks newly added messages that haven't been properly tagged yet by my \r
62 auto-tagging scripts. The last script I run after 'notmuch new' removes that\r
63 tag. My auto-tagging scripts process only messages with the tag 'new'.\r
64 \r
65 On a side note; It may seem logical to add/omit the tag 'unread' directly in \r
66 'notmuch new' based on the Maildir flags extracted from the filename of the\r
67 message. I suggest that we don't do that in 'notmuch new'. A better way would\r
68 be writing a small script or command that can be run *after* 'notmuch new'.\r
69 We could then distribute it with notmuch (maybe with other small tagging\r
70 scripts for common situations). \r
71 \r
72 I think Maildir flags should be processed after 'notmuch new' is because if\r
73 there are multiple copies of a message with different flags, we may need to\r
74 see all flags from all filenames to set corresponding tags properly and we may\r
75 also need to take the directory part into consideration (i.e. the new mail is\r
76 in 'new', not 'cur').\r
77 \r
78 The list of tags to be applied by notmuch can be configured in the\r
79 configuration file. There is a new section [new] which contains configuration\r
80 options for 'notmuch new'. There is only one option called 'tags'. The option\r
81 contains a semicolon separated list of tags:\r
82 \r
83   [new]\r
84   tags=inbox;unread  # Emulate the original behavior\r
85 \r
86 One of the patches updates 'notmuch setup' to create the section and add\r
87 the tags option with tags 'inbox' and 'unread', but only if a new\r
88 configuration file is being created. If the configuration file already exists\r
89 then it just copies the contents from the old configuration file to the new\r
90 one.\r
91 \r
92 We do not ask the user for the list of tags in the interactive part, that would\r
93 have been too much. Users can edit the configuration file manually if they want\r
94 to change the list of tags. If they create a new configuration file then they\r
95 probably want to accept the default anyway.\r
96 \r
97 There is one catch for users who already have a configuration file and start\r
98 using the patches. They will need to add the new section and the tags option\r
99 manually if they want to preserve current behavior of applying 'inbox' and\r
100 'unread' automatically by 'notmuch new'.\r
101 \r
102 The last patch in the set adds a new command line option to 'notmuch new'.\r
103 The name of the option is --tag and it can be used to override any tags\r
104 configured in the configuration file. For example:\r
105 \r
106   notmuch new --tag=outbox --tag=read\r
107 \r
108 adds the tags 'outbox' and 'read' and ignores any tags from the configuration\r
109 file.\r
110 \r
111 Comments and opinions are welcome!\r
112 \r
113    -- Jan\r