[PATCH] Clarify usage of `additional_headers' in test/test-lib.sh:generate_message.

Thomas Schwinge thomas at schwinge.name
Thu Jan 27 23:45:35 PST 2011


Hallo!

On Fri, 28 Jan 2011 15:36:25 +1000, Carl Worth <cworth at cworth.org> wrote:
> On Thu, 27 Jan 2011 02:17:21 -0700, Thomas Schwinge <thomas at schwinge.name> wrote:
> > +    # Note that in the way we're setting it above and using it below,
> > +    # `additional_headers' will also serve as the header / body separator
> > +    # (empty line in between).

> I'd even prefer to have the newline explicitly in the HERE document, but
> it's awkward to avoid having the "extra" newline at the end of
> ${additional_headers} the way I'm constructing it incrementally. So just
> documenting the current approach is probably best for now.

Matches my thoughts :-) -- and as it occurs to me right now, doing it in
one here document should be possible like this, if additional_headers is
changed to have the newline *at the beginning* of the string:

    cat <<EOF >"$gen_msg_filename"
    From: ${template[from]}
    To: ${template[to]}
    Message-Id: <${gen_msg_id}>
    Subject: ${template[subject]}
    Date: ${template[date]}${additional_headers}
    
    ${template[body]}
    EOF

Or, of course, we could split the here document: base header,
conditionally (if set at all) additional_headers, new line, body.

If you'd like me to prepare (and test) any of these, please tell.


Grüße,
 Thomas


PS: Didn't know you'd be doing a presentation of notmuch at LCA2011 -- I
saw your announcement on the IRC channel (re live stream) what it was too
late already.  But then, it would have been a rather inconvenient time /
timezone anyways, being based in Germany.  So, how has it been?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20110128/a7d49d4e/attachment.pgp>


More information about the notmuch mailing list