[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Re: w3m-browse-url and mailto



In [emacs-w3m : No.11759] Memnon Anon wrote:
> I tried to send a bugreport with icicle-send-bug-report, which looks
> like this:

> (defun icicle-send-bug-report ()
>   "Send a bug report about an Icicles problem."
>   (interactive)
>   (browse-url (format (concat "mailto:"; "drew.adams" "@" "oracle" ".com?subject=\
> Icicles bug: \
> &body=Describe bug below, using a precise recipe that starts with `emacs -Q' or `emacs -q'.  \
> Each Icicles file has a header `Update #' that you can use to identify it.\
> %%0A%%0AEmacs version: %s.")
>                       (emacs-version))))

> which failed for me: I had browse-url-browser-function set to
> w3m-browse-url just like suggested in (info "(emacs-w3m)Tips").

How does it fail?  I obtained
http://www.emacswiki.org/emacs/download/Icicles.tar.gz
, tried `icicle-send-bug-report', and got:

,----
| To: drew.adams@xxxxxxxxxx
| Subject: Icicles bug: 
| --text follows this line--
| Describe bug below, using a precise recipe that starts with `emacs -Q' or `emacs -q'.  Each Icicles file has a header `Update #' that you can use to identify it.
| 
| Emacs version: GNU Emacs 24.0.93.1 (i686-pc-cygwin, X toolkit, Xaw3d scroll bars)  of 2012-02-20 on localhost.
`----

It doesn't look funny to me, hmm.

> After some experimentation, it seemed to me that calling
> mail-user-agent (set to gnus-user-agent here) doesn't really work with
> mailto and &body in it, with or without rfc2368.el .
> It seems all that happens is that a header "body" gets inserted (?).

I know `gnus-user-agent' that old versions of Gnus provided was
incomplete (some arguments weren't passed to `compose-mail', etc.).

> I could bypass that with

> (setq w3m-mailto-url-function 'gnus-url-mailto)

> , however, so something like

> (w3m-browse-url
>   "mailto:test@xxxxxxxxxxxxx?subject=test&body=bla"; t) <-C-x C-e

> now works as expected.

I tried this `(w3m-browse-url ...)' and got:

,----
| Body: bla
| To: test@xxxxxxxxxxxxx
| Subject: test
| --text follows this line--
| (empty body)
`----

It has to be fixed so as to insert a body=bla to the message body,
I think.

> ... icicle-send-bug-report however does not. Hu?

> Turns out this part of w3m-goto-url kicks in:
>   (when (and (stringp url)
> 	     (not (w3m-interactive-p)))
>     (setq url (w3m-canonicalize-url url)))
> before we get to the
>   ;; process mailto: protocol
> bit.

> What does w3m-canonicalize-url do?
>      (t
>       (concat "http://"; url)))))

It does:
(w3m-canonicalize-url "www.example.com")
  => "http://www.example.com";
(w3m-canonicalize-url "/home/yamaoka/.emacs")
  => "file:///home/yamaoka/.emacs"
etc., but does nothing with "mailto:...";.

> So, "http://"; gets added to the 'url' and
>    ((string-match "\\`mailto:"; url)
>     (w3m-goto-mailto-url url post-data))
> doesn't match anymore.

It matches as far as I can observe.  I'm using the latest emacs-w3m,
the latest a Gnus, ...

> I am not sure if my analysis is correct, but it certainly doesn't work.

> Question is: Should it?