GNU bug report logs - #38314
No /usr/share/applications mailto presence

Previous Next

Package: emacs;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Thu, 21 Nov 2019 17:36:02 UTC

Severity: wishlist

Tags: fixed

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 38314 in the body.
You can then email your comments to 38314 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#38314; Package emacs. (Thu, 21 Nov 2019 17:36:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 21 Nov 2019 17:36:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: bug-gnu-emacs <at> gnu.org
Subject: No /usr/share/applications mailto presence
Date: Fri, 22 Nov 2019 01:35:27 +0800
All I know is these guys

$ grep -lr mailto /usr/share/applications|xargs dlocate
mutt: /usr/share/applications/mutt.desktop

have a mailto presence in /usr/share/applications here on Debian,
but even in (info "(emacs) Browse-URL")'s mailto discussion,
there is no mention of a workaroud for users who don't want to use mutt.

$ grep -c mailto /usr/share/applications/*ema*
/usr/share/applications/emacs-term.desktop:0
/usr/share/applications/emacs.desktop:0




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38314; Package emacs. (Fri, 22 Nov 2019 13:27:04 GMT) Full text and rfc822 format available.

Message #8 received at 38314 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 38314 <at> debbugs.gnu.org
Subject: Re: bug#38314: No /usr/share/applications mailto presence
Date: Fri, 22 Nov 2019 14:26:26 +0100
積丹尼 Dan Jacobson <jidanni <at> jidanni.org> writes:

> All I know is these guys
>
> $ grep -lr mailto /usr/share/applications|xargs dlocate
> mutt: /usr/share/applications/mutt.desktop

larsi <at> marnie:~/src/emacs/trunk$ grep -lr mailto /usr/share/applications | xargs dlocate
xargs: dlocate: No such file or directory

> have a mailto presence in /usr/share/applications here on Debian,
> but even in (info "(emacs) Browse-URL")'s mailto discussion,
> there is no mention of a workaroud for users who don't want to use mutt.
>
> $ grep -c mailto /usr/share/applications/*ema*
> /usr/share/applications/emacs-term.desktop:0
> /usr/share/applications/emacs.desktop:0

I'm not sure what you're asking.  What is the problem you're seeing, and
what would you have Emacs do instead?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38314; Package emacs. (Sat, 23 Nov 2019 00:27:02 GMT) Full text and rfc822 format available.

Message #11 received at 38314 <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 38314 <at> debbugs.gnu.org, yamaoka <at> jpl.org
Subject: Re: bug#38314: No /usr/share/applications mailto presence
Date: Sat, 23 Nov 2019 08:26:15 +0800
>>>>> "LI" == Lars Ingebrigtsen <larsi <at> gnus.org> writes:

LI> I'm not sure what you're asking.  What is the problem you're seeing, and
LI> what would you have Emacs do instead?

OK, let's take
http://ccs.land.moi.gov.tw/jsp/ExpenseController

On the bottom there are two mailto links.

Let's talk about this one,

<a href="mailto:michael <at> land.moi.gov.tw;lee <at> land.moi.gov.tw?subject=地政電子資料流服務網意見信箱"><img src="../images/mail1.gif" alt="意見信箱" border="0">意見信箱</a>

Well, you could say "Just browse it with M-x w3m, and click the link
there. That will launch a message buffer with everything filled in
fine."

That is true. However in w3m this is just

<a href="mailto:moiland <at> land.moi.gov.tw?subject=地政電子資料流服務網意見信箱"><img src="../images/mail1.gif" alt="意見信箱" border="0">意見信箱</a>

That is because some javascript perhaps changed it.

Therefore we need to use the chromium browser.

OK, but in chromium, clicking the mailto link won't notify emacs,
because emacs'
/usr/share/applications/* files, although there, don't have a mailto
line in them.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38314; Package emacs. (Sat, 23 Nov 2019 12:08:02 GMT) Full text and rfc822 format available.

Message #14 received at 38314 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 38314 <at> debbugs.gnu.org, yamaoka <at> jpl.org
Subject: Re: bug#38314: No /usr/share/applications mailto presence
Date: Sat, 23 Nov 2019 13:06:50 +0100
積丹尼 Dan Jacobson <jidanni <at> jidanni.org> writes:

> OK, but in chromium, clicking the mailto link won't notify emacs,
> because emacs'
> /usr/share/applications/* files, although there, don't have a mailto
> line in them.

OK, your complaint is that there's no mailto handler specified in
/usr/share/applications/emacs*.desktop?

Would adding a line like

MimeType=x-scheme-handler/mailto;

to the file do the trick, or is there something else that has to be done?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38314; Package emacs. (Mon, 25 Nov 2019 12:23:01 GMT) Full text and rfc822 format available.

Message #17 received at 38314 <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 38314 <at> debbugs.gnu.org, yamaoka <at> jpl.org
Subject: Re: bug#38314: No /usr/share/applications mailto presence
Date: Mon, 25 Nov 2019 19:06:15 +0800
>>>>> "LI" == Lars Ingebrigtsen <larsi <at> gnus.org> writes:
LI> 積丹尼 Dan Jacobson <jidanni <at> jidanni.org> writes:

>> OK, but in chromium, clicking the mailto link won't notify emacs,
>> because emacs'
>> /usr/share/applications/* files, although there, don't have a mailto
>> line in them.

LI> OK, your complaint is that there's no mailto handler specified in
LI> /usr/share/applications/emacs*.desktop?

I guess so.

LI> Would adding a line like

LI> MimeType=x-scheme-handler/mailto;

LI> to the file do the trick, or is there something else that has to be done?

I don't know.
Just make sure it mails those two addresses with the ; in between them,
using gnus, when you click the link in chromium.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38314; Package emacs. (Wed, 27 Nov 2019 12:09:02 GMT) Full text and rfc822 format available.

Message #20 received at 38314 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 38314 <at> debbugs.gnu.org, yamaoka <at> jpl.org
Subject: Re: bug#38314: No /usr/share/applications mailto presence
Date: Wed, 27 Nov 2019 13:08:02 +0100
積丹尼 Dan Jacobson <jidanni <at> jidanni.org> writes:

> LI> Would adding a line like
>
> LI> MimeType=x-scheme-handler/mailto;
>
> LI> to the file do the trick, or is there something else that has to be done?
>
> I don't know.
> Just make sure it mails those two addresses with the ; in between them,
> using gnus, when you click the link in chromium.

What two addresses?  And why should there be a semicolon between the
addresses?

Anyway, it seems %u is the URL received by the program, but the
documentation of the format seems to be ... scarce.  Anybody know how to
specify (in the .desktop file) how one should start a program when
there's a mailto handler?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38314; Package emacs. (Sun, 08 Dec 2019 03:14:01 GMT) Full text and rfc822 format available.

Message #23 received at 38314 <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 38314 <at> debbugs.gnu.org
Subject: Re: bug#38314: No /usr/share/applications mailto presence
Date: Sun, 08 Dec 2019 07:56:59 +0800
Well let's just start with the simplest example.

Let's say in chromium you are browsing
https://www.myfearlesskitchen.com/refrigerator-freezer-temperature/
and you click on the envelope icon.

This should launch emacs, sending a mail to
marybeth <at> myfearlesskitchen.com .

That's all I know.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38314; Package emacs. (Thu, 06 Aug 2020 12:53:02 GMT) Full text and rfc822 format available.

Message #26 received at 38314 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 38314 <at> debbugs.gnu.org, yamaoka <at> jpl.org
Subject: Re: bug#38314: No /usr/share/applications mailto presence
Date: Thu, 06 Aug 2020 14:52:14 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Anyway, it seems %u is the URL received by the program, but the
> documentation of the format seems to be ... scarce.  Anybody know how to
> specify (in the .desktop file) how one should start a program when
> there's a mailto handler?

Well, that was ... simple enough, really, other than it seems really
difficult to make this laptop reload the data, which made testing
difficult.

Anyway, with Emacs 28 (and if the distributors include the .desktop file
in the correct place), you should be able to choose Emacs as the system
mailer and clicking on mailto: links should open Emacs in a Message buffer.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 06 Aug 2020 12:53:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 38314 <at> debbugs.gnu.org and 積丹尼 Dan Jacobson <jidanni <at> jidanni.org> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 06 Aug 2020 12:53:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38314; Package emacs. (Thu, 06 Aug 2020 12:55:01 GMT) Full text and rfc822 format available.

Message #33 received at 38314 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 38314 <at> debbugs.gnu.org, yamaoka <at> jpl.org
Subject: Re: bug#38314: No /usr/share/applications mailto presence
Date: Thu, 06 Aug 2020 14:54:45 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Anyway, with Emacs 28 (and if the distributors include the .desktop file
> in the correct place), you should be able to choose Emacs as the system
> mailer and clicking on mailto: links should open Emacs in a Message buffer.

(I really thought that this already existed, but I grepped for mailto
and couldn't find any handlers for it.  Weird.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38314; Package emacs. (Tue, 11 Aug 2020 12:57:02 GMT) Full text and rfc822 format available.

Message #36 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Gijs Hillenius <gijs <at> hillenius.net>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#38314: No /usr/share/applications mailto presence
Date: Tue, 11 Aug 2020 14:55:51 +0200
On  6 August 2020 14:54 Lars Ingebrigtsen, wrote:

> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>
>> Anyway, with Emacs 28 (and if the distributors include the .desktop file
>> in the correct place), you should be able to choose Emacs as the system
>> mailer and clicking on mailto: links should open Emacs in a Message buffer.
>
> (I really thought that this already existed, but I grepped for mailto
> and couldn't find any handlers for it.

The sample file uses:
Exec=emacs -f message-mailto %u

Would this work as well?
Exec=/usr/bin/emacsclient.emacs-snapshot -f message-mailto

I'll experiment with this once it is included in the next snapshot for Debian.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38314; Package emacs. (Tue, 11 Aug 2020 13:06:01 GMT) Full text and rfc822 format available.

Message #39 received at 38314 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Gijs Hillenius <gijs <at> hillenius.net>
Cc: 38314 <at> debbugs.gnu.org
Subject: Re: bug#38314: No /usr/share/applications mailto presence
Date: Tue, 11 Aug 2020 15:05:30 +0200
Gijs Hillenius <gijs <at> hillenius.net> writes:

> The sample file uses:
> Exec=emacs -f message-mailto %u
>
> Would this work as well?
> Exec=/usr/bin/emacsclient.emacs-snapshot -f message-mailto
>
> I'll experiment with this once it is included in the next snapshot for Debian.

Hm.  No, it won't work, because -f in emacsclient means:

       -f, --server-file=FILENAME
              use TCP configuration file FILENAME for communication.  This can
              also  be  specified  via the EMACS_SERVER_FILE environment vari‐
              able.

So I think that would be

emacsclient -e (message-mailto) %u

?

Or does the Emacs -f thing hide under a different option in emacsclient?  

Hm, no, that doesn't work, obviously, because message-mailto expects the
%u in command-line-args-left, and that's not the case here.

So it's

emacsclient -e '(message-mailto-1 \"%u\")'

which has major problems with string interpolation and would be very
fragile.

Would it make sense to add something to emacsclient/emacs-server to help
in this use case?

So a new switch, like "-E", which means "emulate as far as possible
'emacs -f'":

emacsclient -E message-mailto %u

In emacs-server, this would bind command-line-args-left to the remaining
parameters, and then funcall the function.

I'm kinda surprised that emacsclient doesn't have something like this
already?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38314; Package emacs. (Tue, 11 Aug 2020 13:12:02 GMT) Full text and rfc822 format available.

Message #42 received at 38314 <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: Gijs Hillenius <gijs <at> hillenius.net>
Cc: 38314 <at> debbugs.gnu.org
Subject: Re: bug#38314: No /usr/share/applications mailto presence
Date: Tue, 11 Aug 2020 15:11:09 +0200
>>>>> On Tue, 11 Aug 2020 14:55:51 +0200, Gijs Hillenius <gijs <at> hillenius.net> said:

    Gijs> On  6 August 2020 14:54 Lars Ingebrigtsen, wrote:
    >> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
    >> 
    >>> Anyway, with Emacs 28 (and if the distributors include the .desktop file
    >>> in the correct place), you should be able to choose Emacs as the system
    >>> mailer and clicking on mailto: links should open Emacs in a Message buffer.
    >> 
    >> (I really thought that this already existed, but I grepped for mailto
    >> and couldn't find any handlers for it.

    Gijs> The sample file uses:
    Gijs> Exec=emacs -f message-mailto %u

    Gijs> Would this work as well?
    Gijs> Exec=/usr/bin/emacsclient.emacs-snapshot -f message-mailto

You might want to add '-a=""' to that (and in fact we should probably
consider it for the default as well)

Robert




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38314; Package emacs. (Tue, 11 Aug 2020 13:19:01 GMT) Full text and rfc822 format available.

Message #45 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Gijs Hillenius <gijs <at> hillenius.net>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#38314: No /usr/share/applications mailto presence
Date: Tue, 11 Aug 2020 15:18:17 +0200
On 11 August 2020 15:05 Lars Ingebrigtsen, wrote:

> Gijs Hillenius <gijs <at> hillenius.net> writes:
>
>> The sample file uses:
>> Exec=emacs -f message-mailto %u
>>
>> Would this work as well?
>> Exec=/usr/bin/emacsclient.emacs-snapshot -f message-mailto
>>
>> I'll experiment with this once it is included in the next snapshot for Debian.
>
> Hm.  No, it won't work, because -f in emacsclient means:
>
>        -f, --server-file=FILENAME
>               use TCP configuration file FILENAME for communication.  This can
>               also  be  specified  via the EMACS_SERVER_FILE environment vari‐
>               able.
>
> So I think that would be
>
> emacsclient -e (message-mailto) %u
>
> ?
>
> Or does the Emacs -f thing hide under a different option in emacsclient?  
>
> Hm, no, that doesn't work, obviously, because message-mailto expects the
> %u in command-line-args-left, and that's not the case here.
>
> So it's
>
> emacsclient -e '(message-mailto-1 \"%u\")'
>
> which has major problems with string interpolation and would be very
> fragile.
>
> Would it make sense to add something to emacsclient/emacs-server to help
> in this use case?
>
> So a new switch, like "-E", which means "emulate as far as possible
> 'emacs -f'":
>
> emacsclient -E message-mailto %u
>
> In emacs-server, this would bind command-line-args-left to the remaining
> parameters, and then funcall the function.
>
> I'm kinda surprised that emacsclient doesn't have something like this
> already?

I currently use this as my emacs-mailto-handler:

/usr/bin/emacsclient.emacs-snapshot -c --eval "(browse-url-mail \"$@\")"







Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38314; Package emacs. (Tue, 11 Aug 2020 13:29:01 GMT) Full text and rfc822 format available.

Message #48 received at 38314 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Gijs Hillenius <gijs <at> hillenius.net>
Cc: 38314 <at> debbugs.gnu.org
Subject: Re: bug#38314: No /usr/share/applications mailto presence
Date: Tue, 11 Aug 2020 15:28:22 +0200
Gijs Hillenius <gijs <at> hillenius.net> writes:

> I currently use this as my emacs-mailto-handler:
>
> /usr/bin/emacsclient.emacs-snapshot -c --eval "(browse-url-mail \"$@\")"

What happens if there's a " character in $@?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 09 Sep 2020 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 222 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.