Re: [PATCH v2] notmuch-emacs-mua: do not create a frame by default with --client

Subject: Re: [PATCH v2] notmuch-emacs-mua: do not create a frame by default with --client

Date: Mon, 06 Apr 2015 16:04:13 +0300

To: Jani Nikula, notmuch@notmuchmail.org

Cc:

From: Tomi Ollila


On Sat, Apr 04 2015, Jani Nikula <jani@nikula.org> wrote:

> Make the default behaviour for --client the same as emacsclient
> default: do not create a new frame. Add a new option --create-frame,
> passing the same option to emacsclient to create a frame.
>
> ---
>
> v2: fix killing frame with --create-frame
> ---
>  doc/man1/notmuch-emacs-mua.rst | 14 +++++++++-----
>  notmuch-emacs-mua              | 29 ++++++++++++++++++++---------
>  2 files changed, 29 insertions(+), 14 deletions(-)
>
> diff --git a/doc/man1/notmuch-emacs-mua.rst b/doc/man1/notmuch-emacs-mua.rst
> index 36b51cdc3b18..e39d9e5fba1f 100644
> --- a/doc/man1/notmuch-emacs-mua.rst
> +++ b/doc/man1/notmuch-emacs-mua.rst
> @@ -122,6 +125,14 @@ for arg; do
>      ELISP="${ELISP} (message-goto-to) (insert \"${arg}, \")"
>  done
>  
> +# If reusing a frame in emacsclient, don't kill the buffer.
> +if [ -n "$CREATE_FRAME" ]; then
> +    ELISP="${ELISP} (setq message-exit-actions (list #'save-buffers-kill-terminal))"
> +elif [ -z "$USE_EMACSCLIENT" ]; then
> +    echo "$0: --create-frame is only applicable with --client." >&2
> +    exit 1
> +fi
> +

# If reusing a frame in emacsclient, don't kill the buffer.
if [ -n "$CREATE_FRAME" ]; then
    if [ -z "$USE_EMACSCLIENT" ]; then
        echo "$0: --create-frame is only applicable with --client." >&2
        exit 1
    fi
    ELISP="${ELISP} (setq message-exit-actions (list #'save-buffers-kill-terminal))"
fi

should work better...

Tomi

Thread: