--- /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 olra.theworths.org (Postfix) with ESMTP id 25915431FC2\r
+ for <notmuch@notmuchmail.org>; Sun, 22 Mar 2015 13:35:41 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 2.438\r
+X-Spam-Level: **\r
+X-Spam-Status: No, score=2.438 tagged_above=-999 required=5\r
+ tests=[DNS_FROM_AHBL_RHSBL=2.438] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id N711mikhzvfh for <notmuch@notmuchmail.org>;\r
+ Sun, 22 Mar 2015 13:35:37 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+ by olra.theworths.org (Postfix) with ESMTP id 33A31431FBF\r
+ for <notmuch@notmuchmail.org>; Sun, 22 Mar 2015 13:35:37 -0700 (PDT)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+ by guru.guru-group.fi (Postfix) with ESMTP id 6D6A7100086;\r
+ Sun, 22 Mar 2015 22:35:12 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] notmuch-emacs-mua: do not create a frame by default\r
+ with --client\r
+In-Reply-To: <1427055269-4742-1-git-send-email-jani@nikula.org>\r
+References: <1427055269-4742-1-git-send-email-jani@nikula.org>\r
+User-Agent: Notmuch/0.19+92~g61c04e8 (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: Sun, 22 Mar 2015 22:35:12 +0200\r
+Message-ID: <m28ueog48v.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.13\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: Sun, 22 Mar 2015 20:35:41 -0000\r
+\r
+On Sun, Mar 22 2015, Jani Nikula <jani@nikula.org> wrote:\r
+\r
+> Make the default behaviour for --client the same as emacsclient\r
+> default: do not create a new frame. Add a new option --create-frame,\r
+> passing the same option to emacsclient to create a frame.\r
+>\r
+> ---\r
+\r
+Changes LGTM.\r
+\r
+Tomi\r
+\r
+>\r
+> With this, 'notmuch-emacs-mua --client' does what I want, which was\r
+> not possible with any combination of options before. Please see if you\r
+> can still do what you want!\r
+> ---\r
+> doc/man1/notmuch-emacs-mua.rst | 14 +++++++++-----\r
+> notmuch-emacs-mua | 29 ++++++++++++++++++++---------\r
+> 2 files changed, 29 insertions(+), 14 deletions(-)\r
+>\r
+> diff --git a/doc/man1/notmuch-emacs-mua.rst b/doc/man1/notmuch-emacs-mua.rst\r
+> index 36b51cdc3b18..e39d9e5fba1f 100644\r
+> --- a/doc/man1/notmuch-emacs-mua.rst\r
+> +++ b/doc/man1/notmuch-emacs-mua.rst\r
+> @@ -18,10 +18,6 @@ Supported options for **notmuch-emacs-mua** include\r
+> ``-h, --help``\r
+> Display help.\r
+> \r
+> - ``--client``\r
+> - Use emacsclient, rather than emacs. This will start\r
+> - an emacs daemon process if necessary.\r
+> -\r
+> ``-s, --subject=``\ <subject>\r
+> Specify the subject of the message.\r
+> \r
+> @@ -38,7 +34,15 @@ Supported options for **notmuch-emacs-mua** include\r
+> Specify a file to include into the body of the message.\r
+> \r
+> ``--no-window-system``\r
+> - Even if a window system is available, use the current terminal\r
+> + Even if a window system is available, use the current terminal.\r
+> +\r
+> + ``--client``\r
+> + Use **emacsclient**, rather than **emacs**. This will start\r
+> + an emacs daemon process if necessary.\r
+> +\r
+> + ``--create-frame``\r
+> + When --client is specified, create a new frame instead of trying\r
+> + to use the current Emacs frame.\r
+> \r
+> ``--print``\r
+> Output the resulting elisp to stdout instead of evaluating it.\r
+> diff --git a/notmuch-emacs-mua b/notmuch-emacs-mua\r
+> index 13f67bee4417..68c2643df581 100755\r
+> --- a/notmuch-emacs-mua\r
+> +++ b/notmuch-emacs-mua\r
+> @@ -31,12 +31,12 @@ EMACS=${EMACS-emacs}\r
+> EMACSCLIENT=${EMACSCLIENT-emacsclient}\r
+> \r
+> PRINT_ONLY=\r
+> +NO_WINDOW=\r
+> USE_EMACSCLIENT=\r
+> -CLIENT_TYPE="-c"\r
+> +CREATE_FRAME=\r
+> \r
+> # The crux of it all: construct an elisp progn and eval it.\r
+> ELISP="(prog1 'done (require 'notmuch) (notmuch-mua-new-mail)"\r
+> -ELISP="${ELISP} (setq message-exit-actions (list #'save-buffers-kill-terminal))"\r
+> \r
+> # Short options compatible with mutt(1).\r
+> while getopts :s:c:b:i:h opt; do\r
+> @@ -60,7 +60,7 @@ while getopts :s:c:b:i:h opt; do\r
+> opt=${opt%%=*}\r
+> ;;\r
+> # Long options without arguments.\r
+> - --help|--print|--no-window-system|--client)\r
+> + --help|--print|--no-window-system|--client|--create-frame)\r
+> ;;\r
+> *)\r
+> echo "$0: unknown long option ${opt}, or argument mismatch." >&2\r
+> @@ -80,9 +80,6 @@ while getopts :s:c:b:i:h opt; do\r
+> --help|h)\r
+> exec man notmuch-emacs-mua\r
+> ;;\r
+> - --client)\r
+> - USE_EMACSCLIENT="yes"\r
+> - ;;\r
+> --subject|s)\r
+> ELISP="${ELISP} (message-goto-subject) (insert \"${OPTARG}\")"\r
+> ;;\r
+> @@ -102,7 +99,13 @@ while getopts :s:c:b:i:h opt; do\r
+> PRINT_ONLY=1\r
+> ;;\r
+> --no-window-system)\r
+> - CLIENT_TYPE="-t"\r
+> + NO_WINDOW="-nw"\r
+> + ;;\r
+> + --client)\r
+> + USE_EMACSCLIENT="yes"\r
+> + ;;\r
+> + --create-frame)\r
+> + CREATE_FRAME="--create-frame"\r
+> ;;\r
+> *)\r
+> # We should never end up here.\r
+> @@ -121,6 +124,14 @@ for arg; do\r
+> ELISP="${ELISP} (message-goto-to) (insert \"${arg}, \")"\r
+> done\r
+> \r
+> +# If reusing a frame in emacsclient, don't kill the buffer.\r
+> +if [ -z "$CREATE_FRAME" ]; then\r
+> + ELISP="${ELISP} (setq message-exit-actions (list #'save-buffers-kill-terminal))"\r
+> +elif [ -z "$USE_EMACSCLIENT" ]; then\r
+> + echo "$0: --create-frame is only applicable with --client." >&2\r
+> + exit 1\r
+> +fi\r
+> +\r
+> # End progn.\r
+> ELISP="${ELISP})"\r
+> \r
+> @@ -131,7 +142,7 @@ fi\r
+> \r
+> if [ -n "$USE_EMACSCLIENT" ]; then\r
+> # Evaluate the progn.\r
+> - exec ${EMACSCLIENT} ${CLIENT_TYPE} -a '' --eval "${ELISP}"\r
+> + exec ${EMACSCLIENT} ${CREATE_FRAME} ${NO_WINDOW} -a '' --eval "${ELISP}"\r
+> else\r
+> - exec ${EMACS} --eval "${ELISP}"\r
+> + exec ${EMACS} ${NO_WINDOW} --eval "${ELISP}"\r
+> fi\r
+> -- \r
+> 2.1.4\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r