[PATCH] notmuch-emacs-mua: do not start emacs daemon w/o --create-frame

Tomi Ollila tomi.ollila at iki.fi
Mon May 11 12:19:53 PDT 2015


notmuch-emacs-mua --client used to start daemon process if it was
not running -- just that no emacs mail window of any kind from
that is visible to the user.

When not starting emacs server in this case notmuch-emacs-mua
user will get the same message as would emacsclient user
have, which should be enough for such user to understand how
to proceed starting emacs server in a way that it is useable
for this purpose.
---

After trying quite a few alternatives, perhaps this is
the way to close this case...

 doc/man1/notmuch-emacs-mua.rst | 6 +++---
 notmuch-emacs-mua              | 8 ++++++--
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/doc/man1/notmuch-emacs-mua.rst b/doc/man1/notmuch-emacs-mua.rst
index e39d9e5fba1f..edaecc272e0f 100644
--- a/doc/man1/notmuch-emacs-mua.rst
+++ b/doc/man1/notmuch-emacs-mua.rst
@@ -37,12 +37,12 @@ Supported options for **notmuch-emacs-mua** include
         Even if a window system is available, use the current terminal.
 
     ``--client``
-        Use **emacsclient**, rather than **emacs**. This will start
-        an emacs daemon process if necessary.
+        Use **emacsclient**, rather than **emacs**.
 
     ``--create-frame``
          When --client is specified, create a new frame instead of trying
-         to use the current Emacs frame.
+         to use the current Emacs frame. This will also start an emacs
+         daemon process if necessary.
 
     ``--print``
         Output the resulting elisp to stdout instead of evaluating it.
diff --git a/notmuch-emacs-mua b/notmuch-emacs-mua
index 102410a23f3e..34ff4db3469b 100755
--- a/notmuch-emacs-mua
+++ b/notmuch-emacs-mua
@@ -142,9 +142,13 @@ if [ -n "$PRINT_ONLY" ]; then
     exit 0
 fi
 
+# Evaluate the progn.
 if [ -n "$USE_EMACSCLIENT" ]; then
-    # Evaluate the progn.
-    exec ${EMACSCLIENT} ${CREATE_FRAME} ${NO_WINDOW} -a '' --eval "${ELISP}"
+    if [ -n "$CREATE_FRAME" ]; then
+	exec ${EMACSCLIENT} ${CREATE_FRAME} ${NO_WINDOW} -a '' --eval "${ELISP}"
+    else
+	exec ${EMACSCLIENT} ${CREATE_FRAME} ${NO_WINDOW} --eval "${ELISP}"
+    fi
 else
     exec ${EMACS} ${NO_WINDOW} --eval "${ELISP}"
 fi
-- 
2.0.0



More information about the notmuch mailing list