[PATCH 1/2] test: Replying to an HTML-only message in emacs
[notmuch-archives.git] / 3d / 91600ae081bb93c3b6fc66287dd27eefa5891b
1 Return-Path: <djcb@djcbsoftware.nl>\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 77669431FBC\r
6         for <notmuch@notmuchmail.org>; Thu, 14 Jan 2010 22:47:18 -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: 1.595\r
10 X-Spam-Level: *\r
11 X-Spam-Status: No, score=1.595 tagged_above=-999 required=5 tests=[AWL=1.594, \r
12         BAYES_50=0.001] 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 czkBgf612ibv for <notmuch@notmuchmail.org>;\r
16         Thu, 14 Jan 2010 22:47:15 -0800 (PST)\r
17 Received: from gw01.mail.saunalahti.fi (gw01.mail.saunalahti.fi\r
18         [195.197.172.115])\r
19         by olra.theworths.org (Postfix) with ESMTP id 7CEFF431FAE\r
20         for <notmuch@notmuchmail.org>; Thu, 14 Jan 2010 22:47:15 -0800 (PST)\r
21 Received: from djcbsoftware.nl (a88-114-93-212.elisa-laajakaista.fi\r
22         [88.114.93.212])\r
23         (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))\r
24         (No client certificate requested)\r
25         by gw01.mail.saunalahti.fi (Postfix) with ESMTP id 30069151707;\r
26         Fri, 15 Jan 2010 08:47:11 +0200 (EET)\r
27 Received: from cthulhu.mindcrime.djcbsoftware.nl (localhost [127.0.0.1])\r
28         by djcbsoftware.nl (Postfix) with ESMTP id 81841456098;\r
29         Fri, 15 Jan 2010 08:47:10 +0200 (EET)\r
30 Date: Fri, 15 Jan 2010 08:47:10 +0200\r
31 Message-ID: <878wbzx3td.wl%djcb@djcbsoftware.nl>\r
32 From: Dirk-Jan C. Binnema <djcb.bulk@gmail.com>\r
33 To: Olly Betts <olly@survex.com>\r
34 In-Reply-To: <slrnhkvo6d.2rf.olly@msgid.survex.com>\r
35 References: <4B4ED7E8.20501@exys.org> <878wc0623y.fsf@exys.org>\r
36         <20100114183854.1d04f111@hikari>\r
37         <87fx68e2am.fsf@yoom.home.cworth.org>\r
38         <slrnhkvo6d.2rf.olly@msgid.survex.com>\r
39 Mail-Reply-To: djcb@djcbsoftware.nl\r
40 User-Agent: Wanderlust/2.15.6 (Almost Unreal) Emacs/23.1 Mule/6.0\r
41         (HANACHIRUSATO)\r
42 Organization: DJCBSoftware\r
43 MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka")\r
44 Content-Type: text/plain; charset=US-ASCII\r
45 Cc: notmuch@notmuchmail.org\r
46 Subject: Re: [notmuch] indexing mail?\r
47 X-BeenThere: notmuch@notmuchmail.org\r
48 X-Mailman-Version: 2.1.13\r
49 Precedence: list\r
50 Reply-To: djcb@djcbsoftware.nl\r
51 List-Id: "Use and development of the notmuch mail system."\r
52         <notmuch.notmuchmail.org>\r
53 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
55 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
56 List-Post: <mailto:notmuch@notmuchmail.org>\r
57 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
58 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
59         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
60 X-List-Received-Date: Fri, 15 Jan 2010 06:47:18 -0000\r
61 \r
62 >>>>> "Olly" == Olly Betts <olly@survex.com> writes:\r
63 \r
64     Olly> On 2010-01-14, Carl Worth wrote:\r
65     >> On Thu, 14 Jan 2010 18:38:54 +0100, Adrian Perez de Castro <aperez@igalia.com> wrote:\r
66     >>> I am using XFS, which always returns DT_UNKNOWN. Taking into account that\r
67     >>> there is a good deal of people using filesystems other than the ones you\r
68     >>> mention, and that other non-linux filesystems may also return DT_UNKNOWN,\r
69     >>> in my opinion there should be a fall-back. I will try to post a patch\r
70     >>> Anytime Soon=E2=84=A2.\r
71     >> \r
72     >> We definitely want the fallback. I can attempt to code it, but I don't\r
73     >> have ready access to an afflicted filesystem, so I'd need help testing\r
74     >> anyway.\r
75     >> \r
76     >> I'd love to see a patch for this bug soon. Be sure to CC me when the\r
77     >> patch is sent and that will help me commit it sooner.\r
78 \r
79     Olly> Not a full patch, but I already posted what this code should look like\r
80     Olly> to handle both systems without d_type, and those which return DT_UNKNOWN:\r
81 \r
82     Olly> http://article.gmane.org/gmane.mail.notmuch.general/1044\r
83 \r
84 I take a slighly different approach in mu:\r
85 \r
86 /* if the file system does not support entry->d_type, we add it ourselves\r
87  * this is slower (extra stat) but at least it works\r
88  */\r
89 static gboolean\r
90 _set_dtype (const char* path, struct dirent *entry)\r
91 {\r
92         struct stat statbuf;\r
93         char fullpath[4096];\r
94         \r
95         snprintf (fullpath, sizeof(fullpath), "%s%c%s",\r
96                   path, G_DIR_SEPARATOR, entry->d_name);\r
97 \r
98         if (stat (fullpath, &statbuf) != 0) {\r
99                 g_warning ("stat failed on %s: %s", fullpath,\r
100                            strerror(errno));\r
101                 return FALSE;\r
102         }\r
103 \r
104         /* we only care about dirs, regular files and links */\r
105         if (S_ISREG (statbuf.st_mode))\r
106                 entry->d_type = DT_REG;\r
107         else if (S_ISDIR (statbuf.st_mode))\r
108                 entry->d_type = DT_DIR;\r
109         else if (S_ISLNK (statbuf.st_mode))\r
110                 entry->d_type = DT_LNK;\r
111         \r
112         return TRUE;\r
113 }\r
114 \r
115 \r
116 and then in some other places:\r
117 \r
118 /* handle FSs that don't support entry->d_type */\r
119 if (entry->d_type == DT_UNKNOWN) \r
120         _set_dtype (dirname, entry);\r
121 \r
122         \r
123 Note, that is untested as of yet.\r
124 \r
125 Best wishes,\r
126 Dirk.\r
127 \r
128 -- \r
129 Dirk-Jan C. Binnema                  Helsinki, Finland\r
130 e:djcb@djcbsoftware.nl           w:www.djcbsoftware.nl\r
131 pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C\r