--- /dev/null
+Return-Path: <tomi.ollila@iki.fi>\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 CF9DA6DE1930\r
+ for <notmuch@notmuchmail.org>; Thu, 12 Nov 2015 01:07:17 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.725\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.725 tagged_above=-999 required=5 tests=[AWL=0.073, \r
+ SPF_NEUTRAL=0.652] 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 mOFL7PHa236e for <notmuch@notmuchmail.org>;\r
+ Thu, 12 Nov 2015 01:07:15 -0800 (PST)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+ by arlo.cworth.org (Postfix) with ESMTP id E3B3C6DE192F\r
+ for <notmuch@notmuchmail.org>; Thu, 12 Nov 2015 01:07:14 -0800 (PST)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+ by guru.guru-group.fi (Postfix) with ESMTP id 4742510007F;\r
+ Thu, 12 Nov 2015 11:07:16 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] devel/emacs: add devel/try-emacs-mua.sh\r
+In-Reply-To: <87si4bwrsu.fsf@qmul.ac.uk>\r
+References: <1446390985-20989-1-git-send-email-tomi.ollila@iki.fi>\r
+ <87si4bwrsu.fsf@qmul.ac.uk>\r
+User-Agent: Notmuch/0.21+14~g053baf4 (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-unknown-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+ $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+ !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Thu, 12 Nov 2015 11:07:16 +0200\r
+Message-ID: <m2fv0br3gb.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\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 09:07:18 -0000\r
+\r
+On Thu, Nov 12 2015, Mark Walters <markwalters1009@gmail.com> wrote:\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
+It sure doesn't! Thanks for the review.\r
+\r
+Tomi\r
+\r
+\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
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> https://notmuchmail.org/mailman/listinfo/notmuch\r