emacs-devel
[Top][All Lists]
Advanced

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

mailto body


From: Katsumi Yamaoka
Subject: mailto body
Date: Tue, 09 Nov 2010 10:32:14 +0900
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)

Hi,

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

(browse-url-mail
 "mailto:address@hidden&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 via email to

[Prev in Thread] Current Thread [Next in Thread]