Re: [feature request] emacs: use `notmuch insert` for FCC
[notmuch-archives.git] / 10 / fcb726649fa2df9cc8ec4ef3538658e95c8b42
1 Return-Path: <sojkam1@fel.cvut.cz>\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 5307A4196F2\r
6         for <notmuch@notmuchmail.org>; Wed, 21 Apr 2010 23:38:59 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -1.9\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5\r
12         tests=[BAYES_00=-1.9] autolearn=unavailable\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 Uwzf2fyqVF5I for <notmuch@notmuchmail.org>;\r
16         Wed, 21 Apr 2010 23:38:57 -0700 (PDT)\r
17 Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36])\r
18         by olra.theworths.org (Postfix) with ESMTP id 5574D431FC1\r
19         for <notmuch@notmuchmail.org>; Wed, 21 Apr 2010 23:38:57 -0700 (PDT)\r
20 Received: from localhost (unknown [192.168.200.4])\r
21         by max.feld.cvut.cz (Postfix) with ESMTP id 8518619F33B8;\r
22         Thu, 22 Apr 2010 08:38:56 +0200 (CEST)\r
23 X-Virus-Scanned: IMAP AMAVIS\r
24 Received: from max.feld.cvut.cz ([192.168.200.1])\r
25         by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new,\r
26         port 10044)\r
27         with ESMTP id COHVWyzCROfp; Thu, 22 Apr 2010 08:38:55 +0200 (CEST)\r
28 Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34])\r
29         by max.feld.cvut.cz (Postfix) with ESMTP id 4CFBB19F339B;\r
30         Thu, 22 Apr 2010 08:38:55 +0200 (CEST)\r
31 Received: from steelpick.2x.cz (k335-30.felk.cvut.cz [147.32.86.30])\r
32         (Authenticated sender: sojkam1)\r
33         by imap.feld.cvut.cz (Postfix) with ESMTPSA id 19C4115C062;\r
34         Thu, 22 Apr 2010 08:38:54 +0200 (CEST)\r
35 Received: from wsh by steelpick.2x.cz with local (Exim 4.71)\r
36         (envelope-from <sojkam1@fel.cvut.cz>)\r
37         id 1O4q3q-0001vm-Cz; Thu, 22 Apr 2010 08:38:54 +0200\r
38 From: Michal Sojka <sojkam1@fel.cvut.cz>\r
39 To: Carl Worth <cworth@cworth.org>\r
40 Subject: Re: [PATCH 1/2] Add 'cat' subcommand\r
41 In-Reply-To: <871ve8wc30.fsf@yoom.home.cworth.org>\r
42 References: <1271747793-17507-1-git-send-email-sojkam1@fel.cvut.cz>\r
43         <87pr1u7fnu.fsf@ut.hh.sledj.net> <87fx2qmtok.fsf@SSpaeth.de>\r
44         <4BCD7EA0.3080505@fel.cvut.cz>\r
45         <871ve8wc30.fsf@yoom.home.cworth.org>\r
46 Date: Thu, 22 Apr 2010 08:38:54 +0200\r
47 Message-ID: <871ve8ng8x.fsf@steelpick.2x.cz>\r
48 MIME-Version: 1.0\r
49 Content-Type: text/plain; charset=us-ascii\r
50 Cc: notmuch@notmuchmail.org\r
51 X-BeenThere: notmuch@notmuchmail.org\r
52 X-Mailman-Version: 2.1.13\r
53 Precedence: list\r
54 List-Id: "Use and development of the notmuch mail system."\r
55         <notmuch.notmuchmail.org>\r
56 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
57         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
58 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
59 List-Post: <mailto:notmuch@notmuchmail.org>\r
60 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
61 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
62         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
63 X-List-Received-Date: Thu, 22 Apr 2010 06:39:00 -0000\r
64 \r
65 On Thu, 22 Apr 2010, Carl Worth wrote:\r
66 > On Tue, 20 Apr 2010 12:14:56 +0200, Michal Sojka <sojkam1@fel.cvut.cz> wrote:\r
67 > > On 20.4.2010 09:21, David Edmondson wrote:\r
68 > >  > I'm puzzled why you chose to pass a filename as the argument to 'cat'\r
69 > >  > rather than a message id (id:foo@bar.com)?\r
70 > > \r
71 > > The reason is that I want be able to distinguish between several \r
72 > > messages with the same id.\r
73\r
74 > All other commands currently accept the generic search terms to specify\r
75 > messages, (even a command like "notmuch reply" for which it would have\r
76 > been natural to accept only a single message).\r
77\r
78 > So I'd prefer to have this command behave just like all others and use\r
79 > the same naming.\r
80\r
81 > The question of how to unambiguously refer to a single file is\r
82 > orthogonal, (and similarly applies to all commands, such as "notmuch\r
83 > tag" etc.). I would recommend supporting a search syntax something like:\r
84\r
85 >       filename:/complete/path/to/file\r
86\r
87 > for that use case. And this should work fine whether the filenames are\r
88 > actual filenames or keys into some abstract file store of some sort.\r
89\r
90 > What do you think?\r
91 \r
92 It sounds reasonable. I looked at the code to see how this could be\r
93 implemented and I have a few questions:\r
94 \r
95 If a filename:dir/file term is present in the query, it will be\r
96 necessary to first query the database for directory:dir to find the\r
97 <directory_ID> and then put in the query\r
98 file-direntry:<directory_ID>:file. This conversion is already\r
99 implemented in _notmuch_database_filename_to_direntry(). Right?\r
100 \r
101 _notmuch_database_filename_to_direntry() requires writable database as\r
102 it creates the directory document if it doesn't exist. This is probably\r
103 not what we want for filename: queries - if the user types the filename\r
104 incorrectly, the nonexisting directory document could be added to the\r
105 database. So I think that _notmuch_database_find_directory_id() should\r
106 be modified to not modify the database. The directory documents should\r
107 be created somewhere else in notmuch new path. Do you agree?\r
108 \r
109 -Michal\r