unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
To: emacs-devel@gnu.org
Cc: ding@gnus.org
Subject: mailto body
Date: Tue, 09 Nov 2010 10:32:14 +0900	[thread overview]
Message-ID: <b4mhbfrwach.fsf@jpl.org> (raw)

Hi,

`browse-url-mail' looks as though it disregards the body part of
a mailto url.  Try this:

(browse-url-mail
 "mailto:nobody@example.com?subject=test&body=Hello%20World%0d%0a")

In reality, you can yank the body part by `C-c C-y'.  However, a
user will not know the body part is there since a raw mailto url
is not displayed in an html article[1] generally.  No one likely
knows that `C-c C-y' is the command to yank it.  Moreover, citing
it with `>'s will probably not be what the OP intended.  I think
a body text should be in a mail buffer as is from the beginning,
and `C-c C-y' should be always the command to yank the original
article with `>'s.  Could you approve of?  A patch is below.

[1] Gnus now displays html articles using shr.el by default.  We
plan to use `browse-url-mail' in it.

--8<---------------cut here---------------start------------->8---
--- browse-url.el~	2010-10-11 22:17:42 +0000
+++ browse-url.el	2010-11-09 01:30:14 +0000
@@ -1486,13 +1486,18 @@
 	   (mail-citation-hook (unless body mail-citation-hook)))
       (if (browse-url-maybe-new-window new-window)
 	  (compose-mail-other-window to subject rest nil
-				     (if body
-					 (list 'insert body)
-				       (list 'insert-buffer (current-buffer))))
+				     (list 'insert-buffer (current-buffer)))
 	(compose-mail to subject rest nil nil
-		      (if body
-			  (list 'insert body)
-			(list 'insert-buffer (current-buffer))))))))
+		      (list 'insert-buffer (current-buffer))))
+      (when body
+	(goto-char (point-min))
+	(unless (or (search-forward (concat "\n" mail-header-separator "\n")
+				    nil 'move)
+		    (bolp))
+	  (insert "\n"))
+	(insert (replace-regexp-in-string "\r\n" "\n" body))
+	(unless (bolp)
+	  (insert "\n"))))))
 
 ;; --- Random browser ---
 
--8<---------------cut here---------------end--------------->8---



             reply	other threads:[~2010-11-09  1:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-09  1:32 Katsumi Yamaoka [this message]
2010-11-09 17:48 ` mailto body Lars Magne Ingebrigtsen
2010-11-10  0:03   ` Katsumi Yamaoka

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=b4mhbfrwach.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    --cc=ding@gnus.org \
    --cc=emacs-devel@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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).