From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
To: Notmuch Mail <notmuch@notmuchmail.org>
Subject: [PATCH 08/12] tests: emacs_fcc_message: allow passing --arguments to notmuch new
Date: Fri, 20 Oct 2017 22:25:45 -0400 [thread overview]
Message-ID: <20171021022549.2724-9-dkg@fifthhorseman.net> (raw)
In-Reply-To: <20171021022549.2724-1-dkg@fifthhorseman.net>
Subsequent patches may want to send GNU-style --long-arguments to
notmuch new in the test suite, in particular when invoking
emacs_fcc_message. This changeset makes that possible.
---
test/test-lib.sh | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/test/test-lib.sh b/test/test-lib.sh
index 4619c327..01891bf8 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -349,8 +349,17 @@ emacs_deliver_message ()
# Accepts arbitrary extra emacs/elisp functions to modify the message
# before sending, which is useful to doing things like attaching files
# to the message and encrypting/signing.
+#
+# If any GNU-style long-arguments (like --quiet or --try-decrypt=true) are
+# at the head of the argument list, they are sent directly to "notmuch
+# new" after message delivery
emacs_fcc_message ()
{
+ local nmn_args=''
+ while [[ "$1" =~ ^-- ]]; do
+ nmn_args="$nmn_args $1"
+ shift
+ done
local subject="$1"
local body="$2"
shift 2
@@ -369,7 +378,7 @@ emacs_fcc_message ()
(insert \"${body}\")
$@
(notmuch-mua-send-and-exit))" || return 1
- notmuch new >/dev/null
+ notmuch new $nmn_args >/dev/null
}
# Add an existing, fixed corpus of email to the database.
--
2.14.2
next prev parent reply other threads:[~2017-10-21 2:26 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-21 2:25 cleartext indexing, revision 7 Daniel Kahn Gillmor
2017-10-21 2:25 ` [PATCH 01/12] index: implement notmuch_indexopts_t with try_decrypt Daniel Kahn Gillmor
2017-10-21 2:25 ` [PATCH 02/12] doc: add notmuch-properties(7) Daniel Kahn Gillmor
2017-10-21 2:25 ` [PATCH 03/12] reindex: drop all properties named with prefix "index." Daniel Kahn Gillmor
2017-10-21 2:25 ` [PATCH 04/12] crypto: index encrypted parts when indexopts try_decrypt is set Daniel Kahn Gillmor
2017-10-21 2:25 ` [PATCH 05/12] config: test whether an item is stored in the database by name Daniel Kahn Gillmor
2017-10-21 2:25 ` [PATCH 06/12] config: define new option index.try_decrypt Daniel Kahn Gillmor
2017-10-21 2:25 ` [PATCH 07/12] cli: set up shared command-line arguments for indexing Daniel Kahn Gillmor
2017-10-21 2:25 ` Daniel Kahn Gillmor [this message]
2017-10-21 2:25 ` [PATCH 09/12] cli/new: add --try-decrypt=(true|false) Daniel Kahn Gillmor
2017-10-21 2:25 ` [PATCH 10/12] cli/insert: " Daniel Kahn Gillmor
2017-10-21 2:25 ` [PATCH 11/12] cli/reindex: " Daniel Kahn Gillmor
2017-10-21 2:25 ` [PATCH 12/12] python: add try_decrypt argument to Database.index_file() Daniel Kahn Gillmor
2017-10-25 5:47 ` Daniel Kahn Gillmor
2017-10-22 0:02 ` cleartext indexing, revision 7 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=20171021022549.2724-9-dkg@fifthhorseman.net \
--to=dkg@fifthhorseman.net \
--cc=notmuch@notmuchmail.org \
/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).