From 7e90d749e6d120e34b26060c3ec10cc3a3a23f63 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Tue, 29 Sep 2015 07:59:40 +2100 Subject: [PATCH] Re: [PATCH v4 5/5] notmuch-emacs-mua: do not create a frame by default with --client --- 77/c23c637615ea16ae87d69165072d1f8de18c89 | 96 +++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 77/c23c637615ea16ae87d69165072d1f8de18c89 diff --git a/77/c23c637615ea16ae87d69165072d1f8de18c89 b/77/c23c637615ea16ae87d69165072d1f8de18c89 new file mode 100644 index 000000000..7e258d15e --- /dev/null +++ b/77/c23c637615ea16ae87d69165072d1f8de18c89 @@ -0,0 +1,96 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id E85516DE0298 + for ; Mon, 28 Sep 2015 04:02:18 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: 0.107 +X-Spam-Level: +X-Spam-Status: No, score=0.107 tagged_above=-999 required=5 tests=[AWL=0.107] + autolearn=disabled +Received: from arlo.cworth.org ([127.0.0.1]) + by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 3Iz4Xi_Rze5l for ; + Mon, 28 Sep 2015 04:02:16 -0700 (PDT) +Received: from gitolite.debian.net (gitolite.debian.net [87.98.215.224]) + by arlo.cworth.org (Postfix) with ESMTPS id 97E6B6DE0173 + for ; Mon, 28 Sep 2015 04:02:15 -0700 (PDT) +Received: from remotemail by gitolite.debian.net with local (Exim 4.80) + (envelope-from ) + id 1ZgWA3-0003ft-Ee; Mon, 28 Sep 2015 10:59:59 +0000 +Received: (nullmailer pid 12310 invoked by uid 1000); Mon, 28 Sep 2015 + 10:59:40 -0000 +From: David Bremner +To: Tomi Ollila , Jani Nikula , + notmuch@notmuchmail.org +Subject: Re: [PATCH v4 5/5] notmuch-emacs-mua: do not create a frame by + default with --client +In-Reply-To: +References: + <455026447d3f75b1038ac11cebe734431604be9d.1439629384.git.jani@nikula.org> + +User-Agent: Notmuch/0.20.2+93~g33c8777 (http://notmuchmail.org) Emacs/24.5.1 + (x86_64-pc-linux-gnu) +Date: Mon, 28 Sep 2015 07:59:40 -0300 +Message-ID: <87wpva3j37.fsf@zancas.localnet> +MIME-Version: 1.0 +Content-Type: text/plain +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.18 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Mon, 28 Sep 2015 11:02:19 -0000 + +Tomi Ollila writes: + + +> if [ -n "$AUTO_DAEMON" -a -z "$CREATE_FRAME" ]; then +> echo "$0: --auto-daemon is only applicable with --create-frame." >&2 +> exit 1 +> fi +> +> without this one may execute ./notmuch-emacs-mua --client --auto-daemon +> which yields starting emacs in daemon mode (in this example it is expected +> emacs is not running; otherwise --auto-daemon has no use in this example) +> -- but no ui to that newly-running emacs is provided. Similar behaviour +> can be observed by the following +> + +I think what you propose is fine for a followup patch; note that the +scenario you worry about also needs --client to be a problem. Apparently +nothing is uncontroversial here, but if auto-daemon only works with +create frame, then perhaps the followup would be to have auto-daemon +imply create-frame + +>> +>> +# Kill the terminal/frame if we're creating one. +>> +if [ -z "$USE_EMACSCLIENT" -o -n "$CREATE_FRAME" -o -n "$NO_WINDOW" ]; then +>> + ELISP="${ELISP} (setq message-exit-actions (list #'save-buffers-kill-terminal))" +>> +fi +> +> I am not very happy that message-exit-actions was added to $ELISP when +> not using emacsclient; when emacs is started its sole (initial) purpose is +> to serve mail sending (and not lending a frame in some other emacs) -- in +> this case it would be nice to be able to retrieve the sent mail buffer. + +I'm somewhat less sympathetic here. AIUI, the goal of notmuch-emacs-mua +is to provide a drop in tool to replace mutt for sending mail in the +shell or from other programs. In this case, I think the most common +expectation is to terminate after sending mail (e.g. to return use of +the shell to the user, or allow the spawning program to continue). +However, it seems like this would be relatively easy to set up some +customization in notmuch-message-mode so that it could check if running +from the cli, and then either kill-or-not emacs depending on some +variable. So I think I'd like to keep the current behaviour as default, +and make it customizable at the emacs level. + -- 2.26.2