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

w3m-browse-url and mailto



Hi,

I tried to send a bugreport with icicle-send-bug-report, which looks
like this:

--8<---------------cut here---------------start------------->8---
(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))))
--8<---------------cut here---------------end--------------->8---

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

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 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. 
... icicle-send-bug-report however does not. Hu?

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

What does w3m-canonicalize-url do?
--8<---------------cut here---------------start------------->8---
     (t
      (concat "http://"; url)))))
--8<---------------cut here---------------end--------------->8---

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

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

Question is: Should it?