From: David Bremner <david@tethera.net>
To: Tomi Ollila <tomi.ollila@iki.fi>,
Vladimir Panteleev <notmuch@thecybershadow.net>,
notmuch@notmuchmail.org
Subject: Re: [PATCH] test/crypto: remove headers more robustly
Date: Sun, 03 Sep 2017 08:13:50 -0300 [thread overview]
Message-ID: <87a82cyqz5.fsf@tethera.net> (raw)
In-Reply-To: <m21sno7ufr.fsf@guru.guru-group.fi>
Tomi Ollila <tomi.ollila@iki.fi> writes:
> On Fri, Sep 01 2017, David Bremner wrote:
>
>> In [1], Vladimir Panteleev observed that the In-Reply-To and
>> References headers could be wrapped in the 'default' output format of
>> notmuch-reply, depending on the version of Emacs creating the
>> message. In my own experiments notmuch-reply sometimes wraps headers
>> with only one message-id if that message-id is long enough. However it
>> happens, this causes the previous approach using grep to fail.
>
> we could (also) make emacs think it has wider than 80 characters to fit on
> one line...
>
>> Since I found the proposed unwrapping shell fragment in [1] a bit hard
>> to follow, I decided to write a little python script instead.
>
> There was nothing hard in that shell construct ;), but I also thought some
> alternative solutions (one in awk and one in perl)
>
> How 'bout
>
> drop_email_headers ()
> {
> $NOTMUCH_PYTHON -c 'import email, sys
> msg = email.message_from_file(sys.stdin)
> for hdr in sys.argv: msg.pop(hdr, None)
> print(msg.as_string(False))'
> }
>
> and then ... | drop_email_headers In-Reply-To References
I pushed something like this. 'pop' doesn't seem to exist? Also I needed
to pass $* in to the python script. Maybe that should be "${@}", but
there really should not be spaces in header names.
d
next prev parent reply other threads:[~2017-09-03 11:14 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-17 17:51 [PATCH 0/7] Travis and test suite improvements Vladimir Panteleev
2017-08-17 17:51 ` [PATCH 1/7] .travis.yml: Invoke `make download-test-databases' before running tests Vladimir Panteleev
2017-08-17 17:51 ` [PATCH 2/7] .travis.yml: Add gdb and gpgsm dependencies Vladimir Panteleev
2017-08-17 17:51 ` [PATCH 3/7] .travis.yml: Replace manual zlib installation with "dist: trusty" Vladimir Panteleev
2017-08-17 17:51 ` [PATCH 4/7] test: Fix T050-new.sh on some Travis CI machines Vladimir Panteleev
2017-08-17 17:51 ` [PATCH 5/7] .travis.yml: Switch to "sudo: false" for faster builds Vladimir Panteleev
2017-08-17 17:51 ` [PATCH 6/7] test: Fix T350-crypto.sh on Emacs snapshots Vladimir Panteleev
2017-09-02 0:11 ` [PATCH] test/crypto: remove headers more robustly David Bremner
2017-09-02 19:48 ` Tomi Ollila
2017-09-03 11:13 ` David Bremner [this message]
2017-08-17 17:51 ` [PATCH 7/7] .travis.yml: Test against several Emacs versions Vladimir Panteleev
2017-09-02 0:41 ` David Bremner
2017-09-04 21:31 ` Vladimir Panteleev
2017-08-30 23:19 ` [PATCH 0/7] Travis and test suite improvements David Bremner
2017-08-30 23:22 ` David Bremner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a82cyqz5.fsf@tethera.net \
--to=david@tethera.net \
--cc=notmuch@notmuchmail.org \
--cc=notmuch@thecybershadow.net \
--cc=tomi.ollila@iki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).