From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/18289 Path: news.gmane.org!not-for-mail From: Kevin Brubeck Unhammer Newsgroups: gmane.emacs.gnus.user Subject: Re: xdg-email vs browse-url-mail Date: Fri, 15 Jul 2016 23:16:24 +0200 Message-ID: <87twfqr49j.fsf@fsfe.org> References: <874m7sfkne.fsf@fsfe.org> <87r3awc4fo.fsf@gmail.com> <87zipj8fpk.fsf@fsfe.org> <87wpkmdaba.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5710889044562823321==" X-Trace: ger.gmane.org 1468630401 26067 80.91.229.3 (16 Jul 2016 00:53:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 16 Jul 2016 00:53:21 +0000 (UTC) Cc: info-gnus-english@gnu.org To: Dmitry Alexandrov <321942@gmail.com> Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Sat Jul 16 02:53:11 2016 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bODqq-0007pf-1Y for gegu-info-gnus-english@m.gmane.org; Sat, 16 Jul 2016 02:53:04 +0200 Original-Received: from localhost ([::1]:34981 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOATV-00026j-LR for gegu-info-gnus-english@m.gmane.org; Fri, 15 Jul 2016 17:16:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33541) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOATS-00026d-4u for info-gnus-english@gnu.org; Fri, 15 Jul 2016 17:16:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bOATN-0007Q4-1j for info-gnus-english@gnu.org; Fri, 15 Jul 2016 17:16:41 -0400 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]:56885) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOATL-0007PB-Qt for info-gnus-english@gnu.org; Fri, 15 Jul 2016 17:16:36 -0400 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 027A6204F9; Fri, 15 Jul 2016 17:16:30 -0400 (EDT) Original-Received: from frontend2 ([10.202.2.161]) by compute3.internal (MEProxy); Fri, 15 Jul 2016 17:16:31 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:message-id :mime-version:references:subject:to:x-sasl-enc:x-sasl-enc; s= smtpout; bh=M9YHvednDHhWvZjbEf3UoCS2IrM=; b=TXTNBhJPrD3RtwTrkDbM hgUme1L6AVlG2jHCxGH6Qg6BhOthapnd7JTA3IHWCI4I80yw4irsKM8SX3U44zQo cgSJvsGq4Mbx7KMxCLsY62iJ51Pg3ZobOycWW4W/AYSqOPpfeH0R7j42h1qnSXfd G1vwAIMN1PUfUQ/hTvgHBKY= X-Sasl-enc: Jm7fMA1z2NUNk4d6w8QbBNLY0FLrB6jlL6mH9h0MAu2n 1468617390 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.29 X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Original-Sender: "info-gnus-english" Xref: news.gmane.org gmane.emacs.gnus.user:18289 Archived-At: --===============5710889044562823321== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Dmitry Alexandrov <321942@gmail.com> =C4=8D=C3=A1lii: > Kevin Brubeck Unhammer writes: > >> Dmitry Alexandrov <321942@gmail.com> =C4=8D=C3=A1lii: >> >>> Kevin Brubeck Unhammer writes: >>> >>>> I just tried using browse-url-mail as a mailto-handler with the below >>>> script as my mail handler (set in XFCE settings): >>>> >>>> #!/bin/bash >>>> mailto=3D"${*//\"/}" >>> >>> ... >>> >>>> if [[ ! ${mailto} =3D~ ^mailto: ]]; then >>>> mailto=3D"mailto:${mailto}" >>>> fi >>> >>> Does not xdg-email(1) already do that? >> >> No. Try 'echo "$@">/tmp/log' at the top of your mail script. > > I tried: > > $ xdg-email --version > xdg-email 1.1.0 rc1 > > $ cat /tmp/xdg-test > #!/bin/bash > > echo "$@" > /tmp/xdg-test.log > > $ xdg-email foo@example.org > > $ cat /tmp/xdg-test.log > mailto:foo@example.org Weird, when I try, I get without mailto. $ xdg-email --version xdg-email 1.1.0 rc3 $ cat ~/bin/emacsmail=20 #!/bin/bash echo "$@">/tmp/xdg-test.log $ xdg-email foo@bar.fi ;cat /tmp/log foo@bar.fi This seems to be because open_gnome3 in that script uses xdg-mime query default "x-scheme-handler/mailto" which on my system for some reason gives thunderbird.desktop instead of what I set it to in Xfce, and open_thunderbird does MAILTO=3D$(echo "$2" | sed 's/^mailto://')=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20 I guess that's one for the xdg-email authors. [...] > > Hmm... Do you mean that I have to open a bug report? I am not familiar > with GNU Emacs=E2=80=99 development customs, but a common sense suggests = me that > a feature request had better be filed by one who could ground its > usefulness, while I hardy could. > > Anyway, I think it worth to change it a bit more in order to make it try > to guess mime-type: > > > diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el > index a4d47f6..dca81fe 100644 > --- a/lisp/net/browse-url.el > +++ b/lisp/net/browse-url.el > @@ -1597,7 +1597,8 @@ used instead of `browse-url-new-window-flag'." > (if (not mml-mode) > (error "Enable MML mode if you want to attach files") > (dolist (attach attaches) > - (mml-attach-file attach nil nil "attachment")))))))) > + (mml-attach-file attach (mm-default-file-encoding attach) > + nil "attachment")))))))) >=20=20 > ;; --- Random browser --- >=20=20 > > >> I don't know how attachments are handled by other mailto-users though = =E2=80=93 > > For instance, Icedove (Thunderbird) does not support attaches in > =E2=80=98mailto:=E2=80=99 at all and this is considered a feature [0]. > > [0] https://bugzil.la/99055#c6 Aha, that makes sense. Hmm, now I'm not so sure I should be feature requesting this; even for hardened Emacs users, it's easy to hit C-c=C2=A0C-c too quickly. I'll probably continue using your patch myself though=C2=A0=E2=80=A6 >> multiple identical hfname's or some separator in the hfvalue like with >> the "to" header? > > The former seems to be the only way if we want to use xdg-email(1), > since it requires that argument of =E2=80=98--attach=E2=80=99 should be e= xisting file, > not an arbitrary string and in particular not a comma separated list of > files. > > $ xdg-email foo@example.org --attach hfsdg > xdg-email: file 'hfsdg' does not exist Not necessarily; xdg-email could turn multiple --attach arguments into a single delimiter-separated list of file paths. But I'd rather not suggest a new standard without having done a full survey in case other programs support multiple mailto:-attachments in various ways :) best regards, Kevin Brubeck Unhammer --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXiVKpAAoJEPw8Hn0AkxZn/NoP+wQ8zPFF7vXwG27PiPECXmIy s9pXgma6B8Kq0wMPxDts7LsnUgg9geWvE0HAuYhK/h7v0LYPuyhQTCyq140B/6Pz ZsD7wCH4k5bH5uSVtDvn15FNVs+KfjIqbzo9T2LM5BuHVeW50XtwFTX6e9nPM6xv /fr1SIeiCQOa59+pNK9wjLto3Mis6cge7mx4se4x6nFrsm25wlgFwV9kPgDdB7eo L9eQXw73UDzKiwsRBctFjbgpyfyqd0UTc55cqgEIi8JUDNonKVBYR/4W3AII+A+m K35B4gbu96may2rjnspybonwMsIWjqkcB+He4z2gsrAXqLAgeBh0iV1Ay3tNbmfA xeaMRxIW1SncIdXUQyDGXxSTaCcIYHBJncc0b4pdiGMm+cS3YvJf6U8J34t1L3iS DHgkzlB0Ya0eFVl8IXL2iqerJKnwIOiH5b53Z8IPPR0JyDS7yhYSj1iTsaXTQC5M ETYpE5GZ3NdrWb6+tHXDZrh3NchxDOy4oAGu08qKujm+JYOQ94Y0tS/7NFqLrXFy E0J3k/xrXU4QfrGeZwYxkGdDyVLe9CZNGC9uHJdzxdFrWVlexLdv4JLLy27NqHdn gPLLkby4IJg+3En1mQA7xxTI562y6hW0++ez5ZEUJUb1LfnWqO3R/5FuLgz1s5ts yKNWr9WPDfyra0TTMrWu =me8B -----END PGP SIGNATURE----- --=-=-=-- --===============5710889044562823321== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline