Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 056A4431FC1 for ; Fri, 2 Apr 2010 01:53:11 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] autolearn=unavailable Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id INQKLNfBcidq for ; Fri, 2 Apr 2010 01:53:10 -0700 (PDT) Received: from mail-ww0-f53.google.com (mail-ww0-f53.google.com [74.125.82.53]) by olra.theworths.org (Postfix) with ESMTP id 985734196F0 for ; Fri, 2 Apr 2010 01:53:10 -0700 (PDT) Received: by wwb22 with SMTP id 22so1273228wwb.26 for ; Fri, 02 Apr 2010 01:53:09 -0700 (PDT) Received: by 10.216.170.147 with SMTP id p19mr542696wel.129.1270198388550; Fri, 02 Apr 2010 01:53:08 -0700 (PDT) Received: from ut.hh.sledj.net (host83-217-165-81.dsl.vispa.com [83.217.165.81]) by mx.google.com with ESMTPS id g9sm19446874gvc.23.2010.04.02.01.53.05 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 02 Apr 2010 01:53:06 -0700 (PDT) Received: by ut.hh.sledj.net (Postfix, from userid 1000) id 36EBF5941EC; Fri, 2 Apr 2010 09:53:04 +0100 (BST) To: Carl Worth , notmuch In-Reply-To: <87bpe2j2vu.fsf@yoom.home.cworth.org> References: <87oci344n4.fsf@ut.hh.sledj.net> <87bpe2j2vu.fsf@yoom.home.cworth.org> From: David Edmondson Date: Fri, 02 Apr 2010 09:53:04 +0100 Message-ID: <87oci2xmkv.fsf@ut.hh.sledj.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [notmuch] pull request X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Apr 2010 08:53:11 -0000 On Thu, 01 Apr 2010 14:09:57 -0700, Carl Worth wrote: > On Thu, 01 Apr 2010 15:41:03 +0100, David Edmondson wrote: > > Carl, a couple of patches that I'd like you to consider. They are the > > first two on the `dme' branch of git://github.com/dme/notmuch.git. The updated changes are on the 'dme-for-cworth' branch now. > > http://github.com/dme/notmuch/commit/f86254e4509ed02731aa3eaa8541df1f2d11e400 > > > notmuch-show: Add unix and pretty dates to the JSON output > > > > > > Include a 'date_unix' and 'date_pretty' field in the JSON output for > > > each message. 'date_pretty' can be used by a UI implementation, > > > whereas 'date_unix' is useful when scripting. > > With "date_unix" it's easy enough to guess what the value is. But > "date_pretty" is much more ambiguous. I assumed that this would be an > RFC 822 date string, (but then found that it's the relative date that > "notmuch show" is using currently). > > I think I'd rather see that named "date_relative", (or dropped with the > expectation that callers can decide how to format dates on their own). I renamed it to 'date_relative'. Keeping the creation of the relative date strings in one place struck me as a good idea - there will consistency between the two places it is used (search mode and show mode) and if the `notmuch' command is localised the Emacs UI will immediately benefit. > > > The search terms should match only a single message > > > (e.g. id:foo@bar.com). The part number specified refers to the part > > > identifiers output by `notmuch show'. The content of the part is written > > > the stdout with no formatting or identification marks. It is not JSON > > > formatted. > > The above documentation isn't quite complete to me. Is MIME decoding > handled by this or not? Also, the documentation says the search terms > "should match" only one message, but what does the implementation do if > more than one message is matched? It would be good to document that as > well. > > More significantly, this level of documentation needs to be put into the > "notmuch help" output (instead of the placeholder that's there in the > current patch). It also needs to be added to the man page in > notmuch.1. The documentation is updated. Sorry for being lazy. > > The second of these (part) has been the topic of some > > discussion. There's a suggestion that a 'cat' subcommand or > > '--format=raw' option to the 'show' subcommand would be better. I'm not > > particular preference - I just wanted the functionality to use in the > > Emacs UI. > > One other approach that I imagined with the json output would be to > simply include all of the MIME parts of all messages directly in the > json-format output from "notmuch show". Does json have any particular > way of encodign a binary blob? If not, should we just have one single > encoding here? (Such as BASE64 within a json string?) I'm sure that JSON could express the blob. There were two reasons that I decided not to include the full message in the JSON output: - some of the parts can be very large, causing Emacs to spend considerably time loading the part (and consume a bunch of memory). This would be particularly noticeable in a thread where many of the messages include large parts - the UI will load all of the parts, even if you've already seen the message. - there are some parts that the UI will probably never display inline usefully (OpenOffice?). For those parts it's quite wasteful to have the UI pull them in. There's obviously a compromise to be had. If we agreed to include text/html parts in the JSON output it would make sense to me - maybe all text/* parts should be there. There are probably others that would be useful. The later 'display all parts' version of notmuch-show is able to use either inline or external content to display parts (it uses that included in the JSON output if present). dme. -- David Edmondson, http://dme.org