summaryrefslogtreecommitdiff
path: root/lisp/url/url-mailto.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2005-09-01 16:38:39 +0000
committerChong Yidong <cyd@stupidchicken.com>2005-09-01 16:38:39 +0000
commit6fd388f37c90d733cd11925c73acfb6af17907cd (patch)
treef394dd8c52dc78d9a0995b7103142944392d63d9 /lisp/url/url-mailto.el
parent02de72e92c954fc0c1e125276af9f024bca437a8 (diff)
downloademacs-6fd388f37c90d733cd11925c73acfb6af17907cd.tar.gz
*** empty log message ***
Diffstat (limited to 'lisp/url/url-mailto.el')
-rw-r--r--lisp/url/url-mailto.el17
1 files changed, 12 insertions, 5 deletions
diff --git a/lisp/url/url-mailto.el b/lisp/url/url-mailto.el
index 86f5d4a88b6..9b63a35f3bd 100644
--- a/lisp/url/url-mailto.el
+++ b/lisp/url/url-mailto.el
@@ -73,7 +73,7 @@
(setq headers-start (match-end 0)
to (url-unhex-string (substring url 0 (match-beginning 0)))
args (url-parse-query-string
- (substring url headers-start nil) t))
+ (substring url headers-start nil) t t))
(setq to (url-unhex-string url)))
(setq source-url (url-view-url t))
(if (and url-request-data (not (assoc "subject" args)))
@@ -84,16 +84,23 @@
(if (and source-url (not (assoc "x-url-from" args)))
(setq args (cons (list "x-url-from" source-url) args)))
- (if (assoc "to" args)
- (push (cdr (assoc "to" args)) to)
- (setq args (cons (list "to" to) args)))
+ (let ((tolist (assoc "to" args)))
+ (if tolist
+ (if (not (string= to ""))
+ (setcdr tolist
+ (list (concat to ", " (nth 1 tolist)))))
+ (setq args (cons (list "to" to) args))))
+
(setq subject (cdr-safe (assoc "subject" args)))
(if (fboundp url-mail-command) (funcall url-mail-command) (mail))
(while args
(if (string= (caar args) "body")
(progn
(goto-char (point-max))
- (insert (mapconcat 'identity (cdar args) "\n")))
+ (insert (mapconcat
+ #'(lambda (string)
+ (replace-regexp-in-string "\r\n" "\n" string))
+ (cdar args) "\n")))
(url-mail-goto-field (caar args))
(setq func (intern-soft (concat "mail-" (caar args))))
(insert (mapconcat 'identity (cdar args) ", ")))