]> git.notmuchmail.org Git - notmuch/blobdiff - emacs/notmuch-emacs-mua
emacs: Add new option notmuch-search-hide-excluded
[notmuch] / emacs / notmuch-emacs-mua
index 98103972f400c69af957b51e8bbfa390109c3e21..254e6407cecefbbd8656321d9283cf63d360afca 100755 (executable)
@@ -40,6 +40,10 @@ AUTO_DAEMON=
 CREATE_FRAME=
 ELISP=
 MAILTO=
+HELLO=
+TO_SEP=
+CC_SEP=
+BCC_SEP=
 
 # Short options compatible with mutt(1).
 while getopts :s:c:b:i:h opt; do
@@ -63,7 +67,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
@@ -85,13 +89,16 @@ while getopts :s:c:b:i:h opt; do
            ELISP="${ELISP} (message-goto-subject) (insert \"${OPTARG}\")"
            ;;
        --to)
-           ELISP="${ELISP} (message-goto-to) (insert \"${OPTARG}, \")"
+           ELISP="${ELISP} (message-goto-to) (insert \"${TO_SEP}${OPTARG}\")"
+           TO_SEP=", "
            ;;
        --cc|c)
-           ELISP="${ELISP} (message-goto-cc) (insert \"${OPTARG}, \")"
+           ELISP="${ELISP} (message-goto-cc) (insert \"${CC_SEP}${OPTARG}\")"
+           CC_SEP=", "
            ;;
        --bcc|b)
-           ELISP="${ELISP} (message-goto-bcc) (insert \"${OPTARG}, \")"
+           ELISP="${ELISP} (message-goto-bcc) (insert \"${BCC_SEP}${OPTARG}\")"
+           BCC_SEP=", "
            ;;
        --body|i)
            ELISP="${ELISP} (message-goto-body) (insert-file \"${OPTARG}\")"
@@ -112,6 +119,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 +156,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