Gnus development mailing list
 help / color / mirror / Atom feed
From: "Adam Sjøgren" <asjo@koldfront.dk>
To: ding@gnus.org
Subject: Re: Possible to make gnus handle mailto URLs with cc, subject and body?
Date: Sat, 06 Jun 2020 18:28:45 +0200	[thread overview]
Message-ID: <87lfl0dupu.fsf@tullinup.koldfront.dk> (raw)
In-Reply-To: <upzceeqs2osj.fsf@dod.no>

Steinar writes:

> Is there a way to make gnus handle mailto URLs with cc, subject and
> body, when those URLs are clicked in a browser?
>
> Here's an example URL:
>  mailto:korr@somewhere.com?cc=some.one@somewhere.com&subject=Hittat%20fel%20i%3A%20%22Nytt%20ras%20i%20Nordnorge%20%E2%80%93%20orsakade%20stort%20h%C3%A5l%20%22&body=Jag%20har%20hittat%20fel%20i%20artikeln%20%22Nytt%20ras%20i%20Nordnorge%20%E2%80%93%20orsakade%20stort%20h%C3%A5l%20%22%0A(https%3A%2F%2Fwww.svt.se%2Fnyheter%2Futrikes%2Fnytt-ras-i-nordnorge-orsakade-stort-hal)%0A%0AKommentar%3A
>

> What I would like to happen is Gnus preparing a message with to, cc,
> subject and body, decoding the arguments for subject and body.

Looking at browse-url-mail in browse-url.el, it looks like it handles
To, Subject and Body, but not maybe not Cc:

  (defun browse-url-mail (url &optional new-window)
    "Open a new mail message buffer within Emacs for the RFC 2368 URL.
  Default to using the mailto: URL around or before point as the
  recipient's address.  Supplying a non-nil interactive prefix argument
  will cause the mail to be composed in another window rather than the
  current one.

  When called interactively, if variable `browse-url-new-window-flag' is
  non-nil use `compose-mail-other-window', otherwise `compose-mail'.  A
  non-nil interactive prefix argument reverses the effect of
  `browse-url-new-window-flag'.

  When called non-interactively, optional second argument NEW-WINDOW is
  used instead of `browse-url-new-window-flag'."
    (interactive (browse-url-interactive-arg "Mailto URL: "))
    (save-excursion
      (let* ((alist (rfc2368-parse-mailto-url url))
             (to (assoc "To" alist))
             (subject (assoc "Subject" alist))
             (body (assoc "Body" alist))
             (rest (delq to (delq subject (delq body alist))))
             (to (cdr to))
             (subject (cdr subject))
             (body (cdr body))
             (mail-citation-hook (unless body mail-citation-hook)))

?

I have a tiny script in ~/bin/mailto-handler:

  #!/bin/bash
  emacsclient -c --eval "(browse-url-mail \"$@\" nil)"

and I think/guess that I have configured ... something to use it, once,
at least Firefox runs it when I click a mailto: link.


  Best regards,

    Adam

-- 
 "Fader eg må be om undskyldning                            Adam Sjøgren
  Det er min feil at Tony er pakkt in i presenning"    asjo@koldfront.dk



  reply	other threads:[~2020-06-06 16:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-06 15:32 Steinar Bang
2020-06-06 16:28 ` Adam Sjøgren [this message]
2020-06-06 16:35   ` Adam Sjøgren
2020-06-06 17:07     ` Adam Sjøgren
2020-06-07 10:43       ` Steinar Bang
2020-06-07 11:03         ` Adam Sjøgren

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=87lfl0dupu.fsf@tullinup.koldfront.dk \
    --to=asjo@koldfront.dk \
    --cc=ding@gnus.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).