--- /dev/null
+Return-Path: <markwalters1009@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 2C5626DE192D\r
+ for <notmuch@notmuchmail.org>; Thu, 12 Nov 2015 00:22:33 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.169\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.169 tagged_above=-999 required=5 tests=[AWL=0.401,\r
+ DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+ FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7,\r
+ RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001]\r
+ autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id yktzz5ewBwg6 for <notmuch@notmuchmail.org>;\r
+ Thu, 12 Nov 2015 00:22:30 -0800 (PST)\r
+Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com\r
+ [74.125.82.41]) by arlo.cworth.org (Postfix) with ESMTPS id 3AC566DE14F2 for\r
+ <notmuch@notmuchmail.org>; Thu, 12 Nov 2015 00:22:30 -0800 (PST)\r
+Received: by wmec201 with SMTP id c201so20537374wme.0\r
+ for <notmuch@notmuchmail.org>; Thu, 12 Nov 2015 00:22:28 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+ h=from:to:cc:subject:in-reply-to:references:user-agent:date\r
+ :message-id:mime-version:content-type;\r
+ bh=JA/Gabfs+zBTurDeA4YmLhx5RVygsTZ4jyyCRJu4ykM=;\r
+ b=bDmWmG1aT76sYdTF4u8u02WtOdE5QALzpK/VoqPetUbORTha7Mz8rV1DRbJWpFPrc/\r
+ v3yLp5a/Ra5RYCWB9GVW03B54Uwlun/imSzP9zQ6Se9zC46VPTfr1Nr54Itu/2b5kgoV\r
+ LldSyhyU3TjgmHmS/1w7BjdhFzorOWgCp31ak7qJETbVqs5V4pFZTWy+1uQy/BBqjIlZ\r
+ PTjxlLgn/UrBFJJjpPHuRLAZn1Xe9Au3CcS6RYwdaP0jDGu62VWrUI/wuYstU9OBUpZi\r
+ /eEiH+dqr6vI+rFhUC6hedcE/ls3OxxGrOsbfMpvNY4wcVy8+q4PejaTyceWnyg3CijG\r
+ cfFg==\r
+X-Received: by 10.28.47.212 with SMTP id v203mr270743wmv.37.1447316548173;\r
+ Thu, 12 Nov 2015 00:22:28 -0800 (PST)\r
+Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162])\r
+ by smtp.gmail.com with ESMTPSA id ej10sm12236481wjd.32.2015.11.12.00.22.26\r
+ (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+ Thu, 12 Nov 2015 00:22:27 -0800 (PST)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: Tomi Ollila <tomi.ollila@iki.fi>, notmuch@notmuchmail.org\r
+Cc: tomi.ollila@iki.fi\r
+Subject: Re: [PATCH] devel/emacs: add devel/try-emacs-mua.sh\r
+In-Reply-To: <1446390985-20989-1-git-send-email-tomi.ollila@iki.fi>\r
+References: <1446390985-20989-1-git-send-email-tomi.ollila@iki.fi>\r
+User-Agent: Notmuch/0.21~rc1+46~gbcd385e (http://notmuchmail.org) Emacs/23.4.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Thu, 12 Nov 2015 08:22:25 +0000\r
+Message-ID: <87si4bwrsu.fsf@qmul.ac.uk>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 12 Nov 2015 08:22:33 -0000\r
+\r
+\r
+> devel/try-emacs-mua.sh provides an easy way to try and experiment with\r
+> the notmuch emacs client provided in emacs subdirectory of notmuch\r
+> source tree.\r
+>\r
+> User is required to choose whether to run emacs with -q, -Q or neither\r
+> -- and experienced ones may add other command line options, like\r
+> '-f notmuch'.\r
+>\r
+> This script ensures that no .el files are newer than corresponding .elc\r
+> files so that user (/developer!) does not accidentally experiment with\r
+> outdated elisp files. The emacs variable to have the same effect,\r
+> `load-prefer-newer' is not available until emacs 24.4.\r
+>\r
+> The *scratch* buffer is filled with some code user can execute before\r
+> running notmuch code.\r
+\r
+I like this -- a nice simple way to get to a working but uncustomised\r
+test environment.\r
+\r
+I don't know how easy the following would be but one addition that I\r
+would find very useful would be a way to make this use the test\r
+corpus. This would be useful for giving a completely standard\r
+environment for interactive testing, but also for debugging what is\r
+going on when tests fail.\r
+\r
+Of course that is a feature request and should not delay the feature.\r
+\r
+Finally, I think there is a bug: \r
+\r
+\r
+> ---\r
+>\r
+> Addressed David's comments in id:87d1xdtim1.fsf@maritornes.cs.unb.ca\r
+> with 2 updates:\r
+> 1) removed "address completion insinuate"\r
+> 2) added code to initialize package system when using -q or -Q\r
+>\r
+> devel/try-emacs-mua.sh | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++\r
+> 1 file changed, 92 insertions(+)\r
+> create mode 100755 devel/try-emacs-mua.sh\r
+>\r
+> diff --git a/devel/try-emacs-mua.sh b/devel/try-emacs-mua.sh\r
+> new file mode 100755\r
+> index 000000000000..71be152c2346\r
+> --- /dev/null\r
+> +++ b/devel/try-emacs-mua.sh\r
+> @@ -0,0 +1,92 @@\r
+> +#!/bin/sh\r
+> +\r
+> +# This script provides an easy way to try and experiment with the\r
+> +# notmuch emacs client provided in notmuch/emacs directory.\r
+> +\r
+> +set -eu\r
+> +\r
+> +test $# -gt 0 || {\r
+> + exec >&2\r
+> + echo\r
+> + echo "Usage: $0 '' | q | Q [other-emacs-args]"\r
+> + echo\r
+> + printf " $0 %s\n" "'' starts emacs without either -q or -Q option" \\r
+> + "q starts emacs with -q" \\r
+> + "Q starts emacs with -Q"\r
+> + echo\r
+> + echo Note that if there are notmuch-emacs .elc files that are older than\r
+> + echo their corresponding .el files those older .elcs will be removed.\r
+> + echo\r
+> + exit 1\r
+> +}\r
+> +\r
+> +case $1 in '') opt=\r
+> + ;; q | -q) opt=-q\r
+> + ;; Q | -Q) opt=-Q\r
+> + ;; *) echo "option '$1' not '', 'q' nor 'Q'" >&2; exit 1\r
+> +esac\r
+> +shift\r
+> +\r
+> +case $0 in\r
+> + *\"*) echo "'$0' contain one or more '\"'s" >&2; exit 1 ;;\r
+> + */*) d0=${0%/*} ;;\r
+> + *) d0=.\r
+> +esac\r
+> +\r
+> +pwd=$PWD\r
+> +cd "$d0/.."\r
+> +nmd=$PWD\r
+> +emd=$PWD/emacs\r
+> +\r
+> +test -f "$nmd"/emacs/notmuch-lib.el || {\r
+> + echo "Cannot find notmuch-emacs source directory"\r
+> + exit 1\r
+> +}\r
+> +\r
+> +if test -x "$nmd"/notmuch\r
+> +then\r
+> + nmin='\r
+> +To use accompanied notmuch binary from the same source, evaluate\r
+> +(setq exec-path (cons \"'"$nmd"'\" exec-path))\r
+> +Note: Evaluating the above may be followed by unintended database\r
+> +upgrade and getting back to old version may require dump & restore.\r
+> +'\r
+> +else\r
+> + nmin=\r
+> +fi\r
+> +\r
+> +if test "$opt" = '-q' || test "$opt" = '-Q'\r
+> +then\r
+> + pkgin='\r
+> +If you want to use packages (like company from elpa) evaluate\r
+> +(progn (require '\''package) (package-initialize))\r
+> +'\r
+> +else\r
+> + pkgin=\r
+> +fi\r
+\r
+As far as I can see at this point we are in $nmd not $emd so the\r
+following does not delete stale .elc files.\r
+\r
+> +\r
+> +# ensure we don't load .elc files that are older than corresponding .el file\r
+> +# the emacs variable `load-prefer-newer' is not available until emacs 24.4\r
+> +perl -e 'use strict; use warnings;\r
+> +while (<*.elc>) {\r
+> + my $elc = $_; s/elc$/el/;\r
+> + if (-M $_ < -M $elc) {\r
+> + warn "$_ is newer than $elc. Removing $elc\n";\r
+> + unlink $elc or die "Failed to remove '\''$elc'\'': $!\n";\r
+> + }\r
+> +}'\r
+\r
+\r
+Best wishes\r
+\r
+Mark\r
+\r
+> +\r
+> +cd "$pwd"\r
+> +\r
+> +# note: whitespace in $EMACS splits to command and args\r
+> +exec ${EMACS:-emacs} $opt -L "$emd" -l "$emd"/notmuch.el "$@" --eval '\r
+> +(with-current-buffer "*scratch*"\r
+> + (insert "\r
+> +Go to the end of the following lines and type C-x C-e to evaluate\r
+> +(or C-j which is shorter but inserts evaluation results into buffer)\r
+> +\r
+> +To \"disable\" mail sending, evaluate\r
+> +(setq message-send-mail-function (lambda () t))\r
+> +'"$nmin$pkgin"'\r
+> +To start notmuch (hello) screen, evaluate\r
+> +(notmuch-hello)") (set-buffer-modified-p nil))'\r
+> -- \r
+> 2.0.0\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> https://notmuchmail.org/mailman/listinfo/notmuch\r