[notmuch] [PATCH -V3] notmuch.el: Support for customizing search result display
[notmuch-archives.git] / ae / 4ed526e3e2aa1c8178521e49b7b888a3f0d3cf
1 Return-Path: <cworth@cworth.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 E7658431FBF;\r
6         Sun, 22 Nov 2009 21:12:24 -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 sIhKERtLN4Rd; Sun, 22 Nov 2009 21:12:24 -0800 (PST)\r
11 Received: from cworth.org (localhost [127.0.0.1])\r
12         by olra.theworths.org (Postfix) with ESMTP id 7F1AD431FAE;\r
13         Sun, 22 Nov 2009 21:12:23 -0800 (PST)\r
14 From: Carl Worth <cworth@cworth.org>\r
15 To: Adrian Perez <aperez@igalia.com>, notmuch@notmuchmail.org\r
16 In-Reply-To: <1258937675-31405-1-git-send-email-aperez@igalia.com>\r
17 References: <1258937675-31405-1-git-send-email-aperez@igalia.com>\r
18 Date: Mon, 23 Nov 2009 06:12:09 +0100\r
19 Message-ID: <87d439g6za.fsf@yoom.home.cworth.org>\r
20 MIME-Version: 1.0\r
21 Content-Type: text/plain; charset=us-ascii\r
22 Subject: Re: [notmuch] [PATCH] ANSI escapes in "new" only when output is a\r
23  tty\r
24 X-BeenThere: notmuch@notmuchmail.org\r
25 X-Mailman-Version: 2.1.12\r
26 Precedence: list\r
27 List-Id: "Use and development of the notmuch mail system."\r
28         <notmuch.notmuchmail.org>\r
29 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
30         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
31 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
32 List-Post: <mailto:notmuch@notmuchmail.org>\r
33 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
34 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
35         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
36 X-List-Received-Date: Mon, 23 Nov 2009 05:12:25 -0000\r
37 \r
38 On Mon, 23 Nov 2009 01:54:35 +0100, Adrian Perez <aperez@igalia.com> wrote:\r
39 > When running "notmuch new --verbose", ANSI escapes are used. This may not be\r
40 > desirable when the output of the command is *not* being sent to a terminal\r
41 > (e.g. when piping output into another command). In that case each file\r
42 > processed is printed in a new line and ANSI escapes are not used at\r
43 > all.\r
44 \r
45 I've pushed this now.\r
46 \r
47 And I've noticed two things with it:\r
48 \r
49 1. The filenames are often quite long, and if longer than my terminal\r
50 width, then I get one line per output rather than one line continually\r
51 erased and reprinted. Any good idea about how to fix that without going\r
52 too crazy?\r
53 \r
54 2. On any run after the first, the output says "1/0", "2/0", etc.\r
55 So we should fix that to either not print the "/0" when total_messages\r
56 is 0 *or* we can just make "notmuch new" unconditionally count the\r
57 number of files to be processed, (which I've been thinking I wanted to\r
58 do anyway).\r
59 \r
60 I'm trying to eliminate any remaining differences between "notmuch new"\r
61 on an initial run and "notmuch new" run later. An important reason to\r
62 eliminate these differences is that we want to support the user\r
63 interrupting the initial database build and then starting it up again\r
64 without losing anything.\r
65 \r
66 Besides the file counting, (which would only make such a user lose the\r
67 countdown timer on the subsequent runs), the only other thing we have\r
68 different about the first run is that it doesn't ignore read-only\r
69 directories. And that one's a problem because it means that if someone\r
70 (like me) that has a bunch of read-only directories does the following:\r
71 \r
72       notmuch dump notmuch.dump\r
73       rm -rf ~/mail/notmuch\r
74       notmuch new # then interrupt this with control-C\r
75       notmuch new # oops! This missed most of my mail\r
76       notmuch restore notmuch.dump\r
77 \r
78 Things go badly wrong here as any mail in read-only directories that\r
79 didn't get picked up in the first "notmuch new" run will forever more be\r
80 ignored by notmuch new.\r
81 \r
82 So that's totally broken and we should come up with a way to fix it.\r
83 \r
84 -Carl\r