Re: [RFC PATCH] show: Add support for -format=raw -body=false

Subject: Re: [RFC PATCH] show: Add support for -format=raw -body=false

Date: Mon, 18 Jan 2021 17:58:40 +0000

To: David Bremner, notmuch@notmuchmail.org

Cc:

From: David Edmondson


On Monday, 2021-01-18 at 13:37:08 -04, David Bremner wrote:

> David Edmondson <dme@dme.org> writes:
>
>> Similar to other formats, allow the body to be omitted when outputting
>> raw messages.
>>
>> This can be used by UI code to get the full headers of a message
>> without the need to consume the body, which may be large.
>
> I guess I'm a bit confused why this is for "raw" format, and not
> "text". Are you proposing that we have two ad-hoc output formats for
> consuming by scripts and other tools that don't want JSON or SEXP?

"text" is a strange archaic output format, the rationale for which seems
lost in time :-)

"notmuch show --format=text --body=false id:foo" already works, but
doesn't provide a complete set of headers - it's limited to subject,
from, to, date, *cc, ...

I wanted to get the Autocrypt or Face headers, so ended up using
"--format=raw", but then end up with the entire message, which can be
megabytes large. With the emacs UI, that means pulling all of that data
into a buffer, just to ignore it.

Now, it would be nice to be able to say something like...

notmuch show --format=sexp --body=false \
  --headers=received-by,face,x-face \
  id:foo

...to get some extra headers in the sexp output, but I didn't look at it
yet.

The proposed change seems like a simple, obvious improvement that is
entirely in-line with the existing interface and implementation. Is
there any reason not to do it?

dme.
-- 
Don't you know you're never going to get to France.
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: