Re: [PATCH 6/8] emacs/desktop: update to use notmuch-emacs-mua and handle mailto

2016-11-21 Thread Keith Amidon
On Mon, 2016-11-21 at 13:44 +0200, Jani Nikula wrote:
> I wonder if there's a way to define different Execs for clicking on
> the icon and handling mailto.

The desktop file format specification implies you can just add an extra
context entry.  For reference, the full specification is here:

https://specifications.freedesktop.org/desktop-entry-spec/latest/

Something like this seems like what the spec suggests:

[Desktop Entry]
Name=Notmuch Emacs Client
GenericName=Email Client
Comment=Emacs based email client
Exec=emacs -f notmuch
Icon=emblem-mail
Terminal=false
Type=Application
Categories=Network;Email;

[Create Message]
Name=Notmuch Emacs Create Message
Exec=notmuch-emacs-mua %u
MimeType=x-scheme-handler/mailto;

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.

  --- Keith


___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 6/8] emacs/desktop: update to use notmuch-emacs-mua and handle mailto

2016-11-21 Thread Jani Nikula
On Mon, 21 Nov 2016, Jani Nikula  wrote:
> On Mon, 21 Nov 2016, Keith Amidon  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

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 6/8] emacs/desktop: update to use notmuch-emacs-mua and handle mailto

2016-11-21 Thread Jani Nikula
On Mon, 21 Nov 2016, Keith Amidon  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.

BR,
Jani.
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 6/8] emacs/desktop: update to use notmuch-emacs-mua and handle mailto

2016-11-21 Thread Tomi Ollila
On Mon, Nov 21 2016, Jani Nikula  wrote:

> On Mon, Nov 21, 2016 at 1:34 PM, David Bremner  wrote:
>> Jani Nikula  writes:
>>
>>> -Exec=emacs -f notmuch
>>> +GenericName=Email Client
>>> +Comment=Emacs based email client
>>> +Exec=notmuch-emacs-mua %u
>>
>> This seems like a fairly substantial change in functionality. Previously
>> people could click on the icon fire up a mail reader; now they get a
>> mail composition window. I probably won't use either, but it seems like
>> the change merits some discussion.
>
> I wonder if there's a way to define different Execs for clicking on
> the icon and handling mailto.

What if notmuch-emacs-mua started (notmuch-hello) in case there are no
arguments given ... ?

Tomi

>
> BR,
> Jani.
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 6/8] emacs/desktop: update to use notmuch-emacs-mua and handle mailto

2016-11-21 Thread Jani Nikula
On Mon, Nov 21, 2016 at 1:34 PM, David Bremner  wrote:
> Jani Nikula  writes:
>
>> -Exec=emacs -f notmuch
>> +GenericName=Email Client
>> +Comment=Emacs based email client
>> +Exec=notmuch-emacs-mua %u
>
> This seems like a fairly substantial change in functionality. Previously
> people could click on the icon fire up a mail reader; now they get a
> mail composition window. I probably won't use either, but it seems like
> the change merits some discussion.

I wonder if there's a way to define different Execs for clicking on
the icon and handling mailto.

BR,
Jani.
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 6/8] emacs/desktop: update to use notmuch-emacs-mua and handle mailto

2016-11-21 Thread David Bremner
Jani Nikula  writes:

> -Exec=emacs -f notmuch
> +GenericName=Email Client
> +Comment=Emacs based email client
> +Exec=notmuch-emacs-mua %u

This seems like a fairly substantial change in functionality. Previously
people could click on the icon fire up a mail reader; now they get a
mail composition window. I probably won't use either, but it seems like
the change merits some discussion.
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch