--- /dev/null
+Return-Path: <too@guru-group.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 A8BF96DE1734\r
+ for <notmuch@notmuchmail.org>; Sun, 6 Sep 2015 23:49:41 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.199\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.199 tagged_above=-999 required=5 tests=[AWL=0.739, \r
+ RP_MATCHES_RCVD=-0.55, T_HEADER_FROM_DIFFERENT_DOMAINS=0.01]\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 jtJHl5GzHOSj for <notmuch@notmuchmail.org>;\r
+ Sun, 6 Sep 2015 23:49:39 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 201026DE1704\r
+ for <notmuch@notmuchmail.org>; Sun, 6 Sep 2015 23:49:39 -0700 (PDT)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+ id 65549100080; Mon, 7 Sep 2015 09:48:12 +0300 (EEST)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] emacs: add emacs/try-emacs-mua.sh\r
+Date: Mon, 7 Sep 2015 09:48:10 +0300\r
+Message-Id: <1441608490-9413-1-git-send-email-tomi.ollila@iki.fi>\r
+X-Mailer: git-send-email 2.0.0\r
+Cc: tomi.ollila@iki.fi\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.18\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://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: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 07 Sep 2015 06:49:41 -0000\r
+\r
+try-emacs-mua.sh provides an easy way to try and experiment with the\r
+notmuch emacs client provided in emacs subdirectory of notmuch source\r
+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.\r
+\r
+The *scratch* buffer is filled with some code user can execute before\r
+running notmuch code.\r
+---\r
+\r
+I developed this when doing series starting from\r
+ id:1441204482-26509-1-git-send-email-tomi.ollila@iki.fi\r
+and found this useful when testing\r
+ id:1441574945-28437-1-git-send-email-uli@scholler.net\r
+\r
+ emacs/try-emacs-mua.sh | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++\r
+ 1 file changed, 67 insertions(+)\r
+ create mode 100755 emacs/try-emacs-mua.sh\r
+\r
+diff --git a/emacs/try-emacs-mua.sh b/emacs/try-emacs-mua.sh\r
+new file mode 100755\r
+index 000000000000..923137b41de6\r
+--- /dev/null\r
++++ b/emacs/try-emacs-mua.sh\r
+@@ -0,0 +1,68 @@\r
++#!/bin/sh\r
++\r
++# This script provides an easy way to try and experiment with the\r
++# notmuch emacs client provided in this 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
++ 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
++elwd=$PWD\r
++\r
++# ensure we don't load .elc files that are older than corresponding .el file\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
++cd "$pwd"\r
++\r
++# note: whitespace in $EMACS splits to command and args\r
++exec ${EMACS:-emacs} $opt -L "$elwd" -l "$d0"/notmuch.el "$@" --eval '\r
++(with-current-buffer "*scratch*"\r
++ (let ((pdir (expand-file-name "'"$elwd/.."'")))\r
++ (insert "\r
++Go to the end of the following lines and type C-x C-e to evaluate\r
++\r
++To \"disable\" mail sending, evaluate\r
++(setq message-send-mail-function (lambda () t))\r
++\r
++To enable address completion, evaluate\r
++(notmuch-address-message-insinuate)\r
++\r
++To use accompanied notmuch binary from the same source, evaluate\r
++(setq exec-path (cons \"" pdir "\" 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
++To start notmuch (hello) screen, evaluate\r
++(notmuch-hello)")) (set-buffer-modified-p nil))'\r
+-- \r
+2.0.0\r
+\r