Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Kevin Brubeck Unhammer <unhammer@fsfe.org>
To: Dmitry Alexandrov <321942@gmail.com>
Cc: info-gnus-english@gnu.org
Subject: Re: xdg-email vs browse-url-mail
Date: Fri, 15 Jul 2016 23:16:24 +0200	[thread overview]
Message-ID: <87twfqr49j.fsf@fsfe.org> (raw)
In-Reply-To: <87wpkmdaba.fsf@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 3682 bytes --]

Dmitry Alexandrov <321942@gmail.com> čálii:

> Kevin Brubeck Unhammer <unhammer@fsfe.org> writes:
>
>> Dmitry Alexandrov <321942@gmail.com> čálii:
>>
>>> Kevin Brubeck Unhammer <unhammer@fsfe.org> 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="${*//\"/}"
>>>
>>> ...
>>>
>>>> if [[ ! ${mailto} =~ ^mailto: ]]; then
>>>>     mailto="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 
#!/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=$(echo "$2" | sed 's/^mailto://')                                               
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’ 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"))))))))
>  
>  ;; --- Random browser ---
>  
>
>
>> I don't know how attachments are handled by other mailto-users though –
>
> For instance, Icedove (Thunderbird) does not support attaches in
> ‘mailto:’ 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 C-c too quickly. I'll
probably continue using your patch myself though …

>> 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 ‘--attach’ should be existing 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

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]



  reply	other threads:[~2016-07-15 21:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-14 12:51 Kevin Brubeck Unhammer
2016-07-14 21:09 ` Dmitry Alexandrov
2016-07-15  8:31   ` Kevin Brubeck Unhammer
2016-07-15 18:29     ` Dmitry Alexandrov
2016-07-15 21:16       ` Kevin Brubeck Unhammer [this message]
2016-07-16 17:13         ` Dmitry Alexandrov
2016-07-25  8:10           ` Kevin Brubeck Unhammer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87twfqr49j.fsf@fsfe.org \
    --to=unhammer@fsfe.org \
    --cc=321942@gmail.com \
    --cc=info-gnus-english@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).