[PATCH 6/8] emacs/desktop: update to use notmuch-emacs-mua and handle mailto
Jani Nikula
jani at nikula.org
Mon Nov 21 12:52:23 PST 2016
On Mon, 21 Nov 2016, Jani Nikula <jani at nikula.org> wrote:
> On Mon, 21 Nov 2016, Keith Amidon <camalot at picnicpark.org> wrote:
>> However, this did not seem to work when I tried it out in my gnome
>> session. I'm pretty sure creating two separate desktop files
>> (duplicating some of the fields) would work.
>
> I see three options here:
>
> 1) Just always go to message composition directly (meh)
>
> 2) Add two desktop files (meh)
>
> 3) Have notmuch-emacs-mua call (notmuch-hello) if there are no arguments
> (Tomi's suggestion). I like this because notmuch-emacs-mua also does
> (require 'notmuch).
>
> 4) Same as 3) but only do it if a new --hello parameter is given but
> there are no other arguments. This is to not change notmuch-emacs-mua
> default behaviour.
>
> I'd go for either 3 or 4.
This is what 4) would look like:
diff --git a/emacs/notmuch-emacs-mua b/emacs/notmuch-emacs-mua
index 98103972f400..a521497784ec 100755
--- a/emacs/notmuch-emacs-mua
+++ b/emacs/notmuch-emacs-mua
@@ -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
More information about the notmuch
mailing list