]> git.notmuchmail.org Git - notmuch/commitdiff
notmuch-emacs-mua: add --hello parameter
authorJani Nikula <jani@nikula.org>
Mon, 21 Nov 2016 21:13:36 +0000 (23:13 +0200)
committerDavid Bremner <david@tethera.net>
Sat, 26 Nov 2016 12:15:11 +0000 (08:15 -0400)
If the --hello parameter is given, display the notmuch hello buffer
instead of the message composition buffer if no message composition
parameters are given.

Signed-off-by: Jani Nikula <jani@nikula.org>
doc/man1/notmuch-emacs-mua.rst
emacs/notmuch-emacs-mua

index b80aa5f9b2e59aba9a08aba10d4878663fca79af..87787e20e531157b6ebc18a6d5d852634edc8ae0 100644 (file)
@@ -33,6 +33,10 @@ Supported options for **emacs-mua** include
     ``-i, --body=``\ <file>
         Specify a file to include into the body of the message.
 
+    ``--hello``
+        Go to the Notmuch hello screen instead of the message composition
+        window if no message composition parameters are given.
+
     ``--no-window-system``
         Even if a window system is available, use the current terminal.
 
index 98103972f400c69af957b51e8bbfa390109c3e21..a521497784ec27e91cf9c7ee905641b3d4459012 100755 (executable)
@@ -40,6 +40,7 @@ AUTO_DAEMON=
 CREATE_FRAME=
 ELISP=
 MAILTO=
+HELLO=
 
 # Short options compatible with mutt(1).
 while getopts :s:c:b:i:h opt; do
@@ -63,7 +64,7 @@ while getopts :s:c:b:i:h opt; do
                    opt=${opt%%=*}
                    ;;
                # Long options without arguments.
-               --help|--print|--no-window-system|--client|--auto-daemon|--create-frame)
+               --help|--print|--no-window-system|--client|--auto-daemon|--create-frame|--hello)
                    ;;
                *)
                    echo "$0: unknown long option ${opt}, or argument mismatch." >&2
@@ -112,6 +113,9 @@ while getopts :s:c:b:i:h opt; do
        --create-frame)
            CREATE_FRAME="-c"
            ;;
+       --hello)
+           HELLO=1
+           ;;
        *)
            # We should never end up here.
            echo "$0: internal error (option ${opt})." >&2
@@ -146,6 +150,8 @@ if [ -n "${MAILTO}" ]; then
        exit 1
     fi
     ELISP="(browse-url-mail \"${MAILTO}\")"
+elif [ -z "${ELISP}" -a -n "${HELLO}" ]; then
+    ELISP="(notmuch)"
 else
     ELISP="(notmuch-mua-new-mail) ${ELISP}"
 fi