[PATCH 08/20] cli/show: emit headers after emitting body

David Bremner david at tethera.net
Fri Jun 15 17:30:21 PDT 2018


Daniel Kahn Gillmor <dkg at fifthhorseman.net> writes:

>  test_begin_subtest "Show message: sexp"
>  add_message "[subject]=\"sexp-show-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[bcc]=\"test_suite+bcc at notmuchmail.org\"" "[reply-to]=\"test_suite+replyto at notmuchmail.org\"" "[body]=\"sexp-show-message\""
>  output=$(notmuch show --format=sexp "sexp-show-message")
> -test_expect_equal "$output" "((((:id \"${gen_msg_id}\" :match t :excluded nil :filename (\"${gen_msg_filename}\") :timestamp 946728000 :date_relative \"2000-01-01\" :tags (\"inbox\" \"unread\") :headers (:Subject \"sexp-show-subject\" :From \"Notmuch Test Suite <test_suite at notmuchmail.org>\" :To \"Notmuch Test Suite <test_suite at notmuchmail.org>\" :Bcc \"test_suite+bcc at notmuchmail.org\" :Reply-To \"test_suite+replyto at notmuchmail.org\" :Date \"Sat, 01 Jan 2000 12:00:00 +0000\") :body ((:id 1 :content-type \"text/plain\" :content \"sexp-show-message\n\"))) ())))"
> +test_expect_equal "$output" "((((:id \"${gen_msg_id}\" :match t :excluded nil :filename (\"${gen_msg_filename}\") :timestamp 946728000 :date_relative \"2000-01-01\" :tags (\"inbox\" \"unread\") :body ((:id 1 :content-type \"text/plain\" :content \"sexp-show-message\n\")) :headers (:Subject \"sexp-show-subject\" :From \"Notmuch Test Suite <test_suite at notmuchmail.org>\" :To \"Notmuch Test Suite <test_suite at notmuchmail.org>\" :Bcc \"test_suite+bcc at notmuchmail.org\" :Reply-To \"test_suite+replyto at notmuchmail.org\" :Date \"Sat, 01 Jan 2000 12:00:00 +0000\")) ())))"

It would be cool if we could canonicalize (sort) these s-expressions,
but I didn't see a nice / easy way to do that. Elisp-wizards feel free
to jump in here...

d


More information about the notmuch mailing list